gpt4 book ai didi

azure - 如何使用 ARM 模板通过应用程序见解启用实时 Azure Web 应用程序分析

转载 作者:行者123 更新时间:2023-12-02 04:34:26 26 4
gpt4 key购买 nike

我的团队希望使用 ARM 模板为我们的 Web 应用启用 Application Insights Live Profiler。以下链接 https://learn.microsoft.com/en-us/azure/application-insights/app-insights-profiler 解释了 Application Insights 的这一性能功能。 。但是,我找不到任何有关如何使用 ARM 模板添加该功能的文档。我已尝试使用以下文档 ( https://github.com/CawaMS/EnableProfilerForCompute/blob/master/How%20to%20enable%20Application%20Insights%20Profiler%20on%20Azure%20Compute%20resources.md ) 作为指南,但它旨在启用 VM 和 Azure 计算资源而不是应用服务的分析。

最佳答案

根据您的描述,如果您想部署Web应用程序并启用应用程序Insights,我建议您可以尝试下面的arm模板(在模板中添加Microsoft.Insights/components资源)。

模板.json

{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"hostingPlanName": {
"type": "string",
"minLength": 1
},
"skuName": {
"type": "string",
"defaultValue": "F1",
"allowedValues": [
"F1",
"D1",
"B1",
"B2",
"B3",
"S1",
"S2",
"S3",
"P1",
"P2",
"P3",
"P4"
],
"metadata": {
"description": "Describes plan's pricing tier and capacity. Check details at https://azure.microsoft.com/en-us/pricing/details/app-service/"
}
},
"skuCapacity": {
"type": "int",
"defaultValue": 1,
"minValue": 1,
"metadata": {
"description": "Describes plan's instance count"
}
}
},
"variables": {
"webSiteName": "[concat('webSite', uniqueString(resourceGroup().id))]"
},
"resources": [
{
"apiVersion": "2015-08-01",
"name": "[parameters('hostingPlanName')]",
"type": "Microsoft.Web/serverfarms",
"location": "[resourceGroup().location]",
"tags": {
"displayName": "HostingPlan"
},
"sku": {
"name": "[parameters('skuName')]",
"capacity": "[parameters('skuCapacity')]"
},
"properties": {
"name": "[parameters('hostingPlanName')]"
}
},
{
"apiVersion": "2015-08-01",
"name": "[variables('webSiteName')]",
"type": "Microsoft.Web/sites",
"location": "[resourceGroup().location]",
"tags": {
"[concat('hidden-related:', resourceGroup().id, '/providers/Microsoft.Web/serverfarms/', parameters('hostingPlanName'))]": "Resource",
"displayName": "Website"
},
"dependsOn": [
"[resourceId('Microsoft.Web/serverfarms/', parameters('hostingPlanName'))]"
],
"properties": {
"name": "[variables('webSiteName')]",
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms', parameters('hostingPlanName'))]"
}
},
{
"apiVersion": "2014-04-01",
"name": "[variables('webSiteName')]",
"type": "Microsoft.Insights/components",
"location": "East US",
"dependsOn": [
"[resourceId('Microsoft.Web/sites/', variables('webSiteName'))]"
],
"tags": {
"[concat('hidden-link:', resourceGroup().id, '/providers/Microsoft.Web/sites/', variables('webSiteName'))]": "Resource",
"displayName": "AppInsightsComponent"
},
"properties": {
"applicationId": "[variables('webSiteName')]"
}
}
]
}

输出:

enter image description here

结果(Web应用程序已与appInsights关联)

enter image description here

关于azure - 如何使用 ARM 模板通过应用程序见解启用实时 Azure Web 应用程序分析,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44974636/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com