-
Notifications
You must be signed in to change notification settings - Fork 798
Closed
Closed
Copy link
Labels
Description
Bicep version
>=0.38.3
Describe the bug
Microsoft.Authorization/policyDefinitions with 'existing' cannot use tenant scope anymore since version 0.38.3.
To Reproduce
Steps to reproduce the behavior:
This template is used to get existing builtin policy definitions as they exist on the tenant level:
targetScope = 'managementGroup'
var input array = [
{policyDefinitionId: '0a914e76-4921-4c19-b460-a2d36003525a'}
]
// Get all builtin policies as defined in the input parameter
resource builtin 'Microsoft.Authorization/policyDefinitions@2023-04-01' existing = [for policy in input: {
scope: tenant()
name: policy.policyDefinitionId
}]
When building this template with >=0.38.3, this throws an error: Error BCP135: Scope "tenant" is not valid for this resource type. Permitted scopes: "managementGroup", "subscription". [https://aka.ms/bicep/core-diagnostics#BCP135]
Additional context
This simply worked on earlier versions. I built the template with 0.37.4 and got no errors.
RikMerkens, Gijsreyn and sbebrys
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Done