I am looking for ARM template that will help to configure (Log Analytics) diagnostic setting. Have search few templates but no hope. Tried by export template and also with Resource Explorer didn't find the diagnostic setting configurations. Please share your idea
Here is the ARM template which i am trying
"apiVersion": "2015-07-01",
"name": "[concat(parameters('applicationGateways_name'), '/Microsoft.Insights/service')]",
"type": "Microsoft.Network/applicationGateways/providers/diagnosticsettings",
"location": "[resourceGroup().location]",
"dependsOn": [
"[concat('Microsoft.Network/ApplicationGateways/', parameters('applicationGateways_name'))]"
],
"properties":{
"name":"DiagService",
"workspaceId":"[variables('workspaceId')]",
"logs":[
{
Where as for "type": "Microsoft.Network/applicationGateways/providers/diagnosticsettings" not deducting
I am trying to add in the existing workspace
it worked with the following changes
{
"apiVersion": "2017-05-01-preview",
"name": "[concat(parameters('applicationGatewayName'), '/Microsoft.Insights/diagnosticSettings')]",
"type":"Microsoft.Network/applicationGateways/providers/diagnosticSettings",
"location": "[resourceGroup().location]",
"dependsOn": [
"[concat('Microsoft.Network/ApplicationGateways/', parameters('applicationGatewayName'))]"
],
"properties":{
"name":"Diag",
"workspaceId": "[concat('/subscriptions/', subscription().subscriptionId, '/resourceGroups/', resourceGroup().name, '/providers/microsoft.operationalinsights/workspaces/', parameters('workspaceId'))]",
"logs":[
{
"category": "ApplicationGatewayAccessLog",
"enabled": true,
"retentionPolicy": {
"enabled": false,
"days": 0
}
},
{
"category": "ApplicationGatewayPerformanceLog",
"enabled": true,
"retentionPolicy": {
"days": 0,
"enabled": false
}
},
{
"category": "ApplicationGatewayFirewallLog",
"enabled": true,
"retentionPolicy": {
"days": 0,
"enabled": false
}
}
],
"metrics": [
{
"category": "AllMetrics",
"enabled": true,
"retentionPolicy": {
"enabled": false,
"days": 0
}
}
]
}
}
Please NOTE Here I have used common workspace which created earlier