Open israelhdz08 opened 9 months ago
Hi there, thanks for reporting this. Can you share your YAML file?
task: AzureFunctionApp@2
displayName: 'Deploy function'
inputs:
connectedServiceNameARM: 'ServiceConnector'
appType: 'functionApp'
appName: 'functionName'
deployToSlotOrASE: true
resourceGroupName: 'resourceGroup'
slotName: 'rc'
package: '$(System.DefaultWorkingDirectory)/function.zip'
deploymentMethod: 'zipDeploy'
Hello, @israelhdz08 in order for this to be a consistent experience we need to carry out the following steps.
1) Check the App Settings and remove any old app Settings that may conflict with the planned deployment options. 2) Validate the App Configuration to ensure that the app is ready for Deployment and log the warning messages. For this we call an endpoint on the Kudu\SCM Site "/api/zipdeploy/validate" 3) Before deploying the Zip Deploy package we will set back WEBSITE_RUN_FROM_PACKAGE=1 or URL depending on the scenario.
As the user owns the App Settings we need to follow this order to ensure that the app settings are configured correctly and to support moving from Run From Package =1 from Run From Package =URL.
I can see how this might be confusing and if you have any suggestions about how you would like to see this presented. We may have to think about if this could affect other scenarios.
Adding @patelchandni as well.
Hi,
I also face the same issue.
Occasionally, I have the below warning with this Function task.
I am using AUTO-DETECT as the deployment method.
- task: AzureFunctionApp@2
condition: eq('${{ parameters.action }}', 'create')
inputs:
connectedServiceNameARM: '${{parameters.connectionName}}'
appType: 'functionApp'
appName: '$(FunctionAppName)'
package: '$(Pipeline.Workspace)/**/*.zip'
appSettings:
'
'
deploymentMethod: 'auto'
When I see this error, although the deployment is successful the content of my function is not updated so I have a re-run the pipeline and it usually fixes the issue automatically.
Cheers,
This is in our backlog. Will check to see what improvements we could make to help this.
Same here, this seems more like a bug. We're using deployment method 'runFromPackage'. Whenever we see this warning, there's nothing deployed although the task reports that the web package has been deployed. When re-running the pipeline stage, the warning does not appear and the deploy goes fine.
- task: AzureFunctionApp@2
displayName: 'Deploy FunctionApp'
inputs:
azureSubscription: '${{ parameters.azureSubscription }}'
appType: 'functionApp'
appName: '${{ parameters.resourceName }}'
deployToSlotOrASE: true
resourceGroupName: '${{ parameters.resourceGroupName }}'
slotName: 'deployment'
package: '${{ parameters.packagePath }}'
deploymentMethod: 'runFromPackage'
Task log:
Got service connection details for Azure App Service:'xyz' Updating App Service Application settings. Data: {"WEBSITE_RUN_FROM_PACKAGE":"1"} Deleting App Service Application settings. Data: ["WEBSITE_RUN_FROM_ZIP"] Updated App Service Application settings and Kudu Application settings. Validating deployment package for functions app before Zip Deploy
Package deployment using ZIP Deploy initiated. Deploy logs can be viewed at https://xyz-deployment.scm.azurewebsites.net/api/deployments/abc/log The web package has been deployed to App Service. Please note that the package mount or extraction errors will be logged in the deployment logs in the location above. NOTE: Run From Package makes wwwroot read-only, so you will receive an error when writing files to this directory. App Service Application URL: https://xyz-deployment.azurewebsites.net/ Finishing: Deploy FunctionApp
We all of the sudden have the exact same issue @RobinDijkstra is mentioning above. Is there any update about his? We now don't dare to deploy anything to production in fear that we would have the same issue there as well.
We already rolled back any of our latest changes, but the issue seems Azure related. The functions all apear running, but they don't process any messages anymore after deploy.
Sometimes after rerunning the pipeline it works for several minutes and then breaks down again without any exception being logged (and the status still "running").
If you're still seeing this issue can you provide a Site Region and perhaps also check the AppSettings and let me know if you have this app setting? WEBSITE_ENABLE_SYNC_UPDATE_SITE = true or 1
Since a couple of weeks, we are facing the same issue using the AzureFunctionApp@1
task. Redeploy fixes the issue. We are in the West Europe region and we have the following app settings active:
Yaml:
- task: AzureFunctionApp@1
displayName: 'Azure Function App Deploy'
inputs:
azureSubscription: ${{ parameters.azServiceConnection }}
appType: functionApp
appName: 'func-${{ parameters.env }}-01'
package: '$(Agent.BuildDirectory)\drop\Function.zip'
Task output with warning:
Updating App Service Application settings. Data: {"WEBSITE_RUN_FROM_PACKAGE":"1"}
Deleting App Service Application settings. Data: ["WEBSITE_RUN_FROM_ZIP"]
Updated App Service Application settings and Kudu Application settings.
Validating deployment package for functions app before Zip Deploy
##[warning]"ZipDeploy Validation WARNING: It is recommended to set app setting WEBSITE_RUN_FROM_PACKAGE = 1 u***ess
We still have the issue but found a work-around by setting the pipeline into debug mode. We did this in order to troubleshoot the issue, but found that when the pipeline is running in debug mode the issue does not occur. Perhaps because of a process taking slightly longer in debug mode so something can complete. But it is strange that this all of the sudden started happening. All of the alterations mentioned within this thread were already tried and did not resolve the issue.
We're also having the setting WEBSITE_ENABLE_SYNC_UPDATE_SITE = true on all out function apps and are also located in the West Europe region.
We are also experiencing this issue. Are there any updates?
Hello all,
We've been investigating this issue and there is a timing issue where this can happen.
Our investigations have identified that the AzureRMWebAppDeployment tasks have logic to detect this situation and will wait until Kudu\SCM has the right settings.
So if you're running into this issue please let us know if using the AzureRMWebAppDeployment task resolves the issue for you and we are planning to make this change into the Functions Task in the current sprint.
We are also affected by this and when I tried to reproduce the issue with system.debug set to true I wasn't able to, which might indicate that this is indeed a timing issue that is "resolved" by slowing down the pipeline with debug mode.
We have a tracking item for the fix for this here Update FunctionApp Task
@FinVamp1 Thanks, I've found it but there is a character too many in the link.
@FinVamp1 Thanks, I've found it but there is a character too many in the link.
Thanks for the spot, I've updated the link.
Task name
AzureFunctionApp
Task version
2
Environment type (Please select at least one enviroment where you face this issue)
Azure DevOps Server type
Azure DevOps Server (Please specify exact version in the textbox below)
Azure DevOps Server Version (if applicable)
No response
Operation system
Windows 11
Task log
The task first deletes the WEBSITE_RUN_FROM_PACKAGE variable from the Azure function, then it complains that it should exist.