'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 1:[1]

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

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Jeremy Caney