DEV Community

Cover image for Creating, testing and Deleting Policies
Jetsumz
Jetsumz

Posted on

Creating, testing and Deleting Policies

  1. Search for 'policy' in the search menu bar on azure portal.

  2. Select the 'assignments' blade.

  3. Select Assign Policy.

  4. Define the Policy then add. For this tutorial we'll be creating a policy that requires resources to have a Tag.

  5. You can optionally add exclusions and create a description for the policy.

  6. Set Tag name and Value in parameters.

  7. Create the Policy.

  8. It should look similar to the image below if successful.

  9. Let us test the Policy created by creating a storage account.

  10. I will purposefully omit the assigning of tag in the storage account to test if the Policy will work.

  11. As shown below, the Policy prevents the storage account from being deployed because it does not have the specified tag.

  12. Now I will try to create the storage account again but this time I will include the Tag.

  13. As shown below, the deployment of the storage account was successful.

  14. To delete the Policy, simply go back to the policy created in the 'assignments' blade and click delete assignment from the drop down.

Top comments (0)