Hi,
We use ARM templates and Azure DevOps to deploy our Application Insights resource and Azure Web App. We then use Azure DevOps to install the Application Insights site extension to the Web App.
I've noticed that using this approach, I still get the message telling me to update my Application Insights site extension. How do we automate the installation of the updated Application Insights site extension?
Thanks,
Joe
⚠Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
Adding @mmilirud for comment.
@Jaffacakes82 Thank you for reaching out to us.
I am busy working on a arm template for deployment with DevOps (work in progress). I wanted to resolve the exact same issue. This template seems to achieve this. In this example I have an existing appServicePlan in the same RG I am deploying the webapp to and existing application insights resource in a different RG.
Result: No more message "update my Application Insights site extension"
`{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"displayName": {
"type": "string",
"defaultValue": "applicationInsights",
"minLength": 1,
"metadata": {
"description": "displayName"
}
},
"departmentName": {
"type": "string",
"minLength": 1,
"metadata": {
"description": "Describes the name of the Department"
}
},
"applicationName": {
"type": "string",
"minLength": 1,
"metadata": {
"description": "Describes the name of the Application, Solution and or project this appService belongs to"
}
},
"environmentName": {
"type": "string",
"allowedValues": [
"sandbox",
"development",
"testing",
"staging",
"production"
],
"metadata": {
"description": "Describes the name of the Environment"
}
},
"commonResource": {
"type": "string",
"minLength": 1,
"metadata": {
"description": "Describes the common resource that a group of resources might support. Example AzureVM;AppServices"
}
},
"createdBy": {
"type": "string",
"minLength": 1,
"metadata": {
"description": "Describes the name of the new website"
}
},
"appServiceWebApp_Name": {
"type": "string",
"minLength": 1,
"metadata": {
"description": "Describes the name of application Insights Resource"
}
},
"appServicePlan_Name": {
"type": "string",
"minLength": 1,
"metadata": {
"description": "appServicePlan where appService will be hosted"
}
},
"appInsights_Name": {
"type": "string",
"minLength": 1,
"metadata": {
"description": "appInsights to link to"
}
},
"appInsights_ResourceGroup": {
"type": "string",
"minLength": 1,
"metadata": {
"description": "appInsights ResourceGroup"
}
}
},
"variables": {
"appInsightsResourceID": "[resourceId(parameters('appInsights_ResourceGroup'), 'microsoft.insights/components',parameters('appInsights_Name'))]"
},
"resources": [
{
"apiVersion": "[providers('Microsoft.Web','sites').apiVersions[0]]",
"name": "[parameters('appServiceWebApp_Name')]",
"type": "Microsoft.Web/sites",
"location": "[resourceGroup().location]",
"tags": {
"Application": "[parameters('applicationName')]",
"Department": "[parameters('departmentName')]",
"Environment": "[parameters('environmentName')]",
"commonResource": "[parameters('commonResource')]",
"CreatedBy": "[parameters('createdBy')]",
"displayName": "appServiceWebApp"
},
"dependsOn": [],
"properties": {
"siteConfig": {
"appSettings": [
{
"name": "APPINSIGHTS_INSTRUMENTATIONKEY",
"value": "[reference(variables('appInsightsResourceID'), '2015-05-01').InstrumentationKey]"
},
{
"name": "ApplicationInsightsAgent_EXTENSION_VERSION",
"value": "~2"
},
{
"name": "DiagnosticServices_EXTENSION_VERSION",
"value": "~3"
},
{
"name": "APPINSIGHTS_PROFILERFEATURE_VERSION",
"value": "1.0.0"
}
]
},
"name": "[parameters('appServiceWebApp_Name')]",
"enabled": true,
"hostNameSslStates": [
{
"name": "[concat(parameters('appServiceWebApp_Name'),'.azurewebsites.net')]",
"sslState": "SniEnabled",
"virtualIP": null,
"thumbprint": null,
"toUpdate": null,
"hostType": "Standard"
},
{
"name": "[concat(parameters('appServiceWebApp_Name'),'.scm.azurewebsites.net')]",
"sslState": "SniEnabled",
"virtualIP": null,
"thumbprint": null,
"toUpdate": null,
"hostType": "Repository"
}
],
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms', parameters('appServicePlan_Name'))]"
},
"resources": [
]
}
],
"outputs": {}
}
`
@Jaffacakes82 We are going to close this thread as resolved but if there are any further questions regarding the documentation, please tag me in your reply and we will be happy to continue the conversation.
@Jaffacakes82 We are going to close this thread as resolved but if there are any further questions regarding the documentation, please tag me in your reply and we will be happy to continue the conversation.
@kobulloc-MSFT It might help others if the process of adding Application Insights Extension is documented somewhere. I could not find any and that is how I ended up on this thread initially.
@dirkslab thank you for providing your solution. How do you install the site extension to your WebApp? Do you use Azure DevOps too?
@kobulloc-MSFT it would be useful to have the programmatic update solution included in the documentation. Is @dirkslab's approach the right one, and is it likely to change in future?
I am busy working on a arm template for deployment with DevOps (work in progress). I wanted to resolve the exact same issue. This template seems to achieve this. In this example I have an existing appServicePlan in the same RG I am deploying the webapp to and existing application insights resource in a different RG.
Result: No more message "update my Application Insights site extension"`{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"displayName": {
"type": "string",
"defaultValue": "applicationInsights",
"minLength": 1,
"metadata": {
"description": "displayName"
}
},
"departmentName": {
"type": "string",
"minLength": 1,
"metadata": {
"description": "Describes the name of the Department"
}
},
"applicationName": {
"type": "string",
"minLength": 1,
"metadata": {
"description": "Describes the name of the Application, Solution and or project this appService belongs to"
}
},
"environmentName": {
"type": "string",
"allowedValues": [
"sandbox",
"development",
"testing",
"staging",
"production"
],
"metadata": {
"description": "Describes the name of the Environment"
}
},
"commonResource": {
"type": "string",
"minLength": 1,
"metadata": {
"description": "Describes the common resource that a group of resources might support. Example AzureVM;AppServices"
}
},
"createdBy": {
"type": "string",
"minLength": 1,
"metadata": {
"description": "Describes the name of the new website"
}
},
"appServiceWebApp_Name": {
"type": "string",
"minLength": 1,
"metadata": {
"description": "Describes the name of application Insights Resource"
}
},
"appServicePlan_Name": {
"type": "string",
"minLength": 1,
"metadata": {
"description": "appServicePlan where appService will be hosted"
}
},
"appInsights_Name": {
"type": "string",
"minLength": 1,
"metadata": {
"description": "appInsights to link to"
}
},
"appInsights_ResourceGroup": {
"type": "string",
"minLength": 1,
"metadata": {
"description": "appInsights ResourceGroup"
}
}
},
"variables": {
"appInsightsResourceID": "[resourceId(parameters('appInsights_ResourceGroup'), 'microsoft.insights/components',parameters('appInsights_Name'))]"
},
"resources": [
{
"apiVersion": "[providers('Microsoft.Web','sites').apiVersions[0]]",
"name": "[parameters('appServiceWebApp_Name')]",
"type": "Microsoft.Web/sites",
"location": "[resourceGroup().location]",
"tags": {
"Application": "[parameters('applicationName')]",
"Department": "[parameters('departmentName')]",
"Environment": "[parameters('environmentName')]",
"commonResource": "[parameters('commonResource')]",
"CreatedBy": "[parameters('createdBy')]",
"displayName": "appServiceWebApp"
},
"dependsOn": [],
"properties": {
"siteConfig": {
"appSettings": [
{
"name": "APPINSIGHTS_INSTRUMENTATIONKEY",
"value": "[reference(variables('appInsightsResourceID'), '2015-05-01').InstrumentationKey]"
},
{
"name": "ApplicationInsightsAgent_EXTENSION_VERSION",
"value": "~2"
},
{
"name": "DiagnosticServices_EXTENSION_VERSION",
"value": "~3"
},
{
"name": "APPINSIGHTS_PROFILERFEATURE_VERSION",
"value": "1.0.0"
}
]
},
"name": "[parameters('appServiceWebApp_Name')]",
"enabled": true,
"hostNameSslStates": [
{
"name": "[concat(parameters('appServiceWebApp_Name'),'.azurewebsites.net')]",
"sslState": "SniEnabled",
"virtualIP": null,
"thumbprint": null,
"toUpdate": null,
"hostType": "Standard"
},
{
"name": "[concat(parameters('appServiceWebApp_Name'),'.scm.azurewebsites.net')]",
"sslState": "SniEnabled",
"virtualIP": null,
"thumbprint": null,
"toUpdate": null,
"hostType": "Repository"
}
],
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms', parameters('appServicePlan_Name'))]"
},
"resources": [] }],
"outputs": {}
}
`
Worked for me... Thanks
Most helpful comment
@kobulloc-MSFT It might help others if the process of adding Application Insights Extension is documented somewhere. I could not find any and that is how I ended up on this thread initially.