Flex Consumption pricing tier is not enabled for this subscription

Rajoli Hari Krishna 596 Reputation points
2025-01-04T16:26:33.3033333+00:00

HI Microsoft Azure Team,

Greetings for the day and Wish you a happy new year.

I'm deploying the Azure Function App in Flex Consumption Model. Using the Portal, I'm able to deploy it successfully but using the bicep code deployment, getting an error as shown below:

Error:

New-AzResourceGroupDeployment: 9:41:52 PM - The deployment 'FlexFuncAppDeployment' failed with error(s). Showing 1 out of 1 error(s).
Status Message: Flex Consumption pricing tier is not enabled for this subscription. (Code: BadRequest)
 - Flex Consumption pricing tier is not enabled for this subscription. (Code:)
 -  (Code:BadRequest)
 -  (Code:)

Bicep Code:

resource storageAccount 'Microsoft.Storage/storageAccounts@2021-04-01' existing = {
  name: 'vvkstaccforflexfuncapp'
}

resource appInsights 'Microsoft.Insights/components@2020-02-02' existing = {
  name: 'vvkappinsightsforfuncapp'
}

resource flexappserviceplan 'Microsoft.Web/serverfarms@2024-04-01' = {
  name: 'vscodeflexappserviceplan'
  location:  'West US'
  sku: {
    name: 'FC1'
    tier: 'FlexConsumption'
    family: 'FC'
    capacity: 0
  }
  kind: 'functionapp'
  properties: {
    perSiteScaling: false
    elasticScaleEnabled: false
    maximumElasticWorkerCount: 1
    isSpot: false
    reserved: true
    isXenon: false
    hyperV: false
    targetWorkerCount: 0
    targetWorkerSizeId: 0
    zoneRedundant: false
  }
}

resource flexfunapp 'Microsoft.Web/sites@2024-04-01' = {
  name: 'vscodeflexfunapp'
  location: 'West US'
  kind: 'functionapp,linux'
  properties: {
    serverFarmId: flexappserviceplan.id
    siteConfig: {
      appSettings: [
        {
          name: 'AzureWebJobsStorage__accountName'
          value: storageAccount.name
        }
        {
          name: 'APPLICATIONINSIGHTS_CONNECTION_STRING'
          value: appInsights.properties.ConnectionString
        }
      ]
      numberOfWorkers: 1
    }
    functionAppConfig: {
      deployment: {
        storage: {
          type: 'blobcontainer'
          value: '${storageAccount.properties.primaryEndpoints.blob}container'
          authentication: {
            type: 'SystemAssignedIdentity'
          }
          
        }
      }
      scaleAndConcurrency: {
        maximumInstanceCount: 100
        instanceMemoryMB: 4096
      }
      runtime: {
        name: 'python'
        version: '3.11'
      }
    }
    httpsOnly: true
    publicNetworkAccess: 'Disabled'
    virtualNetworkSubnetId: '/subscriptions/<azure-subscription-id>/resourceGroups/vivekchak-rg/providers/Microsoft.Network/virtualNetworks/vnetforflexfuncapp/subnets/OutboundSubnet'    
  }
}



Following this MS Documentation, I have done the below things:

  1. Removed deprecated properties and used the required only.
  2. Creating the Function App with public network access disabled and enabling the virtual network integration.

Could you please assist me.

Thanks in Advance.

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

Accepted answer
  1. VenkateshDodda-MSFT 23,691 Reputation points Microsoft Employee
    2025-01-07T05:00:56.3166667+00:00

    @Rajoli Hari Krishna Thanks for posting your question in Microsoft Q&A, apologize for any inconvenience caused on this.

    I understand that you are unable to deploy flex-consumption function app from the portal in West US region.

    Currently below are the regions which are supported to deploy flex consumption function apps.

    northeurope,southeastasia,eastasia,eastus2,southcentralus,australiaeast,eastus,northcentralus(stage),westus2,uksouth,eastus2euap,westus3,swedencentral
    

    User's image

    Here is the Azure CLI command to check which regions support Flex consumption function apps.

    az functionapp list-flexconsumption-locations --output table
    

    I would suggest you try deploying to above suggested regions.

    Hope this helps, let me know if you have any further questions on this.

    Please accept as Yes if the answer is helpful so that it can help others in the community.

    0 comments No comments

0 additional answers

Sort by: Most helpful

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.