Select Page

A quick one – taking your available Azure profiles, enumerating them and then connecting you.

Using the new and improved Azure PowerShell cmdlets, connecting to your Azure subscriptions is even easier than before.

This script assumes you have locally installed your XML config and certificate for Azure access.


$azuresubs = Get-AzureSubscription
Write-Host "Subscriptions available:" ; Write-Host
ForEach ($azuresub in $azuresubs) {

$azureconnect = Read-Host "Which subscription?"

Try {
Select-AzureSubscription -SubscriptionName $azureconnect -erroraction STOP
Catch {
Write-Host "ERROR: An error was thrown connecting to $azureconnect" -ForegroundColor Red

Write-Host ; Write-Host "Connected to:"
Get-AzureSubscription -SubscriptionName $azureconnect