Repository navigation
First version of an externalized 'azd add' experience, using resources - #10823
Conversation
…tension. This version writes it's entries as layers, and deploys them by registering a custom provider (`resources`). There are numerous issues and missing bits, which we'll need to add in future updates, but this is intended to be the start and it works!
|
Azure Pipelines: Successfully started running 1 pipeline(s). 26 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved critical defects risk deleting the wrong environment’s resources and applying changes beyond the approved preview, alongside CI-breaking build and lint failures.
21 open issues
Add azure.resources to extension build metadata and VersionOnly checks · New Reject duplicate model deployment names in wizard and config validation · New Wrap overlong table entries to satisfy the lll limit · New Configure ARM clients for the project's Azure cloud · New Use the selected environment for provider environment RPCs · New Prevent adding a second resources provider layer · New Ensure the preview covers the full scope that azd up applies · New Block duplicate resources layers until provider isolation is supported · New Reject multiple resources layers during initialization and add · New Include principalId in the AI Developer role assignment GUID · New Prevent duplicate model deployment resource names · New Pin a released azd SDK instead of replacing it with the local checkout · New Honor the selected environment throughout resources add · New Run rollback RPCs with a context unaffected by cancellation · New Escape carriage returns and newlines in Bicep string values · New Correct the claim that failed service writes leave azure.yaml changed · New Provide an approved experiences spec for azd resources add · New Provide an approved experiences spec for the --layer flag · New Use flag-neutral wording and preserve layer-name validation details · New Remove the dead pathless-provider validation flag · New
And 1 more that still need to be addressed.
What changed in this PR
This PR introduces an opt-in azure.resources extension that externalizes resource authoring and provisioning while preserving the existing core resource experience.
Changes:
- Adds an interactive
azd resources addwizard that saves infrastructure-layer configuration and services through host RPCs. - Registers the
resourcesprovider with extension-owned Bicep generation, environment setup, and quota-aware AI location selection. - Updates schemas, compatibility guards, tests, documentation, and extension CI/release wiring.
Extension user-contract review: blocked (54 extension files inspected; 0 new contract comments; existing-thread count unavailable). No PR identifier or review history was supplied, preventing duplicate-thread and approved-spec checks for resources, resources add, and --layer.
| File | Description |
|---|---|
| schemas/v1.0/azure.yaml.json | Updated as part of this pull request. |
| schemas/alpha/azure.yaml.json | Updated as part of this pull request. |
| eng/pipelines/release-ext-azure-resources.yml | Updated as part of this pull request. |
| docs/reference/feature-status.md | Updated as part of this pull request. |
| cli/azd/pkg/project/layer_test.go | Updated as part of this pull request. |
| cli/azd/pkg/project/importer.go | Updated as part of this pull request. |
| cli/azd/pkg/project/extension_config_test.go | Updated as part of this pull request. |
| cli/azd/pkg/infra/provisioning/provider.go | Updated as part of this pull request. |
| cli/azd/pkg/infra/provisioning/options_test.go | Updated as part of this pull request. |
| cli/azd/internal/grpcserver/environment_service_test.go | Updated as part of this pull request. |
| cli/azd/internal/cmd/add/add.go | Updated as part of this pull request. |
| cli/azd/internal/cmd/add/add_test.go | Updated as part of this pull request. |
| cli/azd/extensions/extension.schema.json | Updated as part of this pull request. |
| cli/azd/extensions/azure.resources/version.txt | Updated as part of this pull request. |
| cli/azd/extensions/azure.resources/README.md | Updated as part of this pull request. |
| cli/azd/extensions/azure.resources/migration.md | Updated as part of this pull request. |
| cli/azd/extensions/azure.resources/main.go | Updated as part of this pull request. |
| cli/azd/extensions/azure.resources/main_test.go | Updated as part of this pull request. |
| cli/azd/extensions/azure.resources/internal/version/version.go | Updated as part of this pull request. |
| cli/azd/extensions/azure.resources/internal/resources/scaffold/spec.go | Updated as part of this pull request. |
| cli/azd/extensions/azure.resources/internal/resources/scaffold/scaffold.go | Updated as part of this pull request. |
| cli/azd/extensions/azure.resources/internal/resources/scaffold/funcs.go | Updated as part of this pull request. |
| cli/azd/extensions/azure.resources/internal/resources/scaffold/funcs_test.go | Updated as part of this pull request. |
| cli/azd/extensions/azure.resources/internal/resources/scaffold/assets/scaffold/templates/main.parameters.jsont | Updated as part of this pull request. |
| cli/azd/extensions/azure.resources/internal/resources/scaffold/assets/scaffold/templates/main.bicept | Updated as part of this pull request. |
| cli/azd/extensions/azure.resources/internal/resources/scaffold/assets/scaffold/templates/ai-project.bicept | Updated as part of this pull request. |
| cli/azd/extensions/azure.resources/internal/resources/scaffold/assets/scaffold/base/modules/role-assignment.json | Updated as part of this pull request. |
| cli/azd/extensions/azure.resources/internal/resources/scaffold/assets/scaffold/base/modules/role-assignment.bicep | Updated as part of this pull request. |
| cli/azd/extensions/azure.resources/internal/resources/scaffold/assets/scaffold/base/modules/fetch-container-image.bicep | Updated as part of this pull request. |
| cli/azd/extensions/azure.resources/internal/resources/scaffold/assets/scaffold/base/modules/ai-search-conn.bicep | Updated as part of this pull request. |
| cli/azd/extensions/azure.resources/internal/resources/scaffold/assets/scaffold/base/abbreviations.json | Updated as part of this pull request. |
| cli/azd/extensions/azure.resources/internal/resources/parameters.go | Updated as part of this pull request. |
| cli/azd/extensions/azure.resources/internal/resources/layers_test.go | Updated as part of this pull request. |
| cli/azd/extensions/azure.resources/internal/resources/generate.go | Updated as part of this pull request. |
| cli/azd/extensions/azure.resources/internal/resources/extension.go | Updated as part of this pull request. |
| cli/azd/extensions/azure.resources/internal/resources/extension_test.go | Updated as part of this pull request. |
| cli/azd/extensions/azure.resources/internal/provider/provider.go | Updated as part of this pull request. |
| cli/azd/extensions/azure.resources/internal/provider/provider_test.go | Updated as part of this pull request. |
| cli/azd/extensions/azure.resources/internal/provider/contract_test.go | Updated as part of this pull request. |
| cli/azd/extensions/azure.resources/internal/cmd/root.go | Updated as part of this pull request. |
| cli/azd/extensions/azure.resources/internal/cmd/providers_manifest_test.go | Updated as part of this pull request. |
| cli/azd/extensions/azure.resources/internal/cmd/add.go | Updated as part of this pull request. |
| cli/azd/extensions/azure.resources/internal/cmd/add_service_test.go | Updated as part of this pull request. |
| cli/azd/extensions/azure.resources/internal/cmd/add_project.go | Updated as part of this pull request. |
| cli/azd/extensions/azure.resources/internal/cmd/add_project_test.go | Updated as part of this pull request. |
| cli/azd/extensions/azure.resources/internal/bicep/testdata/main.parameters.json | Updated as part of this pull request. |
| cli/azd/extensions/azure.resources/internal/bicep/provider_env.go | Updated as part of this pull request. |
| cli/azd/extensions/azure.resources/internal/bicep/parameters_test.go | Updated as part of this pull request. |
| cli/azd/extensions/azure.resources/internal/bicep/azure_test.go | Updated as part of this pull request. |
| cli/azd/extensions/azure.resources/internal/bicep/ai_location_test.go | Updated as part of this pull request. |
| cli/azd/extensions/azure.resources/internal/add/wizard.go | Updated as part of this pull request. |
| cli/azd/extensions/azure.resources/internal/add/types.go | Updated as part of this pull request. |
| cli/azd/extensions/azure.resources/internal/add/prompts.go | Updated as part of this pull request. |
| cli/azd/extensions/azure.resources/internal/add/host_detect.go | Updated as part of this pull request. |
| cli/azd/extensions/azure.resources/internal/add/existing.go | Updated as part of this pull request. |
| cli/azd/extensions/azure.resources/internal/add/configure_resource.go | Updated as part of this pull request. |
| cli/azd/extensions/azure.resources/internal/add/ai.go | Updated as part of this pull request. |
| cli/azd/extensions/azure.resources/go.mod | Updated as part of this pull request. |
| cli/azd/extensions/azure.resources/extension.yaml | Updated as part of this pull request. |
| cli/azd/extensions/azure.resources/cspell.yaml | Updated as part of this pull request. |
| cli/azd/extensions/azure.resources/ci-test.ps1 | Updated as part of this pull request. |
| cli/azd/extensions/azure.resources/ci-build.ps1 | Updated as part of this pull request. |
| cli/azd/extensions/azure.resources/build.sh | Updated as part of this pull request. |
| cli/azd/extensions/azure.resources/build.ps1 | Updated as part of this pull request. |
| cli/azd/extensions/azure.resources/.golangci.yaml | Updated as part of this pull request. |
| cli/azd/extensions/azure.resources/.gitignore | Updated as part of this pull request. |
| cli/azd/cmd/pipeline_test.go | Updated as part of this pull request. |
| cli/azd/.vscode/cspell.yaml | Updated as part of this pull request. |
| .github/workflows/lint-ext-azure-resources.yml | Updated as part of this pull request. |
| .github/CODEOWNERS | Updated as part of this pull request. |
Review effort: Max
Victor Vazquez (vhvb1989)
left a comment
There was a problem hiding this comment.
it;s looking good
|
(moving into draft, Copilot review was not done with me :)) |
- Make configureExtensionHost have the right signature to pass extension_manifest_files_test.go... - Update our extension so it has the proper fields, and add it to the list of extensions to test.
Make sure we check the layer name before move forward.
…tegration that I'd rather bring in incrementally.
…ow (in azd) we handle concurrent provider usage.
…generate the same bicep name.
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved critical defects can replace deployed Container App images with hello-world defaults and silently perform incremental deployments when deployment stacks were requested.
15 open issues
Reject deploymentStacks before extension execution · New Refresh parameter inputs after pre-provision hooks · New Prevent duplicate model deployment resource names Reject multiple resources layers during initialization and add Block duplicate resources layers until provider isolation is supported Add azure.resources to extension build metadata and VersionOnly checks Refresh parameter inputs after preprovision hooks run · New Target infrastructure layers explicitly in host-add previews · New Allow inherited extension providers without a layer path · New Make the layer path schema rule account for inherited providers · New Run rollback RPCs with a context unaffected by cancellation Honor the selected environment throughout resources add Add an experiences-spec reference for the azd resources namespace · New Check the current character when splitting underscore-separated names · New Provide an approved experiences spec for the --layer flag
14 resolved since last review
Include principalId in the AI Developer role assignment GUID Ensure the preview covers the full scope that azd up applies Prevent adding a second resources provider layer Use the selected environment for provider environment RPCs Configure ARM clients for the project's Azure cloud Wrap overlong table entries to satisfy the lll limit Reject duplicate model deployment names in wizard and config validation Escape carriage returns and newlines in Bicep string values Pin a released azd SDK instead of replacing it with the local checkout Provide an approved experiences spec for the infra.config field Remove the dead pathless-provider validation flag Use flag-neutral wording and preserve layer-name validation details Provide an approved experiences spec for azd resources add Correct the claim that failed service writes leave azure.yaml changed
Review effort: Max
… user facing term. Also, the readme was way too verbose. Slimmed down, probably still needs some more work.
Updated readme, it had a bunch of weird details in it.
…s with stale values, etc... Got rid of the cache, and just get it just in time instead. 'scope' values (like location) are now stored in their own type since the existence of the cache was doing double-duty as a "we've initialized required params".
There was a problem hiding this comment.
🟡 Changes recommended
Resource-group names omit project identity, causing cross-project collisions that block provisioning, while incorrect Foundry filtering and unchecked Bicep identifier collisions can also break resource selection and compilation.
3 open issues
15 resolved since last review
Refresh parameter inputs after pre-provision hooks Reject deploymentStacks before extension execution Prevent duplicate model deployment resource names Reject multiple resources layers during initialization and add Block duplicate resources layers until provider isolation is supported Add azure.resources to extension build metadata and VersionOnly checks Make the layer path schema rule account for inherited providers Allow inherited extension providers without a layer path Target infrastructure layers explicitly in host-add previews Refresh parameter inputs after preprovision hooks run Run rollback RPCs with a context unaffected by cancellation Honor the selected environment throughout resources add Check the current character when splitting underscore-separated names Add an experiences-spec reference for the azd resources namespace Provide an approved experiences spec for the --layer flag
Review effort: Max
- We need consistent line endings for our tests so they don't have to do some line-ending hackery when doing test comparisons. .gitattributes will make that work.
…d add' used to do)
…oyment by name. We'll come back to it if we need it later.
…lict with other names.
There was a problem hiding this comment.
🔵 Needs a closer look
Unpublished critical findings spanning authorization, infrastructure generation, and naming collisions require human assessment of deployment failures, runtime access errors, and incorrect resource bindings.
No open issues 🎉
3 resolved since last review
Review effort: Max
Azure Dev CLI Install InstructionsInstall scriptsMacOS/Linux
bash: pwsh: WindowsPowerShell install MSI install Standalone Binary
MSI
Documentationlearn.microsoft.com documentationtitle: Azure Developer CLI reference
|



First revision of the externalized 'azd add' (ie, resources) as an extension. This version writes it's entries as layers, and deploys them by registering a custom provider (
resources), exactly as we expect others to do.There are numerous issues and missing bits, which will get added in future updates, but this is intended to be the start and it works!