In my previous post you got intro to getting started with Power Shell 1.0 and Azure Resource Manager (ARM)
In this post I hope to inspire you to continue with it.
Authenticate with Multiple Tenants!
The Solution is: Login-AzureRmAccount -SubscriptionId “subscription you want to manage”
Before PowerShell 1.0 i mostly used Add-AzureAccount to authenticate and get access to Tenants and Subscriptions where my account was Admin or Co-Admin.
Now I use Login-AzureRmAccount or Add-AzureRmAccount.
The issue with this is that I get authorized to where my account is defaulted, running Get-AzureRmSubscription tells me I only can manage 2 Subscriptions in 1 Tenant.
I took me embarrassingly long to figure out… but after a while I resorted to the help files. Help Login-AzureRmAccount -full
It tells me that by default a user is authenticated against all subscriptions by default, but the Get-AzureRmSubscription does not show the subscriptions I wanted to manage. (I even found misspelling, se the arrows in the picture)
At the end of the help file you have the information that you can Select Tenant and Subscription
But Add-AzureRmAccount –TenantId gave this error
Intellisens pointed me to Add-AzureRmAccount –Tenant
This is how I now start the day with ARM
- Start PowerShell ISE
- Copy the SubscriptionId
- Login-AzureRmAccount –SubscriptionId “paste in the copied SubscriptionId”
Now I will continue with some templating using PowerShell with Azure Resource Manager