Skip to content

Conversation

@eerhardt
Copy link
Member

Description

When an individual compute resource has its own build steps, the AzureEnvironmentResource shouldn't try to build the image itself. Instead, the environment's build step should be dependent on the compute resource's build step.

Contributes to #12162

Checklist

  • Is this feature complete?
    • No. Follow-up changes expected.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
  • Did you add public API?
    • No
  • Does the change make any security assumptions or guarantees?
    • No
  • Does the change require an update in our Aspire docs?
    • No

…d steps

When an individual compute resource has its own build steps, the AzureEnvironmentResource shouldn't try to build the image itself. Instead, the environment's build step should be dependent on the compute resource's build step.

Contributes to dotnet#12162
Copilot AI review requested due to automatic review settings October 23, 2025 19:44
@github-actions
Copy link
Contributor

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 12327

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 12327"

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR modifies the Azure deployment pipeline to allow individual compute resources to define their own build steps. When a compute resource has custom build steps, the AzureEnvironmentResource delegates to them instead of building the image itself. This is achieved by introducing a new pipeline configuration that establishes dependencies between the environment's build step and resource-specific build steps.

Key changes:

  • Introduced a new pipeline step (default-image-tags) that assigns default deployment tags to resources
  • Added pipeline configuration logic to detect compute resources with custom build steps and establish proper dependencies
  • Modified the main build step to only build images for resources without custom build steps

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/Aspire.Hosting.Azure/AzureEnvironmentResource.cs Refactored build pipeline to support delegating to compute resources' custom build steps through dependency management
tests/Aspire.Hosting.Azure.Tests/AzureDeployerTests.cs Added test to verify that resources with custom build steps are properly handled and dependencies are correctly configured

Copy link
Member

@captainsafia captainsafia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works from local testing!

@eerhardt eerhardt enabled auto-merge (squash) October 23, 2025 20:02
@eerhardt eerhardt merged commit b9cdc57 into dotnet:main Oct 23, 2025
303 checks passed
@eerhardt eerhardt deleted the AzureEnvironmentSupportsBuildStepsOnResource branch October 23, 2025 20:04
@dotnet-policy-service dotnet-policy-service bot added this to the 13.0 milestone Oct 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants