This region has quota of 0 instances for your subscription. Try selecting different region or SKU."}

Hrishikesh Durg 0 Reputation points
2024-10-25T07:11:44.8+00:00

Seeing below errors while deploying app with Bicep file using GitHub actions

https://github.com/hrishidurg/toy-website-test/actions/runs/11503347556/job/32020419292

Pl let me know how to fix this error ?

=======

Warning: ERROR: {"code": "InvalidTemplateDeployment", "message": "The template deployment '12' is not valid according to the validation procedure. The tracking id is '40c5e031-c7fe-4b7d-82d8-85bae85f4df0'. See inner errors for details."}

17

18Inner Errors:

19{"code": "ValidationForResourceFailed", "message": "Validation failed for a resource. Check 'Error.Details[0]' for more information."}

20

21Inner Errors:

22{"code": "SubscriptionIsOverQuotaForSku", "message": "This region has quota of 0 instances for your subscription. Try selecting different region or SKU."}

23

24Error: Template validation failed.

Windows 11
Windows 11
A Microsoft operating system designed for productivity, creativity, and ease of use.
9,846 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Hrishikesh Durg 0 Reputation points
    2024-10-25T07:15:17.4133333+00:00

    Below is my main.bicep file ..Is there anything needs to modify wrt region or SKU //

    Am using Free Tier as my subscription for now .

    ============

    @description('The location into which your Azure resources should be deployed.')

    param location string = resourceGroup().location

    @description('Select the type of environment you want to provision. Allowed values are Production and Test.')

    @allowed([

    'Production'

    'Test'

    ])

    param environmentType string

    @description('A unique suffix to add to resource names that need to be globally unique.')

    @maxLength(13)

    param resourceNameSuffix string = uniqueString(resourceGroup().id)

    // Define the names for resources.

    var appServiceAppName = 'toy-website-${resourceNameSuffix}'

    var appServicePlanName = 'toy-website'

    var logAnalyticsWorkspaceName = 'workspace-${resourceNameSuffix}'

    var applicationInsightsName = 'toywebsite'

    var storageAccountName = 'mystorage${resourceNameSuffix}'

    // Define the SKUs for each component based on the environment type.

    var environmentConfigurationMap = {

    Production: {

    appServicePlan: {
    
      sku: {
    
        name: 'F1'
    
        capacity: 1
    
      }
    
    }
    
    storageAccount: {
    
      sku: {
    
        name: 'Standard_GRS'
    
      }
    
    }
    

    }

    Test: {

    appServicePlan: {
    
      sku: {
    
        name: 'F1'
    
      }
    
    }
    
    storageAccount: {
    
      sku: {
    
        name: 'Standard_GRS'
    
      }
    
    }
    

    }

    }

    resource appServicePlan 'Microsoft.Web/serverfarms@2022-03-01' = {

    name: appServicePlanName

    location: location

    sku: environmentConfigurationMap[environmentType].appServicePlan.sku

    }

    resource appServiceApp 'Microsoft.Web/sites@2022-03-01' = {

    name: appServiceAppName

    location: location

    properties: {

    serverFarmId: appServicePlan.id
    
    siteConfig: {
    
      appSettings: [
    
        {
    
          name: 'APPINSIGHTS_INSTRUMENTATIONKEY'
    
          value: applicationInsights.properties.InstrumentationKey
    
        }
    
        {
    
          name: 'APPLICATIONINSIGHTS_CONNECTION_STRING'
    
          value: applicationInsights.properties.ConnectionString
    
        }
    
      ]
    
    }
    

    }

    }

    resource logAnalyticsWorkspace 'Microsoft.OperationalInsights/workspaces@2022-10-01' = {

    name: logAnalyticsWorkspaceName

    location: location

    }

    resource applicationInsights 'Microsoft.Insights/components@2020-02-02' = {

    name: applicationInsightsName

    location: location

    kind: 'web'

    properties: {

    Application_Type: 'web'
    
    Request_Source: 'rest'
    
    Flow_Type: 'Bluefield'
    
    WorkspaceResourceId: logAnalyticsWorkspace.id
    

    }

    }

    resource storageAccount 'Microsoft.Storage/storageAccounts@2022-09-01' = {

    name: storageAccountName

    location: location

    kind: 'StorageV2'

    sku: environmentConfigurationMap[environmentType].storageAccount.sku

    }

    output appServiceAppHostName string = appServiceApp.properties.defaultHostName

    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.