Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

utils: Add an option to automatically select an AzureSubscription by subscriptionId #1648

Merged
merged 4 commits into from
Dec 20, 2023

Conversation

MicroFish91
Copy link
Contributor

@MicroFish91 MicroFish91 commented Dec 18, 2023

Would like to eventually use here: microsoft/vscode-azurecontainerapps#578

Wanted to add the ability to pass an option to subscriptionExperience to automatically select by subscriptionId without having to re-prompt the user.

Example:

const subscription: AzureSubscription = await subscriptionExperience(context, ext.rgApiV2.resources.azureResourceTreeDataProvider, {
        selectSubscriptionById: '<insert subscriptionId>'
});

@MicroFish91 MicroFish91 marked this pull request as ready for review December 19, 2023 00:58
@MicroFish91 MicroFish91 requested a review from a team as a code owner December 19, 2023 00:58
@MicroFish91 MicroFish91 force-pushed the mwf/select-subscription-by-id branch from c51b570 to 6726afb Compare December 19, 2023 04:44
@@ -30,6 +34,14 @@ export class QuickPickAzureSubscriptionStep extends GenericQuickPickStepWithComm

return pickedSubscription;
}

protected override getPickWithoutPrompt(picks: IAzureQuickPickItem<SubscriptionItem>[]): IAzureQuickPickItem<SubscriptionItem> | undefined {
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of this implementation I'd try to do a skip-if-one step with pick filters that select only the chosen subscription.

@MicroFish91 MicroFish91 force-pushed the mwf/select-subscription-by-id branch from 1697bb1 to 6726afb Compare December 20, 2023 08:07
@MicroFish91 MicroFish91 merged commit d0f26fc into main Dec 20, 2023
4 checks passed
@MicroFish91 MicroFish91 deleted the mwf/select-subscription-by-id branch December 20, 2023 17:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants