ARM template deploying Diagnostics Settings does not enable Metrics logs

本秂侑毒 提交于 2019-12-13 04:01:54

问题


I'm using Azure RM Template deployments with a Visual Studio 2017 Resource Group project to deploy IoTHub instance with diagnostics settings in Log Analytics.

The problem is with deployment of the Diagnostics Settings template and specifically with the AllMetrics category under the metrics property.

I'm following the instructions for deploying Diagnostics Settings as Non-Compute resource template

The deployment completes successfully, but this one

{
      "type": "providers/diagnosticSettings",
      "name": "[concat('Microsoft.Insights/', parameters('iotHub.diagnostics.settingName'))]",
      "dependsOn": [
        "[resourceId('Microsoft.Devices/IoTHubs', parameters('iotHub.name'))]"
      ],
      "apiVersion": "2017-05-01-preview",
      "properties": {
        "name": "[parameters('iotHub.diagnostics.settingName')]",
        "workspaceId": "[resourceId('Microsoft.OperationalInsights/workspaces', parameters('iotHub.diagnostics.logAnalyticsName'))]",
        "logs": [
          {
            "category": "Connections",
            "enabled": true,
            "retentionPolicy": {
              "days": 0,
              "enabled": false
            }
          }
        ],
        "metrics": [
          {
            "category": "AllMetrics",
            "enabled": true,

            "retentionPolicy": {
              "days": 0,
              "enabled": false
            }
          }
        ]
      }
    }

is not deployed as enabled - in the portal this is not checked as enabled. Tried multiple times, both as a new deployment and as an update.

If I go and manually enable this in the portal, then it stays enabled after consequent deployments of the same.

Any ideas?

来源:https://stackoverflow.com/questions/52851047/arm-template-deploying-diagnostics-settings-does-not-enable-metrics-logs

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!