Select a subscription to target (or account or tenant) in Azure PowerShell cmdlets. After this cmdlet, future cmdlets will target the
selected context.
Examples
Example 1: Target a named context
Select-AzContext "Work"
Name Account SubscriptionName Environment TenantId
---- ------- ---------------- ----------- --------
Work test@outlook.com Subscription1 AzureCloud xxxxxxxx-x...
Target future Azure PowerShell cmdlets at the account, tenant, and subscription in the 'Work' context.
Example 2
Select a subscription and account to target in Azure PowerShell cmdlets in this powershell session. (autogenerated)
Select-AzContext -Name TestEnvironment -Scope Process
Parameters
-Confirm
Prompts you for confirmation before running the cmdlet.
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
-InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable,
-ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see
about_CommonParameters.
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.