-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
58 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,30 @@ | ||
New-AzResourceGroupDeployment -ResourceGroupName "testing" -TemplateFile azuredeploy.json -TemplateParameterFile azuredeploy.parameters.json | ||
New-AzResourceGroupDeployment -ResourceGroupName "testing" -TemplateFile azuredeploy.json -TemplateParameterFile azuredeploy.parameters.json | ||
|
||
------------------------------ | ||
|
||
To deploy a custom azure policy to a resource group there needs to be 2 deployments, as the creation of policy is a subscription level ARM deployment and the application of the policy to a resource group is a resource group level deployment. | ||
|
||
# testing is as follows | ||
|
||
## git pull the repo into cloud shell | ||
|
||
1. from cloud shell in powershell mode run | ||
|
||
git pull https://github.com/kramit/AZ103-Notes.git | ||
|
||
2. cd into AZ103-Notes/templates/ | ||
|
||
|
||
|
||
## create and apply the template | ||
|
||
1. Manually create a resource group called "testing" this is because the resource group name is hard coded into the policyapplytest azuredeploy.json parameters at the top of the file | ||
|
||
2. run the following from the policydeploytest dir using cloud shell this will create the custom template | ||
|
||
New-AzDeployment -Location "east us" -templatefile ./azuredeploy.json -TemplateParameterFile ./azuredeploy.parameters.json | ||
|
||
3. run the following from policyapplytest dir using cloud shell this will apple the custom template to the rg of "testing" | ||
|
||
New-AzResourceGroupDeployment -ResourceGroupName "testing" -TemplateFile azuredeploy.json -TemplateParameterFile azuredeploy.parameters.json | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters