gpt4 book ai didi

azure - Azure 门户 ARM 模板导出中不包含诊断设置

转载 作者:行者123 更新时间:2023-12-02 05:59:15 24 4
gpt4 key购买 nike

我在 Azure 门户中为 KeyVault 资源创建诊断设置。 DS 属性为 Metrics = AllMetrics,并且 Destination 是预定义的 Log Analytics 工作区。当我从 Portal 进行导出(自动化 - 导出模板)时,生成的 ARM json 中不包含诊断设置中的任何内容。当资源是应用服务时,我注意到相同的行为。

这是设计使然吗?一个错误?还有其他方法可以获取我定义的诊断设置的 ARM json 吗?

最佳答案

我在我的环境中尝试了相同的操作,但似乎我们无法导出 key 保管库、应用服务、存储帐户等任何服务的诊断设置 当我们尝试导出模板以进行自动化时。但是 Microsoft Documentation 中提供了一些针对少数资源的示例诊断设置模板。

因此,根据您的设置,它将类似于下面我通过部署进行测试的内容:

{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"settingName": {
"type": "String",
"defaultValue": "testdsansuman"
},
"vaultName": {
"type": "String",
"defaultValue": "ansumantestkv1234"
},
"workspaceName": {
"type": "String",
"defaultValue": "ansumantestlog"
}
},
"resources": [
{
"type": "Microsoft.KeyVault/vaults/providers/diagnosticSettings",
"apiVersion": "2017-05-01-preview",
"name": "[concat(parameters('vaultName'), '/Microsoft.Insights/', parameters('settingName'))]",
"dependsOn": [],
"properties": {
"workspaceId": "[resourceId('Microsoft.OperationalInsights/workspaces', parameters('WorkspaceName'))]",

"metrics": [
{
"category": "AllMetrics",
"enabled": true
}
]
}
}
]
}

输出:

enter image description here

enter image description here

enter image description here

enter image description here

关于azure - Azure 门户 ARM 模板导出中不包含诊断设置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70200523/

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