pythondeploymentazure-functionscontainersalwayson

create azure functionapp from docker image via cli


I deployed an azure functionapp with the preview Flex Consumption plan, which doesn't include 'Site.SiteConfig.AlwaysOn' which i do not want.

When deploying via CLI like so: az functionapp create --name $FUNCTION_APP_NAME --storage-account $STORAGE_ACCOUNT --resource-group $RESOURCE_GROUP
--plan $FUNCTION_APP_SERVICE_PLAN --functions-version 4
--image $ACR_NAME.azurecr.io/myimage:01
--registry-password
--registry-username

I get this error: The following site configuration property (Site.SiteConfig.AlwaysOn) for Flex Consumption sites is invalid. Please remove or rename it before retrying.

I wonder, where the configuration property (Site.SiteConfig.AlwaysOn) comes from because i havn't set it anywhere. Hence a cannot remove or rename it.


Solution

  • Currently, the az functionapp create command does not allow the re-use of existing consumption plans.

    Flex Consumption Plans can only be deployed by removing:

    --plan planName
    

    and substituting it with

    --flexconsumption-location eastus
    

    You'll want to set the correct region, of course. You can get all of the possible values by running:

    az functionapp list-flexconsumption-locations
    

    It's not ideal, but this should make the command work.

    You can follow the state of this issue here.