azure - 如何使用 ARM 模板为注释创建 Application Insights API 密钥
问题描述
我正在尝试从 ARM 模板创建 Application Insights API 密钥。我需要在资源部署期间创建用于编写注释的 API 密钥,以便在 Azure Devops 的应用程序部署期间发布注释正常工作。
我试图找到有关如何使其工作的信息,但我只能找到有关如何使用 PowerShell 或 Azure REST API 创建密钥的示例。
我需要做的是使用 ARM 模板创建 API 密钥。我已经尝试过无数次与此类似的 json 尝试,但均未成功;
{
"name": "[variables('applicationInsightsName')]",
"type": "Microsoft.Insights/components",
"location": "[resourceGroup().location]",
"apiVersion": "2014-04-01",
"tags": {
"displayName": "[concat('Component ', variables('applicationInsightsName'))]"
},
"properties": {
"applicationId": "[variables('applicationInsightsName')]"
},
"resources": [
{
"name": "action",
"type": "apikeys",
"location": "[resourceGroup().location]",
"apiVersion": "2015-05-01",
"properties": {
"name": "Azure Devops Release Annotations",
"linkedWriteProperties": [
"[concat(resourceId('Microsoft.Insights/components', variables('applicationName')), '/annotations')]"
],
"linkedReadProperties": []
},
"dependsOn": [
"[resourceId('Microsoft.Insights/components', variables('applicationInsightsName'))]"
]
}
]
}
到目前为止,我发现的最好的信息是 this,但这并没有多大帮助。
是否可以使用 ARM 模板创建 API 密钥?
解决方案
不,这是不可能的,ARM 模板仅模拟PUT
请求,而Microsoft.Insights/Components/ApiKeys/Action
是POST
请求。
推荐阅读
- tensorflow - 为什么在每个 epoch 后 model.fit() 自动打印 val_accuracy 和 CustomCallback 打印的准确度不同?
- android - Flutter - in_app_update 无法显示更新对话框
- amazon-web-services - 使用的 Datadog AWS RDS 监控存储
- dynamic-programming - 如何正确实施动态编程解决方案以使用后缀编辑距离?
- html - 需要帮助在桌面和设备中设置内容条的样式
- error-handling - Tcl:从所有命令中捕获错误
- javascript - 在 Snowflake 中使用不区分大小写的列名解析 JSON 数据
- amazon-web-services - golangs *ecr.ECR 和 *ecs.ECS 的常见类型是什么?
- linux - 如何查找包含一组单词中的至少一个作为前缀的所有行
- mysql - ERROR 1215 (HY000): 无法添加外键约束错误