Skip to content

Conversation

eerhardt
Copy link
Member

@eerhardt eerhardt commented Jun 5, 2025

  • Updated BuildRoleAssignmentAnnotations to skip processing for container emulators.
  • Added a new test DoesNotApplyRoleAssignmentsInRunModeForEmulators to verify that role assignments are not applied to emulator resources.

Fixes #9422

Customer Impact

Users are unable to F5 their application when they don't have Azure subscription information added, even though they are using the local emulator. We shouldn't require Azure subscription information when using emulators.

Testing

Added new test. Plus manual.

Risk

Low

Regression?

Yes

- Updated `BuildRoleAssignmentAnnotations` to skip processing for container emulators.
- Added a new test `DoesNotApplyRoleAssignmentsInRunModeForEmulators` to verify that role assignments are not applied to emulator resources.
@eerhardt eerhardt added the Servicing-consider Issue for next servicing release review label Jun 5, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR skips role assignment processing for container emulator resources to prevent requiring Azure subscription details in local emulator scenarios.

  • Update BuildRoleAssignmentAnnotations to bypass container resources.
  • Add DoesNotApplyRoleAssignmentsInRunModeForEmulators test to verify the skipping behavior in run mode.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
tests/Aspire.Hosting.Azure.Tests/AzureResourcePreparerTests.cs Adds a test case to confirm role assignments are not applied for emulators.
src/Aspire.Hosting.Azure/AzureResourcePreparer.cs Introduces a check to skip role assignment processing for container emulator resources.
Comments suppressed due to low confidence (1)

src/Aspire.Hosting.Azure/AzureResourcePreparer.cs:146

  • [nitpick] The method name IsContainer may be ambiguous if it is intended specifically to identify emulator resources; consider clarifying its usage through renaming or additional documentation.
if (azureReference.IsContainer())

@github-actions github-actions bot added the area-app-model Issues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication label Jun 5, 2025
@danmoseley danmoseley added Servicing-approved Approved for servicing release and removed Servicing-consider Issue for next servicing release review labels Jun 5, 2025
@danmoseley danmoseley enabled auto-merge (squash) June 5, 2025 22:32
@danmoseley danmoseley merged commit 5bc26c7 into dotnet:release/9.3 Jun 6, 2025
512 of 517 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Jul 6, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-app-model Issues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication Servicing-approved Approved for servicing release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants