Skip to content

[BUG]: AzureFunctionApp@2 - 400 BadRequest warning on every Flex Consumption deployment due to FunctionAppScaleLimit in config update #22254

@spatelshield

Description

@spatelshield

New issue checklist

Task name

AzureFunctionApp

Task version

2.275.1

Issue Description

When deploying to a Flex Consumption (FC1) function app using AzureFunctionApp@2 with isFlexConsumption: true, the task emits a ##[warning] on every run due to a 400 BadRequest from the ARM API during the post-deploy configuration update step.

Expected: Deployment completes with no warnings. When isFlexConsumption: true is set, the task should not attempt to write configuration properties that are invalid for Flex Consumption sites.

Actual: The following warning is emitted after every deployment:

##[warning]Failed to update App Service configuration details. Error: Error: Failed to up/date App service 'func-*' configuration. Error: BadRequest - The following site configuration property (Site.SiteConfig.FunctionAppScaleLimit) for Flex Consumption sites is invalid. Please remove or rename it before retrying. (CODE: 400)

The zip deployment itself succeeds; only the post-deploy config update step fails.

Function app created with bicep deployed using #AzureResourceManagerTemplateDeployment@3 task:

resource functionApp 'Microsoft.Web/sites@2025-03-01' = {
  name: functionAppName
  location: location
  kind: 'functionapp,linux'
  identity: {
    type: 'SystemAssigned'
  }
  properties: {
    clientAffinityEnabled: false
    serverFarmId: hostingPlan.id
    httpsOnly: true
    functionAppConfig: {
      deployment: {
        storage: {
          type: 'blobContainer'
          value: '${storageAccount.properties.primaryEndpoints.blob}${deploymentContainerName}'
          authentication: {
            type: 'SystemAssignedIdentity'
          }
        }
      }
      scaleAndConcurrency: {
        maximumInstanceCount: 40
        instanceMemoryMB: 512
        triggers: {
          http: {
            perInstanceConcurrency: 4
          }
        }
      }
      runtime: {
        name: 'dotnet-isolated'
        version: '8.0'
      }
    }
  }
  dependsOn: [
    deploymentContainer
  ]
}

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

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

Azure DevOps Server type

dev.azure.com (formerly visualstudio.com)

Azure DevOps Server Version (if applicable)

No response

Operation system

Image: ubuntu-24.04 Version: 20260607.184.1

Relevant log output

Starting: Deploy Function App
==============================================================================
Task         : Azure Functions Deploy
Description  : Update a function app with .NET, Python, JavaScript, PowerShell, Java based web applications
Version      : 2.275.1
Author       : Microsoft Corporation
Help         : https://aka.ms/azurefunctiontroubleshooting
==============================================================================
Got service connection details for Azure App Service:'****'
The Deployment Type option does not apply for Flex Consumption.
##[warning]Failed to update App Service configuration details. Error: Error: Failed to update App service '****' configuration. Error: BadRequest - The following site configuration property (Site.SiteConfig.FunctionAppScaleLimit) for Flex Consumption sites is invalid.  Please remove or rename it before retrying. (CODE: 400)
    at AzureAppService.<anonymous> (/home/vsts/work/_tasks/AzureFunctionApp_501dd25d-1785-43e4-b4e5-a5c78ccc0573/2.275.1/node_modules/azure-pipelines-tasks-azure-arm-rest/azure-arm-app-service.js:543:23)
    at Generator.next (<anonymous>)
    at fulfilled (/home/vsts/work/_tasks/AzureFunctionApp_501dd25d-1785-43e4-b4e5-a5c78ccc0573/2.275.1/node_modules/azure-pipelines-tasks-azure-arm-rest/azure-arm-app-service.js:5:58)
    at process.processTicksAndRejections (node:internal/process/task_queues:104:5)
Successfully added release annotation to the Application Insight : ****
App Service Application URL: https://****.azurewebsites.net
Finishing: Deploy Function App

Full task logs with system.debug enabled

Details
 [REPLACE THIS WITH YOUR INFORMATION] 

Repro steps

- task: AzureFunctionApp@2
  inputs:
    connectedServiceNameARM: '<service-connection>'
    appType: functionAppLinux
    isFlexConsumption: true
    appName: '<function-app-name>'
    package: '<path-to-deployment.zip>'

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions