Search code examples
azureazure-devopsazure-resource-managerappinsights

why does app insights need to be turned on manually after automated release?


Why doesn't app insights turn on automatically after the release?

After executing the automated release, I'm getting this when navigating to app insights in the portal:

enter image description here

Here's how I've defined this in my ARM template:

{
  "type": "microsoft.insights/components",
  "kind": "web",
  "name": "[parameters('webAppName')]",
  "apiVersion": "2015-05-01",
  "location": "[parameters('location')]",
  "tags": {
    "[concat('hidden-link:', resourceGroup().id, '/providers/Microsoft.Web/sites/', parameters('webAppName'))]": "Resource",
    "displayName": "[parameters('webAppName')]"
  },
  "properties": {
    "Application_Type": "web"
  },
  "dependsOn": []
}

What am I doing wrong? Why isn't app insights automatically turned on?

Please note that I've added the following appsettings:

enter image description here


Solution

  • The accepted answer is outdated. It's not recommended to use APPINSIGHTS_INSTRUMENTATIONKEY with APPLICATIONINSIGHTS_CONNECTION_STRING. Whichever is provided last wins.

    Using instrumentation key is deprecated, we should transition to using APPLICATIONINSIGHTS_CONNECTION_STRING instead.

    Otherwise provided answer holds true. More info here:

    https://learn.microsoft.com/en-us/azure/azure-monitor/app/migrate-from-instrumentation-keys-to-connection-strings