The best way to automate this is to use Azure Policy. With deployIfNotExists effect you can deploy some resources when certain things do not exits (not compliant). I would still recommend if you are deploying these resources trough some automation like CI/CD and ARM Templates is to deploy these additional settings along with the actual deployment of resources.
Best way to automate actions on newly created VMs
Hello experts,
I would like for some guidance regarding the best ways to automate actions on newly created virtual machines.
What I would like to do is to develop someway to automate the creation of managed system identities, install certain extensions, or enabling diagnostic settings as soon as a new VM is created.
My initial thought was to use log analytics to create an alert that runs every 5 minutes and queries for newly created VMs, then use an automation runbook as the action group, to run a piece of powershell code to enable the desired features.
Would anyone suggest a better approach to accomplish my requirement?
2 answers
Sort by: Most helpful
-
-
JP Alfaro 1 Reputation point
2020-02-13T00:43:56.697+00:00 Hi Stan,
Thank you for your suggestion.
I don't seem to be able to find for a way to automate the deployIfNotExists remediation.
Do you know if that is possible?