Search code examples
azureazure-policy

Azure Policy - Enable Auto Shutdown at VMs


it is possible to activate the Azure VM Autoshutdown Function with an Azure Policy?

I found always articles with an DevTest Lab. But i would like to use an AZure Policy at the Production Subscription to can found VMs without an Azure AutoShutdown Configuration.

Thanks.

Best Regards, Phil


Solution

  • I'm from the Microsoft for Founders Hub team. Auto Shutdown can be implemented on Azure VMs through Azure policy by following the JSON file available here however remediation task has to be setup so that the option of Auto shutdown will be overridden by the policy if already configured.

    JSON reference URL: https://github.com/tyconsulting/azurepolicy/blob/master/policy-definitions/deploy-vm-shutdown-schedule/azurepolicy.json