Skip to content

Refactor K8s, Docker Compose, and AKS infrastructure to pipeline steps - #16414

Merged
Eric Erhardt (eerhardt) merged 2 commits into
microsoft:mainfrom
eerhardt:RefactorK8sAndDockerBeforeStartPipeline
Apr 27, 2026
Merged

Eric Erhardt (eerhardt) merged 2 commits into
microsoft:mainfrom
eerhardt:RefactorK8sAndDockerBeforeStartPipeline

Conversation

@eerhardt

@eerhardt Eric Erhardt (eerhardt) commented Apr 23, 2026 •

Copy link
Copy Markdown
Member

Description

Follow up from #13780.

Apply the same BeforeStartEvent -> pipeline-step pattern previously used for Azure Container Apps and Azure App Service to the Kubernetes, Docker Compose, and Azure Kubernetes Service publishing environments.

For each integration:

  • Per-environment work (build deployment targets, configure OTLP, register dashboard) moves from an IDistributedApplicationEventingSubscriber.OnBeforeStartAsync into a per-env pipeline step (prepare-deployment-targets-{Name}, or prepare-aks-{Name} for AKS) registered via PipelineStepAnnotation in the env resource constructor.

  • Env-less validation (resource configured to publish as X but no X env exists) moves into a global validate-{...} pipeline step registered idempotently in AddXxxInfrastructureCore via a marker singleton class.

  • The XxxInfrastructure eventing-subscriber classes are deleted.

AKS keeps two distinct steps: prepare-aks-{Name} runs before the inner Kubernetes env's prepare-deployment-targets step (because it mutates compute resources the K8s prep reads), and aks-get-credentials-{Name} runs after Azure provisioning and before Helm prepare.

Copilot AI review requested due to automatic review settings April 23, 2026 23:27
@eerhardt

Copy link
Copy Markdown
Member Author

/deployment-test

@github-actions

github-actions Bot commented Apr 23, 2026 •

Copy link
Copy Markdown
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/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 16414

Or

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

@github-actions

Copy link
Copy Markdown
Contributor

🚀 Deployment tests starting on PR #16414...

This will deploy to real Azure infrastructure. Results will be posted here when complete.

View workflow run

var appModel = context.Model;
var executionContext = context.ExecutionContext;

if (executionContext.IsRunMode)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

David Fowler (@davidfowl) Mitch Denny (@mitchdenny) - do you have any thoughts on this pattern? Should we conditionally add steps to the pipeline? i.e. if this is RunMode, don't add the step at all. Or should we always add the step, and then do a check early and no-op if it is RunMode.

@github-actions
github-actions Bot temporarily deployed to deployment-testing April 23, 2026 23:36 Inactive
@github-actions
github-actions Bot had a problem deploying to deployment-testing April 23, 2026 23:36 Failure
@github-actions
github-actions Bot had a problem deploying to deployment-testing April 23, 2026 23:36 Failure
@github-actions
github-actions Bot temporarily deployed to deployment-testing April 23, 2026 23:36 Inactive
@github-actions
github-actions Bot temporarily deployed to deployment-testing April 23, 2026 23:36 Inactive
@github-actions
github-actions Bot had a problem deploying to deployment-testing April 23, 2026 23:36 Failure
@github-actions
github-actions Bot had a problem deploying to deployment-testing April 23, 2026 23:36 Failure
@github-actions
github-actions Bot had a problem deploying to deployment-testing April 23, 2026 23:36 Failure
@github-actions
github-actions Bot temporarily deployed to deployment-testing April 23, 2026 23:36 Inactive
@github-actions
github-actions Bot had a problem deploying to deployment-testing April 23, 2026 23:36 Failure
@github-actions
github-actions Bot temporarily deployed to deployment-testing April 23, 2026 23:36 Inactive
@github-actions
github-actions Bot had a problem deploying to deployment-testing April 23, 2026 23:36 Failure
@github-actions
github-actions Bot had a problem deploying to deployment-testing April 23, 2026 23:36 Failure
@github-actions
github-actions Bot had a problem deploying to deployment-testing April 23, 2026 23:36 Failure
@github-actions
github-actions Bot temporarily deployed to deployment-testing April 23, 2026 23:36 Inactive
@github-actions
github-actions Bot had a problem deploying to deployment-testing April 23, 2026 23:36 Failure
@github-actions
github-actions Bot temporarily deployed to deployment-testing April 23, 2026 23:36 Inactive
@github-actions
github-actions Bot had a problem deploying to deployment-testing April 23, 2026 23:36 Failure
@github-actions
github-actions Bot had a problem deploying to deployment-testing April 23, 2026 23:36 Failure
@github-actions
github-actions Bot temporarily deployed to deployment-testing April 23, 2026 23:36 Inactive
@github-actions
github-actions Bot temporarily deployed to deployment-testing April 23, 2026 23:36 Inactive
@github-actions
github-actions Bot temporarily deployed to deployment-testing April 23, 2026 23:36 Inactive
@github-actions
github-actions Bot temporarily deployed to deployment-testing April 23, 2026 23:36 Inactive
@github-actions
github-actions Bot temporarily deployed to deployment-testing April 27, 2026 15:39 Inactive
@github-actions
github-actions Bot temporarily deployed to deployment-testing April 27, 2026 15:39 Inactive
@github-actions
github-actions Bot temporarily deployed to deployment-testing April 27, 2026 15:39 Inactive
@github-actions
github-actions Bot temporarily deployed to deployment-testing April 27, 2026 15:39 Inactive
@github-actions
github-actions Bot temporarily deployed to deployment-testing April 27, 2026 15:39 Inactive
@github-actions
github-actions Bot temporarily deployed to deployment-testing April 27, 2026 15:39 Inactive
@github-actions
github-actions Bot temporarily deployed to deployment-testing April 27, 2026 15:39 Inactive
@github-actions
github-actions Bot temporarily deployed to deployment-testing April 27, 2026 15:39 Inactive
@github-actions
github-actions Bot temporarily deployed to deployment-testing April 27, 2026 15:39 Inactive
@github-actions
github-actions Bot temporarily deployed to deployment-testing April 27, 2026 15:39 Inactive
@github-actions
github-actions Bot temporarily deployed to deployment-testing April 27, 2026 15:39 Inactive
@github-actions
github-actions Bot temporarily deployed to deployment-testing April 27, 2026 15:39 Inactive
@github-actions
github-actions Bot temporarily deployed to deployment-testing April 27, 2026 15:39 Inactive
@github-actions
github-actions Bot temporarily deployed to deployment-testing April 27, 2026 15:39 Inactive
@github-actions
github-actions Bot temporarily deployed to deployment-testing April 27, 2026 15:39 Inactive
@github-actions
github-actions Bot temporarily deployed to deployment-testing April 27, 2026 15:39 Inactive
@github-actions
github-actions Bot temporarily deployed to deployment-testing April 27, 2026 15:39 Inactive
@github-actions
github-actions Bot temporarily deployed to deployment-testing April 27, 2026 15:39 Inactive
@github-actions
github-actions Bot temporarily deployed to deployment-testing April 27, 2026 15:39 Inactive
@github-actions
github-actions Bot temporarily deployed to deployment-testing April 27, 2026 15:39 Inactive
@github-actions
github-actions Bot temporarily deployed to deployment-testing April 27, 2026 15:39 Inactive
@github-actions

Copy link
Copy Markdown
Contributor

✅ Deployment E2E Tests passed — 32 passed, 0 failed, 0 cancelled

View test results and recordings

View workflow run

Test Result Recording
Deployment.EndToEnd-VnetKeyVaultConnectivityDeploymentTests ✅ Passed ▶️ View Recording
Deployment.EndToEnd-AzureStorageDeploymentTests ✅ Passed ▶️ View Recording
Deployment.EndToEnd-AzureServiceBusDeploymentTests ✅ Passed ▶️ View Recording
Deployment.EndToEnd-AzureEventHubsDeploymentTests ✅ Passed ▶️ View Recording
Deployment.EndToEnd-NspStorageKeyVaultDeploymentTests ✅ Passed ▶️ View Recording
Deployment.EndToEnd-AzureAppConfigDeploymentTests ✅ Passed ▶️ View Recording
Deployment.EndToEnd-AzureKeyVaultDeploymentTests ✅ Passed ▶️ View Recording
Deployment.EndToEnd-FrontDoorDeploymentTests ✅ Passed ▶️ View Recording
Deployment.EndToEnd-VnetSqlServerConnectivityDeploymentTests ✅ Passed ▶️ View Recording
Deployment.EndToEnd-AcaCompactNamingDeploymentTests ✅ Passed ▶️ View Recording
Deployment.EndToEnd-AksVnetWithAzureResourcesDeploymentTests ✅ Passed ▶️ View Recording
Deployment.EndToEnd-AzureLogAnalyticsDeploymentTests ✅ Passed ▶️ View Recording
Deployment.EndToEnd-TypeScriptExpressDeploymentTests ✅ Passed ▶️ View Recording
Deployment.EndToEnd-AksBlazorRedisDeploymentTests ✅ Passed ▶️ View Recording
Deployment.EndToEnd-AksMultipleNodePoolsDeploymentTests ✅ Passed ▶️ View Recording
Deployment.EndToEnd-TypeScriptVnetSqlServerInfraDeploymentTests ✅ Passed ▶️ View Recording
Deployment.EndToEnd-AzureContainerRegistryDeploymentTests ✅ Passed ▶️ View Recording
Deployment.EndToEnd-AksWithAzureResourcesDeploymentTests ✅ Passed ▶️ View Recording
Deployment.EndToEnd-AksStarterDeploymentTests ✅ Passed ▶️ View Recording
Deployment.EndToEnd-AksVnetInfraDeploymentTests ✅ Passed ▶️ View Recording
Deployment.EndToEnd-AuthenticationTests ✅ Passed
Deployment.EndToEnd-VnetSqlServerInfraDeploymentTests ✅ Passed ▶️ View Recording
Deployment.EndToEnd-AcaStarterDeploymentTests ✅ Passed ▶️ View Recording
Deployment.EndToEnd-AcaManagedRedisDeploymentTests ✅ Passed ▶️ View Recording
Deployment.EndToEnd-VnetStorageBlobInfraDeploymentTests ✅ Passed ▶️ View Recording
Deployment.EndToEnd-AksStarterWithRedisHelmDeploymentTests ✅ Passed ▶️ View Recording
Deployment.EndToEnd-AcaExistingRegistryDeploymentTests ✅ Passed ▶️ View Recording
Deployment.EndToEnd-AppServiceReactDeploymentTests ✅ Passed ▶️ View Recording
Deployment.EndToEnd-AcaDeploymentErrorOutputTests ✅ Passed ▶️ View Recording
Deployment.EndToEnd-AcaCustomRegistryDeploymentTests ✅ Passed ▶️ View Recording
Deployment.EndToEnd-VnetStorageBlobConnectivityDeploymentTests ✅ Passed ▶️ View Recording
Deployment.EndToEnd-VnetKeyVaultInfraDeploymentTests ✅ Passed ▶️ View Recording

@eerhardt
Eric Erhardt (eerhardt) enabled auto-merge (squash) April 27, 2026 17:59
@davidfowl David Fowler (davidfowl) added the breaking-change Issue or PR that represents a breaking API or functional change over a prerelease. label Apr 27, 2026
@eerhardt
Eric Erhardt (eerhardt) merged commit bc68c60 into microsoft:main Apr 27, 2026
598 of 602 checks passed
@eerhardt
Eric Erhardt (eerhardt) deleted the RefactorK8sAndDockerBeforeStartPipeline branch April 27, 2026 23:10
@github-actions github-actions Bot added this to the 13.3 milestone Apr 27, 2026

This branch was previously deployed

1 inactive deployment
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

breaking-change Issue or PR that represents a breaking API or functional change over a prerelease.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants