Stop ViteApps (build only containers) from getting Azure managed identities and roles#14474
Merged
eerhardt merged 2 commits intodotnet:release/13.2from Feb 12, 2026
Merged
Conversation
…tities and roles These resources don't get deployed, so they should be filtered from getting role assignments and managed identities added for them.
Contributor
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 14474Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 14474" |
Contributor
There was a problem hiding this comment.
Pull request overview
Filters publish-time managed identity / role-assignment derivation so build-only container resources (e.g., ViteApps that are not deployed) don’t receive Azure identities or role assignments.
Changes:
- Update
AzureResourcePreparerto derive role assignments only for compute resources (excluding build-only containers) plus explicitly-declared user-assigned identities. - Add a regression test ensuring a ViteApp does not get a managed identity during publish preparation.
- Reference
Aspire.Hosting.JavaScriptfrom the Azure test project to enable ViteApp usage in tests.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| tests/Aspire.Hosting.Azure.Tests/AzureResourcePreparerTests.cs | Adds coverage to ensure ViteApps (build-only containers) don’t get managed identities/role assignments. |
| tests/Aspire.Hosting.Azure.Tests/Aspire.Hosting.Azure.Tests.csproj | Adds JavaScript hosting project reference needed for AddViteApp in tests. |
| src/Aspire.Hosting.Azure/AzureResourcePreparer.cs | Switches role-assignment derivation to use GetComputeResources() (excludes build-only containers) and includes identity resources. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
karolz-ms
approved these changes
Feb 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
These resources don't get deployed, so they should be filtered from getting role assignments and managed identities added for them.