Skip to content

Added prompting for tenant to azure config experiences#12172

Merged
davidfowl merged 8 commits intomainfrom
davidfowl/select-tenant
Oct 20, 2025
Merged

Added prompting for tenant to azure config experiences#12172
davidfowl merged 8 commits intomainfrom
davidfowl/select-tenant

Conversation

@davidfowl
Copy link
Member

@davidfowl davidfowl commented Oct 19, 2025

Description

When we create a provisioning context, we gather the subscription id using the default tenant based on the azure credential. This is problematic when users want to switch between work and personal accounts so ask the user which one they want to use and store that along with sub, location and rg.

Contributes to #10364

Fixes #9782
Fixes #3544
Fixes #4872

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?
    • No
  • Does the change make any security assumptions or guarantees?
    • No
  • Does the change require an update in our Aspire docs?

- When we create a provisioning context, we gather the subscription id using the default tenant based on the azure credential. This is problematic when users want to switch between work and personal accounts so ask the user which one they want to use and store that along with sub, location and rg.
Copilot AI review requested due to automatic review settings October 19, 2025 05:43
@github-actions
Copy link
Contributor

github-actions bot commented Oct 19, 2025

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 12172

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 12172"

Copy link
Contributor

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 adds support for tenant selection in Azure provisioning workflows, enabling users to switch between work and personal accounts. The tenant ID is now prompted alongside subscription ID and stored in the provisioning configuration.

Key Changes

  • Added tenant ID prompting and storage in Azure provisioning workflows
  • Modified credential providers to support multi-tenant authentication
  • Updated localization resources to include tenant-related UI strings

Reviewed Changes

Copilot reviewed 23 out of 24 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
AzureProvisionerOptions.cs Added TenantId property to store selected tenant
IProvisioningServices.cs Added tenant-related methods to IArmClient interface
DefaultArmClientProvider.cs Implemented tenant retrieval and subscription filtering by tenant
DefaultTokenCredentialProvider.cs Enabled multi-tenant authentication for all credential types
BaseProvisioningContextProvider.cs Added tenant fetching logic and subscription filtering by tenant
RunModeProvisioningContextProvider.cs Integrated tenant selection into interactive provisioning flow
PublishModeProvisioningContextProvider.cs Added tenant prompting for publish mode
AzureProvisioningStrings.resx Added tenant-related localized strings
Multiple xlf files Added untranslated tenant strings marked as "new"
ProvisioningTestHelpers.cs Extended test mocks to support tenant operations
DefaultTokenCredentialProviderTests.cs Updated tests to reflect removal of execution context dependency
Files not reviewed (1)
  • src/Aspire.Hosting.Azure/Resources/AzureProvisioningStrings.Designer.cs: Language not supported

Copy link
Member

@mitchdenny mitchdenny left a comment

Choose a reason for hiding this comment

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

Looks good to me. Validated on CLI and in the dashboard. Noted that there is usability issue with prompts that allow selections and custom choices. Need to fine tune the combobox-like behaviors here.

@davidfowl
Copy link
Member Author

cc @JamesNK

@davidfowl davidfowl merged commit 7f30741 into main Oct 20, 2025
594 of 597 checks passed
@dotnet-policy-service dotnet-policy-service bot added this to the 13.0 milestone Oct 20, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Nov 19, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

3 participants