Skip to content

[release/13.5] Hide Azure environment when all resources use emulators - #19998

Merged
Jose Perez Rodriguez (joperezr) merged 1 commit into
release/13.5from
eerhardt-backport-pr-19843
Sep 9, 2026
Merged

Jose Perez Rodriguez (joperezr) merged 1 commit into
release/13.5from
eerhardt-backport-pr-19843

Conversation

@eerhardt

@eerhardt Eric Erhardt (eerhardt) commented Sep 8, 2026

Copy link
Copy Markdown
Member

Description

Backport of #19843 to release/13.5.

Emulator-only AppHosts currently show an unused azure-environment resource stuck in Not started. This backport hides that resource when no Azure resources require provisioning, while keeping it visible for mixed emulator/cloud models.

Cherry-picks main commit efbfe185b7a8c99536661768b3fa9bddd07f332b. The test-file conflict was resolved by retaining the release branch's ASPIRECOSMOSDB001 suppression alongside the new ASPIREAZURE001 suppression. Existing RunAsPreviewEmulator coverage is unchanged.

User-facing usage

Existing emulator-only AppHosts require no changes:

builder.AddAzureCosmosDB("cosmos").RunAsEmulator();
builder.AddAzureStorage("storage").RunAsEmulator();
builder.AddAzureEventHubs("eventhubs").RunAsEmulator();

The dashboard omits azure-environment for this model. Adding an Azure resource that requires provisioning keeps it visible.

Fixes #19617

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
    • No. Follow-up changes expected.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
    • No
  • Did you add public API?
    • Yes
      • If yes, did you have an API Review for it?
        • Yes
        • No
      • Did you add <remarks /> and <code /> elements on your triple slash comments?
        • Yes
        • No
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
      • If yes, have you done a threat model and had a security review?
        • Yes
        • No
    • No

Customer Impact

AppHosts using only local Azure emulators display a misleading azure-environment resource in Not started, even though no Azure provisioning is needed. This removes that dashboard noise without hiding the environment when cloud provisioning is required.

Testing

All 44 tests in AzureRunAsEmulatorModeTests and AzureResourcePreparerTests passed on release/13.5, including both backported test cases. Quarantined and outerloop tests were excluded.

Risk

Low. The change only adds a hidden annotation in run mode when there are no provisionable Azure resources; cloud provisioning and publish behavior are unchanged. No public API changes.

Regression?

Sort of. User experience changed for the worse. Per the triage on #19617; this addresses existing cosmetic dashboard behavior.

Hide the unused azure-environment resource when the completed run-mode
model contains no Azure resources requiring provisioning. Keep it visible
for mixed emulator/cloud models.

(cherry picked from commit efbfe18)

Resolve the test-file conflict by preserving release/13.5's Cosmos DB
preview-emulator warning suppression alongside the new Azure environment
warning suppression.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@github-actions

github-actions Bot commented Sep 8, 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 -- 19998

Or

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

An existing HiddenOnCompletion annotation prevents the environment from being hidden in an emulator-only model.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Backports the Azure emulator-only dashboard visibility fix to release/13.5.

Changes:

  • Hides the unused Azure environment in emulator-only run models.
  • Adds emulator-only and mixed cloud/emulator regression tests.
File summaries
File Description
src/Aspire.Hosting.Azure/AzureResourcePreparer.cs Applies hidden-resource metadata when provisioning is unnecessary.
tests/Aspire.Hosting.Azure.Tests/AzureRunAsEmulatorModeTests.cs Tests hidden and visible environment scenarios.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 1
  • Review effort level: Balanced

Comment thread src/Aspire.Hosting.Azure/AzureResourcePreparer.cs
@joperezr

Copy link
Copy Markdown
Member

Hmm checks weren't triggered for some reason cc Ankit Jain (@radical).

Closing and reopening to trigger them.

@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Tests selector (audit mode)

The full test matrix and all jobs still run in audit mode. The tests and jobs below are what selective CI would run under enforcement.

11 / 100 test projects · 3 jobs, from 2 changed files.

Selected test projects (11 / 100)

Aspire.Hosting.Azure.Kubernetes.Tests, Aspire.Hosting.Azure.Kusto.Tests, Aspire.Hosting.Azure.Tests, Aspire.Hosting.Blazor.Tests, Aspire.Hosting.CodeGeneration.TypeScript.Tests, Aspire.Hosting.Docker.Tests, Aspire.Hosting.Dotnet.Tests, Aspire.Hosting.Foundry.Tests, Aspire.Hosting.Radius.Tests, Aspire.Hosting.Tests, Aspire.Playground.Tests

Selected jobs (3)

deployment-e2e, extension-e2e, typescript-api-compat


How these were chosen — grouped by what changed

⚠️ 10 of the 11 selected test projects come from a single change — src/Aspire.Hosting.Azure/AzureResourcePreparer.cs.

🔧 src/Aspire.Hosting.Azure/AzureResourcePreparer.cs (changed source)
1 directly: Aspire.Hosting.Azure.Tests
9 via the project graph: Aspire.Hosting.Azure.Kusto.Tests (2 hops), Aspire.Hosting.Blazor.Tests (3 hops), Aspire.Hosting.CodeGeneration.TypeScript.Tests (2 hops), Aspire.Hosting.Docker.Tests (2 hops), Aspire.Hosting.Dotnet.Tests (3 hops), Aspire.Hosting.Foundry.Tests (2 hops), Aspire.Hosting.Radius.Tests (3 hops), Aspire.Hosting.Tests (2 hops), Aspire.Playground.Tests (2 hops)

🧪 tests/Aspire.Hosting.Azure.Tests/AzureRunAsEmulatorModeTests.cs (changed test)
1 directly: Aspire.Hosting.Azure.Tests
1 via the project graph: Aspire.Hosting.Azure.Kubernetes.Tests

Job reasons

Job Triggered by
deployment-e2e affected project Aspire.Hosting.Azure
extension-e2e src/Aspire.Hosting.Azure/AzureResourcePreparer.cs
• affected project Aspire.Hosting.Azure
typescript-api-compat affected project Aspire.Hosting.Azure

Selection computed for commit b978aca.

@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt.

@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt.

@joperezr
Jose Perez Rodriguez (joperezr) merged commit afc289f into release/13.5 Sep 9, 2026
1023 of 1030 checks passed
@joperezr
Jose Perez Rodriguez (joperezr) deleted the eerhardt-backport-pr-19843 branch September 9, 2026 17:30
@github-actions github-actions Bot added this to the 13.5.x milestone Sep 9, 2026
@aspire-repo-bot

Copy link
Copy Markdown
Contributor

✅ No documentation update needed.

Step 5 branch taken: excluded → base_branch_is_release, title_release_prefix, body_backport_marker

This PR is a backport and is out of scope for docs generation, overriding the docs_optional recommendation.

  • Exclusion reasons (from signals.json): base branch is release/13.5 (a release branch), title is prefixed [release/13.5], and the PR body contains an explicit backport marker ("Backport of Hide Azure environment when all resources use emulators #19843 to release/13.5", "Cherry-picks main commit efbfe185b7a8c99536661768b3fa9bddd07f332b").
  • Triggered signals: pr_body_has_user_facing_section (1) — this alone does not override the backport exclusion.
  • The original (forward) change was made in Hide Azure environment when all resources use emulators #19843 on the default branch; documentation, if needed, should be authored against that PR rather than duplicated here.

No documentation PR was drafted.

This was referenced Sep 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Hide azure-environment when all Azure resources use emulators

3 participants