Steven
Steven

Reputation: 4963

Configure deployment template for application insights premium teir

Here is my deployment template section for application insights. It works. But I want to deploy to a different pricing tier\quota. What is the right parameter for that?

 {
  "apiVersion": "2014-04-01",
  "name": "[parameters('siteName')]",
  "type": "Microsoft.Insights/components",
  "location": "Central US",
  "dependsOn": [
    "[concat('Microsoft.Web/sites/', parameters('siteName'))]"
  ],
  "tags": {
    "[concat('hidden-link:', resourceGroup().id, '/providers/Microsoft.Web/sites/', parameters('siteName'))]": "Resource"
  },
  "properties": {
    "ApplicationId": "[parameters('siteName')]",
    "sku": "Premium"
  }

Upvotes: 2

Views: 1868

Answers (2)

gregjhogan
gregjhogan

Reputation: 2155

You can now set the pricing tier and quota for app insights via an ARM template.

https://learn.microsoft.com/en-us/azure/application-insights/app-insights-powershell#create-an-azure-resource-manager-template

Upvotes: 1

juvchan
juvchan

Reputation: 6245

You can define a "sku" parameter in your deployment template and use it as your parameter to control the pricing tier for your AI resource.

The "sku" parameter will be used by your "serverFarm" resource type to determine App Service Hosting Plan tier for your resources under the hosting plan.

"parameters": {
        "sku": {
            "type": "string",
            "allowedValues": [
                "Free",
                "Shared",
                "Basic",
                "Standard",
                "Premium"
            ],
            "defaultValue": "Premium"
        }
}

    {
        "type": "Microsoft.Web/serverfarms",
        "name": "[parameters('hostingPlanName')]",
        "apiVersion": "2015-08-01",
        "sku": {
            "name":  "P1",
            "tier": "[parameters('sku')]"
        },
        "properties": {
            "numberOfWorkers": "[parameters('numOfWorkers')]",
            "workerSize": "[parameters('workerSize')]"
        },
        "location": "[resourceGroup().location]"
    }

{
  "apiVersion": "2014-04-01",
  "name": "[parameters('siteName')]",
  "type": "Microsoft.Insights/components",
  "location": "Central US",
  "dependsOn": [
    "[concat('Microsoft.Web/sites/', parameters('siteName'))]"
  ],
  "tags": {
    "[concat('hidden-link:', resourceGroup().id, '/providers/Microsoft.Web/sites/', parameters('siteName'))]": "Resource"
  },
  "properties": {
    "applicationId": "[parameters('siteName')]"
  }

Update 1:

Based on the latest ARM template schema for Microsoft Application Insight, you could not define the tier property for it.

As I have highlighted before, the tier is only defined for the "serverFarm" or better known as App Service Hosting Plan resource.

Ref: azure-resource-manager-schemas/schemas/2014-04-01/Microsoft.Insights.json

"components": {
      "type": "object",
      "properties": {
        "type": {
          "enum": [
            "Microsoft.Insights/components"
          ]
        },
        "apiVersion": {
          "enum": [
            "2014-04-01"
          ]
        },
        "properties": {
          "type": "object",
          "properties": {
            "applicationId": {
              "type": "string",
              "minLength": 1,
              "description": "Microsoft.Insights/components: applicationId"
            }
          }
        }
      },
      "required": [
        "type",
        "apiVersion",
        "properties",
        "location"
      ],
      "description": "Microsoft.Insights/components"
    }

Upvotes: 0

Related Questions