Forum Discussion
Phil123
May 02, 2022Brass Contributor
Azure Policy - Enable Autoshutdown on Azure VM
Hello, 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 ...
- May 05, 2022Hi, Phil.
Yes, it did!
Delete the assignment, re-run it again, and create your Remediation Task with your System Assigned identity. Although not required, if you have an AutoShutdown already configured, you can just set it to 'None' to let the policy configure the correct time etc in one place.
lukemurraynz
May 03, 2022Learn Expert
Yes, you can. This blog post from Tao Yang, https://blog.tyang.org/2019/06/02/new-azure-policy-definition-deploy-vm-shutdown-schedule/ - help explains it. He has also written the Azure Policy JSON for you: https://github.com/tyconsulting/azurepolicy/blob/master/policy-definitions/deploy-vm-shutdown-schedule/azurepolicy.json
- Phil123May 03, 2022Brass Contributorlukemurraynz
Thanks for this Answer.
I found this Website to. But im a little bit confused about the Fields in the JSON File.
They always use the "DevtestLab" Fields.
Can i use this also for the normal Azure Tenant?- lukemurraynzMay 03, 2022Learn ExpertI haven't personally tried it, but it should work. You can always deploy it to a Resource Group as a test.
- Phil123May 03, 2022Brass ContributorIt doesnt work.
The VM without an Autoshutdown Configuration ist listen at compliant.
Do you have any more Idea?