Monday 10 October 2016

Powershell Azure - when you have multiple "directories"/ tenants.

Documentation didn't really cover this too well but when I tried to use powerhell to move items between subscriptions I kept getting an invalid subscription id.  I eventually deduced it was because I have two directories/tenants and was in the wrong one.

List subscriptions using

Get-AzureRmSubscription

then select one in the right tenant making sure you specify the TenantID too.

Select-AzureRmSubscription -SubscriptionId xxxxx -TenantId yyyyy
Basically it seems if you've multiple "Directories" / tenants you have to specify the tenant id.

Once you've done that, moving subscriptions etc. works for that Tenant.

No comments:

Post a Comment