Added prompting for tenant to azure config experiences#12172
Conversation
- 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.
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 12172Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 12172" |
There was a problem hiding this comment.
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
src/Aspire.Hosting.Azure/Provisioning/Internal/RunModeProvisioningContextProvider.cs
Outdated
Show resolved
Hide resolved
src/Aspire.Hosting.Azure/Provisioning/Internal/PublishModeProvisioningContextProvider.cs
Show resolved
Hide resolved
…perator; add test to skip tenant prompt when subscription ID is provided
…when subscription ID is not set
mitchdenny
left a comment
There was a problem hiding this comment.
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.
|
cc @JamesNK |
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
doc-ideatemplatebreaking-changetemplatediagnostictemplate