Sample ARM and Bicep templates for Azure policy and policy initiative definitions
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 points of interest:
To start working with this project, clone the repository to your local machine and look for the artifacts in the specific folders:
To create definitions and assignments for policies and initiatives in the target subscription or resource group, use the following build order:
Deploy policy definitions
Deploy policy initiatives
(Optionally) Create a resource group to be used as a target for assignments during testing policy effects
Create policy and initiative assignments
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.
When using deployment scripts in the build/release pipelines, define the script variables in the pipeline ones.