Enhance Static Analysis for policyAssignmentName
Property of Microsoft.Authorization policyAssignments resource in Bicep
#15325
Labels
Description
As a user of Bicep, I would like to have more informative static analysis for the
policyAssignmentName
property when defining a new resource of this type. Currently, the only static analysis feedback I receive is that this property is of typestring
, which lacks the detailed validation I expect based on the Azure REST API specs.Issue:
When instantiating a policy assignment resource in Bicep, the static analysis for the
name
property only checks that it’s astring
. However, according to the Azure REST API specifications, thepolicyAssignmentName
property must adhere to a specific pattern:Source: Azure REST API Specs
Additionally, the official Azure documentation specifies the following restrictions:
- Character limit: - 1-128 for display name - 1-64 for resource name - 1-24 for resource name at management group scope - Valid characters for resource name: - Can't use: <>*%&:\?.+/ or control characters. - Can't end with a period or space.
Source: Policy Assignments Documentation
Expected Behavior:
I would like Bicep’s static analysis to validate the
policyAssignmentName
property against the pattern specified in the API specs and the character limits/restrictions outlined in the official documentation. Ideally, the IDE would surface an error or warning if invalid characters are used or if the length exceeds the allowed range.Current Behavior:
name
property is of typestring
.Request:
Please enhance the static analysis in Bicep to:
policyAssignmentName
against the pattern defined in the REST API specs.This enhancement would improve the developer experience by reducing the number of invalid deployments caused by improperly formatted policy assignment names.
The text was updated successfully, but these errors were encountered: