Forum Discussion
How to assign policies by updating ARM template?
ibnmbodji Hi, can you answer the follow-up question for this post? Thank you!
Hi you can do that regarding the documentation below :
Quickstart: New policy assignment with templates - Azure Policy | Microsoft Docs
But you will notice that resource group is always necessary and it will be scope .So if you need the subscription as scope you will be blocked .
If you don't want to do it through Github try Azure Blueprint it's more flexible
Security compliance with Azure Policy and Azure Blueprints | Microsoft Docs
You can test this to see if it can fit your need :
Go to Blueprints Menu
https://portal.azure.com/#blade/Microsoft_Azure_Policy/BlueprintsMenuBlade/GetStarted
Click Create
Select Common Policies ( You can also start with blank blueprint)
Give a name a description and a location (The management group or subscription where the blueprint is saved)
Click Next:Artifacts
click on ... and remove artifacts you don't want
click add artifact and choose Policy assignment as artifact type
You will see all the iniative definitions and policy definitions
select and add
click on save draft
In the notifications blade click on saving blueprint definition succeeded
then publish blueprint
Give a version and a change notes and hit publish
Once published you can assign it by giving the necessary parameter values and click assign.