Share via

Not able to deploy code zip to Azure Function App in Flex Consumption Plan via Bicep/Arm

Abhi Shah 0 Reputation points
2026-03-12T11:17:52.3733333+00:00

Hi Team,

I am unable to deploy my function code zip file (hosted on public url) into azure function app with Flex consumption plan.

I am using "Deploy to Azure" button feature and using IaC, deploying all the resources required.

Previously I was using Consumption plan and using the website package url property of the Application Setting, was able to deploy my code.zip

Now moving to the Flex Consumption plan, I am unable to deploy the code zip. Changes I did are as follows

  • Create blobservice and container within that - to store the code zip
  • Used deploymentScript to copy the zip to the container ( utilized managedIdentity with StorageBlobOwner role for this)
  • updated the Hosting Plan resource to include Flex Consumption plan
      resource hostingPlan 'Microsoft.Web/serverfarms@2024-04-01' = {
        name: hostingPlanName
        location: location
        kind: 'linux'
        sku: {
          tier: 'FlexConsumption'
          name: 'FC1'
        }
        properties: {
          reserved: true
        }
      }
    
  • withing Function App resource added functionAppConfig property
      functionAppConfig: {
            runtime: {
              name: 'java'
              version: '17'
            }
            scaleAndConcurrency: {
              instanceMemoryMB: 2048
              maximumInstanceCount: 3
            }
            deployment: {
              storage: {
                type: 'blobContainer'
                value: 'https://${storageAccount.name}.blob.core.windows.net/${container.name}'
                authentication: {
                  storageAccountConnectionStringName: storageConnString
                  type: 'SystemAssignedIdentity' 
                  userAssignedIdentityResourceId: scriptIdentity.id
                }
              }
            }
    

This creates the function app and other resources, but the function within the function app is not created - which i think is due to the code zip not being deployed within the function app.

Other resources that I am creating are -

  1. application insight
  2. Table Storage (creating 2 storage tables)
  3. KeyVault (storing 4 secrets)
  4. AccessPolicy ( for keyvault, granting access to functionapp.identity.principalid and currentUserObjectID - obtained from the custom template)
  5. RoleAssignment ( to grant tablestorage access to the function app)

Please let me know if I am missing something due to which I am not able to deploy the code zip.

Note: I tried with extensions - 'onedeploy' but it did not work as well

Azure DevOps
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Praveen Kumar Gudipudi 1,880 Reputation points Microsoft External Staff Moderator
    2026-03-12T12:00:12.35+00:00

    Hello Abhi Shah,

    When using Azure Functions with the Flex Consumption plan, the deployment behavior differs from the traditional Consumption plan. In Flex Consumption, the runtime expects the function code package to be retrieved from the storage location defined under functionAppConfig.deployment.storage. If the runtime cannot successfully access or load the package, the Function App will be created but no functions will appear, which is the behavior you are observing.

    A few things you may want to verify:

    1. Confirm the package is present in the container Ensure that the ZIP package containing the function code is successfully uploaded to the blob container during deployment. The container should contain the actual deployment package (for example, functionapp.zip). If the container is empty or the package upload fails, the runtime will not be able to load the functions.
    2. Validate the package structure Make sure the ZIP file contains the function app root structure. For example:
    host.json
    

    If the ZIP contains an additional parent folder (for example project-folder/host.json), the runtime may not detect any functions.

    1. Check storage access permissions Since the deployment configuration uses managed identity authentication, ensure that the Function App’s managed identity has the appropriate permissions on the storage account or container. Typically, the following role is required:

    Storage Blob Data Reader

    This allows the runtime to read the deployment package from the container.

    1. Identity configuration If SystemAssignedIdentity is specified in the deployment configuration, the access should be granted to the Function App’s system-assigned identity. If you intend to use a user-assigned identity instead, ensure the correct identity is referenced and has the necessary storage permissions.
    2. Verify runtime configuration Confirm that the runtime configuration matches the application package you are deploying:
    runtime:
    

    The function application must be built for the corresponding Java runtime supported by Azure Functions.


    If all resources are deployed successfully but functions are still not detected, another useful step is to check the Function App logs and deployment logs in Application Insights to see whether the runtime reports any issues while downloading or extracting the package.

    Please accept as answer and do a Thumbs-up to upvote this response if you are satisfied with the community help. Your upvote will be beneficial for the community users facing similar issues.

     

    0 comments No comments

  2. Q&A Assist
    2026-03-12T11:18:15.75+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    For Flex Consumption, function code must be deployed using the Flex-specific deployment model; the previous WEBSITE_RUN_FROM_PACKAGE approach from the Consumption plan does not apply.

    Key points from the Flex Consumption model:

    1. Code is stored in a deployment container
      • Flex Consumption apps keep the project code in a zip package in a blob storage container called the deployment container.
      • The deployment container is configured via functionAppConfig.deployment.storage in the function app resource.
      • That configuration only tells the app where its deployment container is and how to authenticate; it does not itself deploy the code.
    2. One Deploy is required
      • Flex Consumption requires using one deploy to publish the code package to the deployment container.
      • The package file must be named released-package.zip.
      • If the package is uploaded directly to the container without using one deploy, it is not automatically deployed and the functions will not appear.
    3. Correct deployment.storage configuration
      • deployment.storage must specify:
        • type: 'blobContainer'.
        • value: the blob container endpoint (as in the example).
        • authentication: either managed identity or a storage account connection string.
      • When using managed identity, authentication.type must be SystemAssignedIdentity (or user-assigned) and the function app’s identity must have appropriate blob permissions (for example, Storage Blob Data Owner) on the storage account.
      • When using a connection string, authentication.type must be StorageAccountConnectionString and authentication.storageAccountConnectionStringName must be the name of the app setting that holds the connection string.
      • Mixing storageAccountConnectionStringName with SystemAssignedIdentity is not valid; choose one authentication mode and configure only the properties that apply to that mode.
    4. What is missing in the current setup
      • The current Bicep snippet configures deployment.storage but does not perform a one deploy operation.
      • Copying the zip into the container via deploymentScript alone is not sufficient; Flex Consumption will not treat that as a deployment.
      • The code package must be:
        • Named released-package.zip.
        • Published via a one deploy source (/onedeploy resource) that points to the remote package URL.
    5. Required changes
      • Ensure the deployment container is correctly configured in functionAppConfig.deployment.storage with a valid authentication mode:
        • If using managed identity:
          • authentication.type: 'SystemAssignedIdentity' (or user-assigned).
          • Grant the function app’s identity blob access on the storage account.
          • Do not set storageAccountConnectionStringName in this case.
        • If using a connection string:
          • authentication.type: 'StorageAccountConnectionString'.
          • Set authentication.storageAccountConnectionStringName to the name of the app setting that contains the connection string.
      • Rename the code package in the container to released-package.zip.
      • Add a one deploy source in the ARM/Bicep template using the /onedeploy resource that references the remote URL of the package. The Functions host must be able to access both the remote package source and the deployment container.

    Once the deployment container is correctly configured and the code is published via one deploy as released-package.zip, the function app should load the code and the functions will appear.


    References:

    0 comments No comments

Your answer

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