azure-pipelines-tasks: [BUG]: AzureFunctionApp@2 recommending to add a variable that it removes

Task name

AzureFunctionApp

Task version

2

Environment type (Please select at least one enviroment where you face this issue)

  • Self-Hosted
  • Microsoft Hosted
  • VMSS Pool
  • Container

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

Got service connection details for Azure App Service:'<FunctionName>'
NOTE: Skipping AzureWebJobsStorage connection string validation since Key Vault reference is used.
Deleting App Service Application settings. Data: ["WEBSITE_RUN_FROM_ZIP","WEBSITE_RUN_FROM_PACKAGE"]
App Service Application settings are already present.
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 unless you are targeting one of the following scenarios: 1. Using portal editing. 2. Running post deployment scripts. 3. Need write permission in wwwroot. 4. Using custom handler with special requirements. NOTE: If you decide to update app setting WEBSITE_RUN_FROM_PACKAGE = 1, you will have to re-deploy your code. "
Package deployment using ZIP Deploy initiated.
....

The task first deletes the WEBSITE_RUN_FROM_PACKAGE variable from the Azure function, then it complains that it should exist.

About this issue

  • Original URL
  • State: open
  • Created 3 years ago
  • Reactions: 1
  • Comments: 30 (11 by maintainers)

Most upvoted comments

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:

Starting: Deploy FunctionApp

Task : Azure Functions Deploy Description : Update a function app with .NET, Python, JavaScript, PowerShell, Java based web applications Version : 2.231.0 Author : Microsoft Corporation Help : https://aka.ms/azurefunctiontroubleshooting

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 ##[warning]"ZipDeploy Validation WARNING: It is recommended to set app setting WEBSITE_RUN_FROM_PACKAGE = 1 unless you are targeting one of the following scenarios: 1. Using portal editing. 2. Running post deployment scripts. 3. Need write permission in wwwroot. 4. Using custom handler with special requirements. NOTE: If you decide to update app setting WEBSITE_RUN_FROM_PACKAGE = 1, you will have to re-deploy your code. " 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”).

Hello,

@ki-dro could you please send the app name for this run to finbarr AT microsoft.com

I was suspecting that the call to get the app settings for the Kudu site was timing out and your logs confirm this.

I’ll see why this is and come back to you.

Thanks,

Finbar

Logs are from 2025-02-28T13:34:35, Image

@FinVamp1, any updates on this? We are still experiencing the issue

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:

image

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