Azure resource manager DependsOn在ARM模板中失败
我试图通过ARM将我们的网站连接到Application Insights组件,但在将Intstrumentation键设置为网站应用程序设置时遇到了问题。这有时有效,有时无效 我猜我的dependsOn设置不正确。谁能看看我的模板,看看我是否做错了什么?在网站资源中查看类型为“config”的名为“appSettings”的资源。在这里,我应该等待ApplicationInsight的完成,然后读取指令插入键Azure resource manager DependsOn在ARM模板中失败,azure-resource-manager,Azure Resource Manager,我试图通过ARM将我们的网站连接到Application Insights组件,但在将Intstrumentation键设置为网站应用程序设置时遇到了问题。这有时有效,有时无效 我猜我的dependsOn设置不正确。谁能看看我的模板,看看我是否做错了什么?在网站资源中查看类型为“config”的名为“appSettings”的资源。在这里,我应该等待ApplicationInsight的完成,然后读取指令插入键 { "name": "[variables('webAppNameFinal'
{
"name": "[variables('webAppNameFinal')]",
"type": "Microsoft.Web/sites",
"location": "[parameters('appServicePlanLocation')]",
"apiVersion": "2015-04-01",
"dependsOn": [
"[concat('Microsoft.Web/serverfarms/', variables('appServicePlanNameFinal'))]"
],
"tags": {
"[concat('hidden-related:', resourceGroup().id, '/providers/Microsoft.Web/serverfarms/', variables('appServicePlanNameFinal'))]": "Resource",
"displayName": "webApp"
},
"properties": {
"name": "[variables('webAppNameFinal')]",
"serverFarmId": "[variables('appServicePlanNameFinal')]"
},
"resources": [
{
"apiVersion": "2015-04-01",
"name": "connectionstrings",
"type": "config",
"dependsOn": [
"[resourceId('Microsoft.Web/Sites', variables('webAppNameFinal'))]",
"[resourceId('Microsoft.Sql/servers', variables('sqlServerNameFinal'))]"
],
"properties": {
"Watches": {
"value": "[concat('Server=tcp:', reference(concat('Microsoft.Sql/servers/', variables('sqlServerNameFinal'))).fullyQualifiedDomainName, ',1433;Database=', variables('sqlDatabaseNameFinal'), ';User ID=', parameters('sqlServerAdminLogin'), ';Password=', parameters('sqlServerAdminLoginPassword'), ';Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;')]",
"type": "SQLAzure"
}
}
},
{
"apiVersion": "2015-08-01",
"name": "appsettings",
"type": "config",
"dependsOn": [
"[resourceId('Microsoft.Web/Sites', variables('webAppNameFinal'))]",
"[concat('Microsoft.Insights/components/', variables('applicationInsightsNameFinal'))]"
],
"properties": {
"Watches.Webjobs.VitecConnect.WatchersExport.Run": "false",
"ApplicationInsights.InstrumentationKey": "[reference(concat('Microsoft.Insights/components/', variables('applicationInsightsNameFinal'))).InstrumentationKey]"
}
},
{
"apiVersion": "2015-04-01",
"name": "web",
"type": "sourcecontrols",
"dependsOn": [
"[resourceId('Microsoft.Web/Sites', variables('webAppNameFinal'))]"
],
"properties": {
"RepoUrl": "[parameters('gitUrl')]",
"branch": "[parameters('gitBranch')]"
}
},
{
"apiVersion": "2015-08-01",
"name": "web",
"type": "config",
"dependsOn": [
"[resourceId('Microsoft.Web/Sites', variables('webAppNameFinal'))]"
],
"properties": "[variables('siteProperties')]"
}
]
},
{
"name": "[variables('applicationInsightsNameFinal')]",
"type": "Microsoft.Insights/components",
"location": "Central US",
"apiVersion": "2014-04-01",
"dependsOn": [ ],
"tags": {
"displayName": "Application Insights"
},
"properties": {
"applicationId": "[variables('webAppNameFinal')]"
}
},
最佳里根
Niclas您是否尝试将dependsOn放在insight资源声明中 在此处查看web+sql的快速启动模板: 他们把dependsOn放在Insight声明上,而没有放在网站声明上。那对你有用吗
{
"apiVersion": "2015-05-01",
"name": "[concat('AppInsights', variables('webSiteName'))]",
"type": "Microsoft.Insights/components",
"location": "centralus",
"dependsOn": [
"[variables('webSiteName')]"
],
"tags": {
"[concat('hidden-link:', resourceId('Microsoft.Web/sites', variables('webSiteName')))]": "Resource",
"displayName": "AppInsightsComponent"
},
"properties": {
"ApplicationId": "[variables('webSiteName')]"
}
}
当它不起作用时是什么行为?有错误吗?嗨,Ben,我试图设置的应用程序设置“ApplicationInsights.InstrumentationKey”根本没有设置。网站创建时没有此键/值。我遇到类似问题,是否有此问题的更新?