Skip to content

Sample ARM and Bicep templates for Azure policy and policy initiative definitions

License

Notifications You must be signed in to change notification settings

andrewmatveychuk/azure.policy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

azure.policy

Sample ARM and Bicep(!) templates for Azure policy and policy initiative definitions.

Before starting to work with these templates, read the information in the following blog posts according to your interests:

Build status

Build Status

Getting Started

To start working with this project, clone the repository to your local machine and look for the artifacts in the specific folders:

  • linked templates - contains sample ARM templates for policy and initiative definitions plus their assignments grouped by logical area
  • main-template - contains master ARM template to perform deployments of all policies and initiatives to a subscription

Build and Test

To create definitions and assignments for policies and initiatives in the target subscription or resource group, use the following build order:

  1. Deploy policy definitions

  2. Deploy policy initiatives

  3. (Optionally) Create a resource group to be used as a target for assignments during testing policy effects

  4. Create policy and initiative assignments

Things to remember

  1. Pay attention to the format of parameters as there are cases when they should be provided as an object type. Look into existing policies and initiatives for examples.

  2. When using deployment scripts in the build/release pipelines, define the script variables in the pipeline ones.