Can't Deploy Sample AZ Policy Template in Azure Portal

bsonnek 56 Reputation points
2021-11-01T21:02:27.71+00:00

When I Copy and Paste this sample policy template into the Azure Portal as a new Policy Definition I get an error message.

Here is the template:
https://github.com/Azure/Azure-Lighthouse-samples/blob/master/templates/policy-add-or-replace-tag/addOrReplaceTag.json

Error Message:
Creating policy definition 'TEST' in 'Training' failed. The request content was invalid and could not be deserialized: 'Required property 'policyRule' expects a value but got null. Path 'properties', line 1, position 168.'.

I've tried a few other sample policies from github and received similar error messages.

Both Sample documents from this Microsoft Document article I'm not able to deploy as well.
https://learn.microsoft.com/en-us/azure/lighthouse/how-to/deploy-policy-remediation#create-a-user-who-can-assign-roles-to-a-managed-identity-in-the-customer-tenant

Please tell me what I missing.
Thank you!

Azure Policy
Azure Policy
An Azure service that is used to implement corporate governance and standards at scale for Azure resources.
959 questions
0 comments No comments
{count} votes

Accepted answer
  1. Stanislav Zhelyazkov 26,176 Reputation points MVP
    2021-11-02T10:42:20.273+00:00

    Hi,
    The template is ARM template not a code for policy definition. You should follow these steps to deploy custom ARM template trough portal.

    Please "Accept the answer" if the information helped you. This will help us and others in the community as well.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. bsonnek 56 Reputation points
    2021-11-02T13:17:17.133+00:00

    Thank you! I was able to deploy the sample ARM policy through the azure portal using the deploy a custom template.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.