Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Azure ARM Template to enable Azure Monitor Log Analytics Container Monitoring on a Linux Docker host in Azure Arc managed machines
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"MachineName": {
"type": "String"
},
"Location": {
"type": "String"
},
"WorkspaceId": {
"type": "String"
},
"WorkspaceKey": {
"type": "String"
}
},
"variables": {},
"resources": [
{
"type": "Microsoft.HybridCompute/machines/extensions",
"apiVersion": "2019-12-12",
"name": "[concat(parameters('MachineName'), '/CustomScript')]",
"location": "[parameters('Location')]",
"properties": {
"publisher": "Microsoft.Azure.Extensions",
"type": "CustomScript",
"autoUpgradeMinorVersion": false,
"protectedSettings": {
"commandToExecute": "[concat('sudo docker run --privileged -d -v /var/run/docker.sock:/var/run/docker.sock -v /var/lib/docker/containers:/var/lib/docker/containers -e WSID=\"',parameters('WorkspaceId'),'\" -e KEY=\"',parameters('WorkspaceKey'),'\" -h=`hostname` -p 127.0.0.1:25225:25225 --name=\"omsagent\" --restart=always microsoft/oms:1.8.1-256')]"
}
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.