[release/13.5] Hide Azure environment when all resources use emulators
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
- If yes, did you have an API Review for it?
- No
- Yes
- 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
- If yes, have you done a threat model and had a security review?
- No
- Yes
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.