How to exclude VM auto-shutdown from Tag policy

Elliott Kurtz 0 Reputation points

I recently created policies to enforce the creation of certain tags on new Azure resources. Now when I try to enable auto-shutdown on an existing VM that is otherwise compliant with the tag policy I get an error:

 Schedule failed to update {"error":{"code":"RequestDisallowedByPolicy","target":"shutdown-computevm-","message":"Resource 'shutdown-computevm-' was disallowed by policy. 

Is there a way to exclude auto shutdown from the tag policy?

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
5,983 questions
Azure Policy
Azure Policy
An Azure service that is used to implement corporate governance and standards at scale for Azure resources.
691 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Pranathi Panyam_MSFT 811 Reputation points Microsoft Employee

    Hello @Elliott Kurtz

    Welcome to Microsoft Q&A, Thank you for posting your query here!!

    Yes, you can exclude certain resource types or specific resources from Azure Policy enforcement. Policy exemptions allow you to create exceptions for specific resources or resource types, allowing them to bypass the policy enforcement.

    Please refer to the document which has CLI commands, to create a policy exemption for your existing VM to exclude it from the tag policy enforcement and enable auto-shutdown.

    Please "Accept as Answer" if it helped so it can help others in community looking for help on similar topics.

    0 comments No comments