Hide Azure environment when all resources use emulators - #19843
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 47b77be6-ef01-4e61-8b4e-96d0ad93b434
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 19843Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 19843" |
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 47b77be6-ef01-4e61-8b4e-96d0ad93b434
There was a problem hiding this comment.
Pull request overview
Hides the Azure environment control resource for emulator-only run-mode applications while preserving it for cloud provisioning.
Changes:
- Adds conditional Azure environment visibility.
- Adds emulator-only and mixed-model regression tests.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/Aspire.Hosting.Azure/AzureResourcePreparer.cs |
Hides unused Azure environments during preparation. |
tests/Aspire.Hosting.Azure.Tests/AzureRunAsEmulatorModeTests.cs |
Verifies hidden and visible scenarios. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
Tests selector11 / 99 PR test projects · 2 PR jobs · 1 advisory-only target, from 2 changed files. Selected PR test projects (11 / 99)
Selected PR jobs (2)
Advisory workflow impact (1)
How these were chosen — grouped by what changed
🔧 🧪 Job reasons
Selection computed for commit |
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
|
Pull request created: #1618
|
|
📝 Documentation has been drafted in microsoft/aspire.dev#1618 targeting Added documentation for the dashboard behavior change: Aspire now hides the
Note This draft PR needs human review before merging. |
|
/backport to release/13.5 |
|
Started backporting to |
|
David Fowler (@davidfowl) backporting to git am output$ git am --3way --empty=keep --ignore-whitespace --keep-non-patch changes.patch
Applying: Hide unused Azure environment resource
Using index info to reconstruct a base tree...
M tests/Aspire.Hosting.Azure.Tests/AzureRunAsEmulatorModeTests.cs
Falling back to patching base and 3-way merge...
Auto-merging tests/Aspire.Hosting.Azure.Tests/AzureRunAsEmulatorModeTests.cs
CONFLICT (content): Merge conflict in tests/Aspire.Hosting.Azure.Tests/AzureRunAsEmulatorModeTests.cs
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config set advice.mergeConflict false"
Patch failed at 0001 Hide unused Azure environment resource
Error: The process '/usr/bin/git' failed with exit code 128 |
|
/backport to release/13.5 |
|
Started backporting to |
|
Eric Erhardt (@eerhardt) backporting to git am output$ git am --3way --empty=keep --ignore-whitespace --keep-non-patch changes.patch
Applying: Hide unused Azure environment resource
Using index info to reconstruct a base tree...
M tests/Aspire.Hosting.Azure.Tests/AzureRunAsEmulatorModeTests.cs
Falling back to patching base and 3-way merge...
Auto-merging tests/Aspire.Hosting.Azure.Tests/AzureRunAsEmulatorModeTests.cs
CONFLICT (content): Merge conflict in tests/Aspire.Hosting.Azure.Tests/AzureRunAsEmulatorModeTests.cs
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config set advice.mergeConflict false"
Patch failed at 0001 Hide unused Azure environment resource
Error: The process '/usr/bin/git' failed with exit code 128 |
) 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>
Description
AppHosts that run every Azure resource through a local emulator currently show an
azure-environmentresource 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:
The dashboard now omits
azure-environmentfor this model. Adding any Azure resource that requires provisioning keepsazure-environmentvisible.Validation:
AzureRunAsEmulatorModeTests(18 tests)AzureResourcePreparerTests(26 tests)Fixes #19617
Checklist
<remarks />and<code />elements on your triple slash comments?