In Azure powershell Select-AzureSubscription command fetching error: the subscription name doesn't exist

0 votes

I have installed the latest version of PowerShell and was able to login to it with my Azure account and ran Get-AzureRmSubscription to see all my subscriptions listed. 

But, when i tried to run Select-AzureSubscription and then entered the subscription name when prompted, with no quotes, single quotes, and double quotes, I haven't been able to get this to work.

I keep getting an error saying something like "The subscription name 'XXXX' doesn't exist".

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

Can anyone tell me where am I going wrong?

May 23, 2018 in Azure by cloudie_crank
• 1,610 points
1,098 views

2 answers to this question.

0 votes

In case you are using Azure Resource Manager, the proper cmdlet is:

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

or just use -SubscriptionId instead of -SubscriptionName

Select-AzureSubscription is to be used to manage classic resources. To make it work you also have to add classic credentials using:

Add-AzureAccount
answered May 23, 2018 by null_void
• 3,220 points
0 votes

The problem you're having is that the 'default' parameter is depreciated.

if you run

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

You get -

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

If you just run

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

You should get the result you're looking for.

answered Aug 16, 2018 by Priyaj
• 56,160 points

Related Questions In Azure

0 votes
2 answers

How can I view the deployed files in Azure?

In Visual Studio, in the window "Server ...READ MORE

answered Aug 21, 2018 in Azure by Priyaj
• 56,160 points
188 views
+1 vote
10 answers

How can the NuGet packages be used in Azure Functions?

Yes! Although the Azure Functions portal does ...READ MORE

answered Jun 8, 2018 in Azure by club_seesharp
• 3,450 points
3,702 views
0 votes
1 answer

How to get the list of names of Azure blob files in a container?

We can get some additional info like Size, ...READ MORE

answered Jun 27, 2018 in Azure by club_seesharp
• 3,450 points
484 views
0 votes
1 answer

Error: The subscription is not registered to use namespace 'Microsoft.DataFactory

In Azure, for each functionality there's a ...READ MORE

answered Aug 24, 2018 in Azure by null_void
• 3,220 points
45 views
0 votes
1 answer

error: The internal target platform type SqlAzureV12DatabaseSchemaProvider doesn't support schema file version '3.3'

Fix: To resolve, use the latest SSMS Preview (docs.microsoft.com/en-us/sql/ssms/download-sql-server-management-studio-ssms?view=sql-server-2017) ...READ MORE

answered Sep 24, 2018 in Azure by club_seesharp
• 3,450 points

edited Sep 24, 2018 by club_seesharp 31 views
0 votes
1 answer

How to check if multiple files exist in Azure container?

foreach loop is the most efficient way though. ...READ MORE

answered Mar 4 in Azure by Prerna
• 1,940 points
48 views
0 votes
1 answer

How to calculate the used database space in SQL Azure?

I don't think its possible to find ...READ MORE

answered Mar 5 in Azure by Archana
• 5,480 points
20 views
0 votes
1 answer
0 votes
1 answer

How to determine the number of messages in an Azure Services Bus Queue?

You will get error when you try ...READ MORE

answered Jun 12, 2018 in Azure by null_void
• 3,220 points
95 views
0 votes
1 answer

Error: Install-Module : The term 'Install-Module' is not recognized as the name of a cmdlet

Since you are using the lower version ...READ MORE

answered Jun 20, 2018 in Azure by null_void
• 3,220 points
1,176 views