Conversation
Agent-Logs-Url: https://github.com/Azure/azure-dev/sessions/6afbbbb0-ea7e-45dc-914f-6d59c04a5197 Co-authored-by: JeffreyCA <9157833+JeffreyCA@users.noreply.github.com>
jongio
left a comment
There was a problem hiding this comment.
Clean integration with the existing preflight framework. The three match types (exact, prefix, substring) cover Azure's published reserved-name rules well, and the tests are solid. Two minor suggestions inline.
There was a problem hiding this comment.
Pull request overview
Adds a new local Bicep preflight rule that warns when predicted Azure resource names violate Azure’s reserved/trademarked naming restrictions, surfacing actionable feedback before ARM deployment.
Changes:
- Registers a new local preflight check (
reserved_resource_names) in the Bicep provider preflight pipeline. - Implements reserved-word detection against
bicep snapshotpredicted resource names (exact-match, substring, andLOGINprefix; per/-delimited name segments). - Adds unit tests for violation detection and end-to-end preflight warning emission, plus cspell overrides for reserved-word tokens.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| cli/azd/pkg/infra/provisioning/bicep/bicep_provider.go | Adds reserved-name word lists, registers the new preflight check, and implements detection + warning message formatting. |
| cli/azd/pkg/infra/provisioning/bicep/bicep_provider_reserved_names_test.go | Adds unit coverage for the reserved-name detection helper and the provider preflight check behavior. |
| cli/azd/.vscode/cspell.yaml | Adds file-scoped cspell allowlist entries for reserved-word tokens used in bicep_provider.go. |
Co-authored-by: Copilot <copilot@github.com>
📋 Prioritization NoteThanks for the contribution! The linked issue isn't in the current milestone yet. |
Azure Dev CLI Install InstructionsInstall scriptsMacOS/Linux
bash: pwsh: WindowsPowerShell install MSI install Standalone Binary
MSI
Documentationlearn.microsoft.com documentationtitle: Azure Developer CLI reference
|
- Add .azdxignore support docs for azd x watch (PR Azure#7697) - Document reserved resource names preflight check (PR Azure#7746) - Add CHANGELOG entries for AI extension flag changes (PR Azure#7741) - Add CHANGELOG entries for Agents Extension RBAC fixes (PRs Azure#7763, Azure#7747, Azure#7765) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Resolves #7745
Summary
This PR adds a local Bicep preflight check that warns when predicted resource names match Azure's published reserved-word restrictions.
Reference: Reserved resource names
This PR also adds colour highlighting to warnings to make key information easier to parse:
Changes
New preflight check:
reserved_resource_namesRegistered in
validatePreflightalongside the existing role-assignment and AI-quota checks. Runs against the Bicep snapshot's predicted resources, so names are fully resolved before evaluation.Detection covers the three rule types published by Azure:
AZURE,BING,XBOX,OFFICE365,SHAREPOINT(case-insensitive)MICROSOFT,WINDOWSLOGINEach
/-delimited segment is checked independently so child resources are evaluated on their own name segments. All violations for a resource are reported in a single pass, so users don't need fix-rerun cycles to surface additional matches in the same name.ARM template expressions (names beginning with
[) are skipped — their literal text isn't the deployed resource name and may incidentally contain provider namespaces likeMicrosoft.ContainerRegistry.Telemetry
New diagnostic ID
reserved_resource_nameflows through the existing preflight telemetry pipeline (rule ID, diagnostic counts, outcome correlation with deployment results).