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

Select-AzSubscription is alias of Set-AzContext cmdlet #10848

Closed
ram-msft opened this issue Jan 7, 2020 · 5 comments
Closed

Select-AzSubscription is alias of Set-AzContext cmdlet #10848

ram-msft opened this issue Jan 7, 2020 · 5 comments
Assignees
Labels
Azure PS Team feature-request This issue requires a new behavior in the product in order be resolved. needs-triage This is a new issue that needs to be triaged to the appropriate team.

Comments

@ram-msft
Copy link

ram-msft commented Jan 7, 2020

Set-AzContext cmdlet documnet to update about the Select-AzSubscription.
https://docs.microsoft.com/en-us/powershell/module/az.accounts/set-azcontext?view=azps-3.2.0

Obsolete the following Select-AzureSubscription document.
https://docs.microsoft.com/en-us/powershell/module/servicemanagement/azure/select-azuresubscription?view=azuresmps-4.0.0

Proposed implementation details (optional)

@ram-msft ram-msft added Azure PS Team feature-request This issue requires a new behavior in the product in order be resolved. triage labels Jan 7, 2020
@ram-msft ram-msft changed the title Select-AzSubscription is alias of Set-AzContext cmdlet Document updation of Select-AzSubscription is alias of Set-AzContext cmdlet Jan 7, 2020
@ram-msft ram-msft changed the title Document updation of Select-AzSubscription is alias of Set-AzContext cmdlet Select-AzSubscription is alias of Set-AzContext cmdlet Jan 7, 2020
@dcaro
Copy link
Contributor

dcaro commented Jan 9, 2020

@ram-msft thanks for opening the issue, the Select-AzureSubscription is a cmdlet of the old Azure service management model.
The notion of context is richer than simply the subscription, the following article has more details about context: https://docs.microsoft.com/en-us/powershell/azure/context-persistence

Let me know if this helps.

@ram-msft
Copy link
Author

ram-msft commented Jan 9, 2020

@dcaro Thanks for your information. This helps, but can you please share your thoughts on Set-AzContext cmdlet documnet to update about the Select-AzSubscription.
https://docs.microsoft.com/en-us/powershell/module/az.accounts/set-azcontext?view=azps-3.2.0

@lilyjma lilyjma added needs-triage This is a new issue that needs to be triaged to the appropriate team. and removed triage labels May 1, 2020
@dcaro
Copy link
Contributor

dcaro commented Jun 25, 2020

@ram-msft you can have as many contexts as you like against the same subscription.

For example you can have a context for your user account connected to subscription A and another context for a service principal connected to subscription A and a context for your user account connected to subscription B. The context also has a reference to the token cache used to access the corresponding cloud making the context very useful when you need to use multiple environments, not just subscriptions.

Select-AzContext will make the selected context the default locally and the documentation on context provides more details on this (https://docs.microsoft.com/en-us/powershell/azure/context-persistence).

@ohadschn
Copy link
Contributor

ohadschn commented Jul 6, 2021

@dcaro Ideally the docs would mention the fact that Select-AzSubscription is an alias in the Set-AzContext docs: https://docs.microsoft.com/en-us/powershell/module/az.accounts/set-azcontext?view=azps-6.1.0&viewFallbackFrom=azps-3.2.0

@dcaro
Copy link
Contributor

dcaro commented Jul 20, 2021

We have a feature request open to the docs team to expose the aliases in our reference documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Azure PS Team feature-request This issue requires a new behavior in the product in order be resolved. needs-triage This is a new issue that needs to be triaged to the appropriate team.
Projects
None yet
Development

No branches or pull requests

4 participants