Skip to content

Instantly share code, notes, and snippets.

@PlagueHO
Created August 23, 2020 04:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PlagueHO/c3f09056cace496dded18da8bc1ed589 to your computer and use it in GitHub Desktop.
Save PlagueHO/c3f09056cace496dded18da8bc1ed589 to your computer and use it in GitHub Desktop.
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