Fail to deploy .net core function app using az functionapp deployment source config-zip
See original GitHub issue
az feedbackauto-generates most of the information requested below, as of CLI version 2.2.0
Describe the bug
When deploying a .net core function app to Azure Functions on Windows App Service Plan, the deployment fails if it requires changes in app settings.
There’s a race condition here:
- If the app settings are changed before or after the deployment is initiated, the build fails.
- If the app settings are not changed before the deployment is initiated, the build succeeds.
To Reproduce
- Create a .Net Core 2.2 Function App in Windows Standard App Service Plan
- Prepare a simple function app content, and compress it into a zip file.
- Run the command to change the appsettings az functionapp config appsettings set -n $functionAppName -g $resourceGroupName --settings APPINSIGHTS_INSTRUMENTATIONKEY=$instrumentationKey
- Run the command az functionapp deployment source config-zip -g $resourceGroupName -n $functionAppName --src <local_zip_file>
- Wait a while and will see the deployment failure error
Expected behavior
The deployment should succeed.
Environment summary
DevOps Hosted Agent: Ubuntu 16.04 Azure CLI Task Shell Type: bash CLI Version: azure-cli 2.2.0
command-modules-nspkg 2.0.3 core 2.2.0 nspkg 3.0.4 telemetry 1.0.4
Extensions: azure-devops 0.17.0
Python location ‘/opt/az/bin/python3’ Extensions directory ‘/opt/az/azcliextensions’
Python (Linux) 3.6.5 (default, Mar 6 2020, 14:41:35) [GCC 5.4.0 20160609]
Legal docs and information: aka.ms/AzureCliLegal
Your CLI is up-to-date.
Additional context
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:11 (3 by maintainers)
Top Results From Across the Web
GitHub Actions Function App config-zip error
The error is with Azure Function App zip deployment. az functionapp deployment source config-zip. The workaround is to downgrade ...
Read more >AuthorizationFailed az functionapp deployment source ...
To perform any operations like Create, Update, Deploy or delete on the Function App-level tasks, Contributor role is enough for the user.
Read more >How to Deploy your Azure Functions Faster and Easily with ...
I will create the Azure Function App and storage using an Azure Resource Manager ... Deploying Function Code" az functionapp deployment source config-zip...
Read more >Pipeline Azure Functions Task issues - Visual Studio Feedback
For now we've deploying the functions using power shell scripts ( az functionapp deployment source config-zip ) as a work around, but we're...
Read more >Azure Functions Zip Deploy with Azure AD Authentication
Do you think that the AZ cli's built-in `az functionapp deployment source config-zip` command will be able to automatically inject an Azure AD ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

We are also seeing this issue on both v2.2.0 and v2.3.1 when deploying function apps. Last successful deployment was on v2.1.0
Looks like the app was still restarting after changing the app setting when you started the deployment command. Can you either wait until the restart completes or change the setting after deployment is complete?