Alex Gordon
Alex Gordon

Reputation: 60841

Unable to deploy out of the box web app ARM template

I'm getting the following issue when attempting to deploy an ARM template with an out of the box web app:

enter image description here

2025-01-15T15:37:52.2594815Z There were errors in your deployment. Error code: InvalidTemplateDeployment.
2025-01-15T15:37:52.2618202Z ##[error]The template deployment 'azuredeploy-20250115-153750-902c' is not valid according to the validation procedure. The tracking id is 'cc829d95-7ccc-4d9c-8e3f-192ba5c58dff'. See inner errors for details.
2025-01-15T15:37:52.2626315Z ##[error]Details:
2025-01-15T15:37:52.2634875Z ##[error]Unauthorized: Operation cannot be completed without additional AZ quota. Please file a support ticket to request a limit increase. 
Additional details - Location: Central US 
Current Limit (Premium0V3 VMs): 0. 
Current Usage: 0. 
Amount required for this deployment (Premium0V3 VMs): 1. 
(Minimum) New Limit that you should request to enable this deployment: 1. 
Note that if you experience multiple scaling operations failing (in addition to this one) and need to accommodate the aggregate quota requirements of these operations, you will need to request a higher quota limit than the one currently displayed.
2025-01-15T15:37:52.2637283Z ##[warning]Validation errors were found in the Azure Resource Manager template. This can potentially cause template deployment to fail. Task failed while creating or updating the template deployment.. Please follow https://docs.microsoft.com/en-us/azure/azure-resource-manager/templates/template-syntax
2025-01-15T15:37:52.2638077Z Starting Deployment.
2025-01-15T15:37:52.2638645Z Deployment name is azuredeploy-20250115-153750-902c
2025-01-15T15:37:53.7869944Z There were errors in your deployment. Error code: InvalidTemplateDeployment.
2025-01-15T15:37:53.7871162Z ##[error]The template deployment 'azuredeploy-20250115-153750-902c' is not valid according to the validation procedure. The tracking id is '8dd9d54b-8b9a-4735-9a88-0da4debafcee'. See inner errors for details.
2025-01-15T15:37:53.7888618Z ##[error]Details:
2025-01-15T15:37:53.7893200Z ##[error]Unauthorized: Operation cannot be completed without additional AZ quota. Please file a support ticket to request a limit increase. 
Additional details - Location: Central US 
Current Limit (Premium0V3 VMs): 0. 
Current Usage: 0. 
Amount required for this deployment (Premium0V3 VMs): 1. 
(Minimum) New Limit that you should request to enable this deployment: 1. 
Note that if you experience multiple scaling operations failing (in addition to this one) and need to accommodate the aggregate quota requirements of these operations, you will need to request a higher quota limit than the one currently displayed.
2025-01-15T15:37:53.7903569Z ##[error]Check out the troubleshooting guide to see if your issue is addressed: https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/deploy/azure-resource-group-deployment?view=azure-devops#troubleshooting
2025-01-15T15:37:53.7909952Z ##[error]Task failed while creating or updating the template deployment.
2025-01-15T15:37:53.8018686Z ##[section]Finishing: ARM Template deployment: Resource Group scope

The way I generated this template is by simply going to the portal and creating a Web App resource. Here's the arm template:

{
  "$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
  "contentVersion": "1.0.0.0",
  "parameters": {
    "subscriptionId": {
      "type": "string"
    },
    "resourceGroupName": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "location": {
      "type": "string"
    },
    "hostingPlanName": {
      "type": "string"
    },
    "serverFarmResourceGroup": {
      "type": "string"
    },
    "alwaysOn": {
      "type": "bool"
    },
    "ftpsState": {
      "type": "string"
    },
    "autoGeneratedDomainNameLabelScope": {
      "type": "string"
    },
    "sku": {
      "type": "string"
    },
    "skuCode": {
      "type": "string"
    },
    "workerSize": {
      "type": "string"
    },
    "workerSizeId": {
      "type": "string"
    },
    "numberOfWorkers": {
      "type": "string"
    },
    "currentStack": {
      "type": "string"
    },
    "phpVersion": {
      "type": "string"
    },
    "netFrameworkVersion": {
      "type": "string"
    }
  },
  "variables": {},
  "resources": [
    {
      "apiVersion": "2022-03-01",
      "name": "[parameters('name')]",
      "type": "Microsoft.Web/sites",
      "location": "[parameters('location')]",
      "tags": {},
      "dependsOn": [
        "microsoft.insights/components/xxxxxxxxxxxxxxxxx-webapp-again",
        "[concat('Microsoft.Web/serverfarms/', parameters('hostingPlanName'))]"
      ],
      "properties": {
        "name": "[parameters('name')]",
        "siteConfig": {
          "appSettings": [
            {
              "name": "APPLICATIONINSIGHTS_CONNECTION_STRING",
              "value": "[reference('microsoft.insights/components/xxxxxxxxxxxxxxxxx-webapp-again', '2015-05-01').ConnectionString]"
            },
            {
              "name": "ApplicationInsightsAgent_EXTENSION_VERSION",
              "value": "~2"
            },
            {
              "name": "XDT_MicrosoftApplicationInsights_Mode",
              "value": "default"
            }
          ],
          "metadata": [
            {
              "name": "CURRENT_STACK",
              "value": "[parameters('currentStack')]"
            }
          ],
          "phpVersion": "[parameters('phpVersion')]",
          "netFrameworkVersion": "[parameters('netFrameworkVersion')]",
          "alwaysOn": "[parameters('alwaysOn')]",
          "ftpsState": "[parameters('ftpsState')]"
        },
        "serverFarmId": "[concat('/subscriptions/', parameters('subscriptionId'),'/resourcegroups/', parameters('serverFarmResourceGroup'), '/providers/Microsoft.Web/serverfarms/', parameters('hostingPlanName'))]",
        "clientAffinityEnabled": true,
        "virtualNetworkSubnetId": null,
        "httpsOnly": true,
        "publicNetworkAccess": "Enabled",
        "autoGeneratedDomainNameLabelScope": "[parameters('autoGeneratedDomainNameLabelScope')]"
      },
      "resources": [
        {
          "type": "Microsoft.Web/sites/basicPublishingCredentialsPolicies",
          "apiVersion": "2022-09-01",
          "name": "[concat(parameters('name'), '/scm')]",
          "properties": {
            "allow": false
          },
          "dependsOn": [
            "[resourceId('Microsoft.Web/Sites', parameters('name'))]"
          ]
        },
        {
          "type": "Microsoft.Web/sites/basicPublishingCredentialsPolicies",
          "apiVersion": "2022-09-01",
          "name": "[concat(parameters('name'), '/ftp')]",
          "properties": {
            "allow": false
          },
          "dependsOn": [
            "[resourceId('Microsoft.Web/Sites', parameters('name'))]"
          ]
        }
      ]
    },
    {
      "apiVersion": "2018-11-01",
      "name": "[parameters('hostingPlanName')]",
      "type": "Microsoft.Web/serverfarms",
      "location": "[parameters('location')]",
      "kind": "",
      "tags": {},
      "dependsOn": [],
      "properties": {
        "name": "[parameters('hostingPlanName')]",
        "workerSize": "[parameters('workerSize')]",
        "workerSizeId": "[parameters('workerSizeId')]",
        "numberOfWorkers": "[parameters('numberOfWorkers')]",
        "zoneRedundant": true
      },
      "sku": {
        "Tier": "[parameters('sku')]",
        "Name": "[parameters('skuCode')]"
      }
    },
    {
      "apiVersion": "2020-02-02-preview",
      "name": "xxxxxxxxxxxxxxxxx-webapp-again",
      "type": "microsoft.insights/components",
      "location": "centralus",
      "tags": {},
      "dependsOn": [],
      "properties": {
        "ApplicationId": "[parameters('name')]",
        "Request_Source": "IbizaWebAppExtensionCreate",
        "Flow_Type": "Redfield",
        "Application_Type": "web",
        "WorkspaceResourceId": "/subscriptions/xxxxxxxxxxxxxxxxx/resourceGroups/DefaultResourceGroup-CUS/providers/Microsoft.OperationalInsights/workspaces/DefaultWorkspace-xxxxxxxxxxxxxxxxx-CUS"
      }
    }
  ]
}

What am I doing wrong? What is the issue with this ARM template?

I've also validated the ARM template with powershell:

PS C:\Windows\system32> Test-AzResourceGroupDeployment `
>>   -ResourceGroupName "myResourceGroup" `
>>   -TemplateFile "C:\Users\aaa\source\repos\eee.ooo.Services\ARMTemplates\azuredeploy.json" `
>>   -TemplateParameterFile "C:\Users\aaa\source\repos\eee.ooo.Services\ARMTemplates\azuredeploy.parameters.json"

And getting the following error

InvalidTemplateDeployment - The template deployment '8c95d018-a173-4c44-842c-8dd8f6bf679c' is not valid according to
the validation procedure. The tracking id is '5961d199-9804-47c5-9220-1aa6e6e7f87a'. See inner errors for details.
Unauthorized - Operation cannot be completed without additional AZ quota. Please file a support ticket to request a
limit increase.
Additional details - Location: Central US
Current Limit (Premium0V3 VMs): 0.
Current Usage: 0.
Amount required for this deployment (Premium0V3 VMs): 1.
(Minimum) New Limit that you should request to enable this deployment: 1.
Note that if you experience multiple scaling operations failing (in addition to this one) and need to accommodate the
aggregate quota requirements of these operations, you will need to request a higher quota limit than the one currently
displayed.
WARNING: You're using Az.Resources version 6.16.2. The latest version of Az.Resources is 7.8.0. Upgrade your Az modules
 using the following commands:
  Update-Module Az.* -WhatIf    -- Simulate updating your Az modules.
  Update-Module Az.*            -- Update your Az modules.

Upvotes: 0

Views: 71

Answers (2)

Adeniyi Osofuye
Adeniyi Osofuye

Reputation: 1

The error says you don't have enough quota as your Current Limit for is Premium0V3 VMs is 0. Also, your Current Usage is 0.

The Amount required for this deployment (Premium0V3 VMs): 1.

So you need to request for more (Premium0V3 VMs) for the deployment to be successful.

https://learn.microsoft.com/en-us/azure/quotas/quickstart-increase-quota-portal

Upvotes: 0

bryanbcook
bryanbcook

Reputation: 18328

I don't think the issue is with your ARM template. The error message implies that you're exceeding the quota for that type of resource in your azure subscription + region, but because the current limit is '0' this implies that the SKU isn't available or not configured for your subscription.

The support article for P1V3 outlines a few activities to verify:

  1. Check if the SKU is available in your region (az appservice list-locations --sku P1V3). Your error message says Central US, which is a supported region.
  2. Check that the Premium SKU is supported by App Service Plan by trying to scale up or scale out.

As the error message implies, this can be corrected by submitting a limit adjustment request through the azure portal: Subscriptions > Usages + Quota. I believe the PremiumV3 app service plan uses DsV3 or DsV4 VM series.

As others have pointed out, another option is to deploy to a different region.

Another possibility is that the Microsoft.Compute resource provider hasn't been abled on the subscription.

Upvotes: 0

Related Questions