Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to forcing Powershell to use new Azure Subscription

I have two subscription one with old cloud service and other is with new cloud service. I am using Powershell to access my new subscription. I have downloaded latest .publishsettings and set it using Import-AzurePublishSettingsFile. My problem is that I always get the old subscription set and could not figureout how to force powershell to use my new subscription.

like image 619
user1522002 Avatar asked Jul 19 '12 03:07

user1522002


1 Answers

Just to clarify, there are two kinds of 'special' subscriptions, the 'current' subscription (which is the subscription used for any command in the current PowerShell session), and the Defaul subscription, which is the subscription used even after the current PowerShell session ends.

using Select-AzureSubscription <subscription-name> will set the current subscription. If you'd like to change the subscription across sessions, use Select-AzureSubscription -Default <subscription name>

like image 131
Mark Cowlishaw - MSFT Avatar answered Oct 06 '22 21:10

Mark Cowlishaw - MSFT