api - 如何在应用程序洞察资源之前部署 APIManagement Service Logger?
问题描述
我正在尝试使以下 ARM 部署 APIM 服务记录器,但是服务记录器在应用洞察资源之前开始部署并且失败,应用洞察资源位于单独的模板中。我添加了一个依赖声明,并认为可以完成这项工作,但那也不起作用。如果已经部署了应用洞察,下面的代码实际上也可以工作。
有人有任何指示吗?
{
"type": "Microsoft.ApiManagement/service/loggers",
"name": "[concat(variables('apiManagementInstanceName'), '/', parameters('appInsightsName'))]",
"apiVersion": "2018-01-01",
"properties": {
"loggerType": "applicationInsights",
"description": "Logger resources to APIM",
"credentials": {
"instrumentationKey": "[reference(resourceId('Microsoft.Insights/components', parameters('appInsightsName')), '2015-05-01').InstrumentationKey]"
}
}
"dependsOn": [
"[resourceId('microsoft.insights/components', parameters('appInsightsName'))]"
]
}
还根据 APIM 和应用洞察力进行了尝试
"dependsOn": [
//"[resourceId('Microsoft.ApiManagement/service', variables('apiManagementInstanceName'))]"
"[resourceId('microsoft.insights/components', parameters('appInsightsName'))]"
],
解决方案
您可以使用链接模板来引用另一个模板文件并定义对它的依赖项:https ://docs.microsoft.com/en-us/azure/azure-resource-manager/templates/linked-templates#linked-template
推荐阅读
- database - 实时环境中的数据迁移问题
- python - 生成随机数的归一化矩阵,其中行是从不同的高斯(正态)分布生成的
- php - 将关联数组展开 N 次并获取所有组合键
- python - Sklearn:ValueError:发现样本数量不一致的输入变量:[500, 1]
- swift - Searchfield 和 tableview - 仅显示具有大写用户名的用户
- node.js - Nodejs 生成一个密钥来签署一条数据
- python - 用于噪声过滤的图像上的 Python 奇异值分解
- mysql - MySQL 5.5 - 每天计算未清项目的条件
- c# - Premailer.Net error: Could not load type 'AngleSharp.Parser.Html.HtmlParser' from assembly AngleSharp 0.10.1
- ios - Swift iOS MetalKit draw a curve , why the end of the curve is always in the center, how can i fix it?