Microsoft: How to set Azure PowerShell to a specific Azure Subscription
If you have multiple Azure Subscriptons, when you login you get a default subscription set, so if you try and take any actions on a feature in another subscription you would get a ‘NotFound’ like error. So you need to set the correct subscription.
The old (ASM) way of doing that was to use the publishSettings file which you can download from here, most likly using the Get-AzurePublishSettings cmdlet. Then you would import that file using the Import-AzurePublishSettingsFile and lastly run the Set-AzureSubscription. However, there is a new way which is more focused on ARM.
I wrote some other articles about using Azure PowerShell listed below:
To set the Subscription in PowerShell so you can run cmdlets against those features, perform the following:
- Login via PowerShell
- Set the current subscription context
Once you complete the above, you will have set the current azure subscription context
Read the entire article here, How to set Azure PowerShell to a specific Azure Subscription – benjamin perkins
via the fine folks at Microsoft