Skip to content

Add optional default subscription if user needs to reconnect via Connect-AzAccount - #263

Merged
Michael Smith (Exolun) merged 4 commits into
microsoft:developfrom
Exolun:user/mismit/default_subscription_onlogin
Aug 1, 2024
Merged

Add optional default subscription if user needs to reconnect via Connect-AzAccount#263
Michael Smith (Exolun) merged 4 commits into
microsoft:developfrom
Exolun:user/mismit/default_subscription_onlogin

Conversation

@Exolun

Copy link
Copy Markdown
Contributor

One of our users indicated that if the module requires a reauthentication to Azure, it was frustrating because it was erroring but not correctly providing the auth challenge, so he had to use az login manually to reauthenticate and select his subscription ID.

There are still problems with this insofar as even if we fix the cmdlet to correctly prompt the user with the login challenge, pipeline scripts won't support interactive resolution. So instead I thought we should add an optional default subscription ID so that when we reauthenticate it will not require a prompt asking the user to select one.

Doing a little testing tomorrow to validate this is the desired flow.

@jwittner Josh Wittner (jwittner) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks like a good feature, just some small changes requested.

Comment thread UnitySetup/UnitySetup.psm1 Outdated
Comment thread UnitySetup/UnitySetup.psm1 Outdated
Comment thread UnitySetup/UnitySetup.psm1 Outdated
+ Add validation of sub ID at entry point
+ Update check to just a string check in New-PAT instead of PSBoundParameters
Comment thread UnitySetup/UnitySetup.psm1 Outdated
Comment thread UnitySetup/UnitySetup.psm1 Outdated

@jwittner Josh Wittner (jwittner) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Left a note about splatting, but not a 'required' change, just something to improve here and to keep in mind (I think it'd be useful in the call to the function where I mention splatting as well).

@Exolun
Michael Smith (Exolun) merged commit 41b3df3 into microsoft:develop Aug 1, 2024
@Exolun
Michael Smith (Exolun) deleted the user/mismit/default_subscription_onlogin branch August 1, 2024 22:00
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