Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
+1 vote
2 views
in Azure by (12.7k points)
edited by

I've just installed the latest PowerShell 1.1 and am following this blog entry to add reverse DNS to an existing Linux VM that I am running

https://azure.microsoft.com/en-us/blog/announcing-reverse-dns-for-azure-cloud-services/

I was able to log in and run Get-AzureRmSubscription to see my subscriptions:

SubscriptionName : Visual Studio Premium with MSDN

SubscriptionId   : XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX

TenantId         : XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX

SubscriptionName : Visual Studio Enterprise with MSDN

SubscriptionId   : XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX

TenantId         : XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX

If I try to run the Set-AzureService command, an error message tells me I need to set a default subscription

I've tried

Select-AzureSubscription -Default 'Visual Studio Enterprise with MSDN'

Select-AzureSubscription -Default "Visual Studio Enterprise with MSDN"

Select-AzureSubscription -Default 'Visual Studio Premium with MSDN'

Select-AzureSubscription -Default "Visual Studio Premium with MSDN"

I've even tried just running Select-AzureSubscription and then entering the subscription name when prompted, with no quotes, single quotes, and double quotes, and haven't been able to get this to work.

I keep getting an error saying something like "The subscription name 'Visual Studio Enterprise with MSDN' doesn't exist".

I've also tried doing this using "Select-AzureSubscription -SubscriptionID" with the subscription IDs listed, with similar results.

What am I doing wrong?

2 Answers

0 votes
by (9.6k points)

In Resource Manager, check this :

Get-AzureRmSubscription -SubscriptionName "<name>" | Select-AzureRmSubscription

You also have to add classic credentials. You can use this:

Add-AzureAccount

0 votes
by (106k points)

The problem here is that the 'default' parameter is depreciated.

If you run the below-mentioned command

Select-AzureSubscription -SubscriptionName "Visual Studio Premium with MSDN” -Default "Visual Studio Premium with MSDN"

After running the above command you will get -

WARNING: Current and Default parameters have been deprecated. Select-AzureSubscription will always update the Default Subscription

To get the result you can run the below-mentioned command:-

Select-AzureSubscription -SubscriptionName "Visual Studio Premium with MSDN" 

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...