Hide Azure environment when all resources use emulators
Merged
EE
1mo ago+49+49+01234567890123456789-0-0-0123456789
Description
AppHosts that run every Azure resource through a local emulator currently show an azure-environment resource stuck in the Not started state. This hides that control resource when the completed run-mode model has no Azure resources requiring provisioning, while keeping it visible for mixed emulator/cloud models.
The visibility decision runs during Azure resource preparation, after fluent emulator configuration is complete, and uses the existing provisionable-resource filtering.
User-facing usage
Existing emulator-only AppHosts require no changes. For example:
builder.AddAzureCosmosDB("cosmos").RunAsEmulator();
builder.AddAzureStorage("storage").RunAsEmulator();
builder.AddAzureEventHubs("eventhubs").RunAsEmulator();
The dashboard now omits azure-environment for this model. Adding any Azure resource that requires provisioning keeps azure-environment visible.
Validation:
AzureRunAsEmulatorModeTests(18 tests)AzureResourcePreparerTests(26 tests)
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