Policy deployment to Subscription rather than Management Group #1187
-
Could someone assist with the changes I need to make to policies.bicep? I've deployed to subscription with this: targetScope = 'subscription' @metadata({ message: 'The JSON version of this file is programatically generated from Bicep. PLEASE DO NOT UPDATE MANUALLY!!' }) @description('Optionally set the deployment location for policies with Deploy If Not Exists effect. DEFAULT VALUE = "deployment().location"') @description('Optionally set the scope for custom Policy Definitions used in Policy Set Definitions (Initiatives). Must be one of '/', '/subscriptions/id' or '/providers/Microsoft.Management/managementGroups/id'. DEFAULT VALUE = '/providers/Microsoft.Management/managementGroups/${topLevelManagementGroupPrefix}'') // Extract the environment name to dynamically determine which policies to deploy. // Default deployment locations used in templates // Used to identify template variables used in the templates for replacement. But to me it's not changing the definition Id's in the policysetdefinitions New-AzSubscriptionDeployment : 16:00:06 - The deployment 'deploy' failed with error(s). Showing 1 out of 1 error(s). Could some one help please? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hey these are designed to be deployed to a management group scope only. As per our ALZ/ESLZ guidance. You will need to amend the policy definition IDs of the initiatives which are also deployed via the policies.bicep file. We would highly suggest just deploying to management group scope or checking out the ALZ Bicep repo https://aka.ms/alz/bicep |
Beta Was this translation helpful? Give feedback.
Hey these are designed to be deployed to a management group scope only. As per our ALZ/ESLZ guidance.
You will need to amend the policy definition IDs of the initiatives which are also deployed via the policies.bicep file.
We would highly suggest just deploying to management group scope or checking out the ALZ Bicep repo https://aka.ms/alz/bicep