问题
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