Forum Discussion
UserID707597
Jan 04, 2021Brass Contributor
How to assign policies by updating ARM template?
Hello all! I need to assign policies to my subscription for it to be compliant. How will I be able to assign the policies by updating the ARM template of the subscription? Also, I found out a way to ...
ibnmbodji
Jan 04, 2021Steel Contributor
UserID707597
Jan 05, 2021Brass Contributor
ibnmbodji Hi again, is it possible to create a template in the Template blade in Azure and specify all the needed policies there, then deploy it to my subscription? Also, can I deploy many ARM templates into one subscription?
- nabi04Jan 06, 2021Brass Contributor
ibnmbodji Hi, can you answer the follow-up question for this post? Thank you!
- ibnmbodjiJan 06, 2021Steel Contributor
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.