DevOps deployment of function app to flex consumption

Laura Cook 15 Reputation points
2025-01-23T10:03:11.3166667+00:00

Hello,

I have updated my old function app to use the flex consumption plan and I've updated the Azure Functions Deploy task in DevOps to have the flex consumption plan option marked as true, but when I run the deployment it says 'The Deployment Type option does not apply for Flex Consumption.' and does not attempt to upload my code.

User's image

User's image

Is there anything else that I need to change in the deployment task? It's currently trying to upload a zip that's created during the build. Is there a way for me to trigger OneDeploy instead of zip deploy in the task?

Many thanks

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,399 questions
{count} vote

2 answers

Sort by: Most helpful
  1. Khadeer Ali 2,945 Reputation points Microsoft Vendor
    2025-01-23T11:34:47.61+00:00

    @Laura Cook ,

    Welcome to Microsoft Q&A Platform!

    Thanks for reaching out. When you're deploying to the Azure Functions Flex Consumption plan, you can only use the One Deploy method. It looks like your current error is because your deployment is trying to use another method, probably zip deploy, which won't work here.

    To fix this, you'll need to tweak your Azure DevOps pipeline to use One Deploy. This means updating your deployment task to specify One Deploy and setting up a package source with the /onedeploy extension in your deployment config.

    If your pipeline is creating a zip file during the build, you'll need to make some changes to meet the One Deploy requirements. Usually, this means making the deployment package accessible to the Functions host and ensuring the settings are correctly configured.
    References:

    Hope this helps. Do let us know if you have any further queries.


    If this answers your query, do click Accept Answer and Yes for "Was this answer helpful." And if you have any further questions, let us know.


  2. SchnellAlexander-9256 0 Reputation points
    2025-02-07T08:09:19.5633333+00:00

    Hi, I managed to deploy from a zip file to an Azure Flex Consumption Plan with an Azure DevOps pipeline based on a yaml file. Therefore I used the yaml code below for the deployment stage, which uses Azure CLI. During the build stage I archived the package in the directory below and published it in the following way. Note, that if you are using a private Python package location, you have to specify PIP_EXTRA_INDEX_URL in the correct way in the app setting of your Azure Function.

    #Publish package
    - publish: $(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip
          artifact: drop
    
    $(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip #Archive directory
    
    
    - stage: Deploy
      displayName: Deploy stage
      dependsOn: Build
      condition: succeeded()
      jobs:
        - deployment: Deploy
          displayName: Deploy
          environment: 'development'
          pool:
            vmImage: $(vmImageName)
    
          strategy:
            runOnce:
              deploy:
    
                steps:
                - task: AzureCLI@2
                  displayName: 'Deploy using az cli'
                  inputs:
                    azureSubscription: $(azureSubscription)
                    scriptType: 'bash'
                    scriptLocation: 'inlineScript'
                    inlineScript: |
                      echo "Deploying using OneDeploy"
                      az functionapp deployment source config-zip \
                        --resource-group $(resourceGroupName) \
                        --name $(functionAppName) \
                        --src $(Pipeline.Workspace)/drop/$(Build.BuildId).zip
    
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.