-
Couldn't load subscription status.
- Fork 713
Emit separate pipeline steps for each AzureBicepResource and compute resource in AzureEnvironmentResource #12324
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: captainsafia <1857993+captainsafia@users.noreply.github.com>
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 12324Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 12324" |
| }; | ||
| pushStep.DependsOn(buildStep); | ||
| pushStep.DependsOn(provisionStep); | ||
| foreach (var provisionStep in provisionSteps) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot Update the implementation to emit a separate push step for each compute resource that is registered. Wire up a dependency between the push step for each compute resource and the provision step from the IContainerRegistry resource that it references. Use the configuration pipeline API introduced in b2f90eb to do this. Look at b9cdc57 for an example of how to implement the relationships using the PipelineConfigurationAnnotation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated in commit a8cbc8d. The implementation now:
- Creates separate push steps for each compute resource (named
push-{resourceName}) - Uses
PipelineConfigurationAnnotationto dynamically wire dependencies between push steps and their corresponding container registry provision steps - Extracts the compute resource from each push step, finds its container registry via
TryGetContainerRegistry, and adds a dependency onprovision-{registryName}
Each push step now explicitly depends on both the build step and the provision step for its container registry.
…pendencies Co-authored-by: captainsafia <1857993+captainsafia@users.noreply.github.com>
|
Closing in favor of taking this a different direction. |
Summary
Updates the
AzureEnvironmentResourceimplementation to emit separatePipelineStepinstances for eachAzureBicepResourcethat needs to be provisioned and for each compute resource that requires container image pushing, improving visibility and granularity in the deployment pipeline.Changes
Provision Steps
Before:
The implementation created a single pipeline step named
provision-azure-bicep-resourcesthat provisioned all Azure Bicep resources together:After:
The implementation now creates individual pipeline steps for each resource, with names that include the resource being provisioned:
Push Steps
Before:
The implementation created a single pipeline step named
push-container-imagesthat pushed all container images together.After:
The implementation now creates individual push steps for each compute resource:
Dynamic Dependency Wiring
The implementation uses
PipelineConfigurationAnnotationto dynamically wire dependencies between push steps and container registry provision steps:Example
For an application with three Azure resources (storage1, registry, cosmos) and two compute resources (app1, app2), the pipeline now shows:
Pipeline Steps:
validate-azure-cli-logincreate-provisioning-contextprovision-storage1(tagged:provision-infra)provision-registry(tagged:provision-infra)provision-cosmos(tagged:provision-infra)build-container-images(tagged:build-compute)push-app1(depends on: build + provision-registry)push-app2(depends on: build + provision-registry)deploy-compute-resources(tagged:deploy-compute)print-dashboard-urlBenefits
Implementation Details
PipelineStepAnnotationfactory inAzureEnvironmentResourceconstructor to enumerate bothAzureBicepResourceand compute resource instances from the modelProvisionSingleAzureBicepResourceAsyncmethod to handle provisioning of individual Bicep resourcesPushSingleContainerImageAsyncmethod to handle pushing individual container imagesPipelineConfigurationAnnotationto dynamically wire dependencies between push steps and container registry provision steps during the pipeline configuration phaseProvisionAzureBicepResourcesAsync,PushContainerImagesAsync,LoginToAllRegistriesAsync, andPushImagesToAllRegistriesAsyncdeploy-compute-resourcesstep depends on all push and provision stepsWellKnownPipelineTags.ProvisionInfrastructureas requiredOriginal prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.