Created
August 23, 2020 04:11
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$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