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
7,017 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.

Hope it helped!

If you need to know more about Azure, then you should join Azure training course online today.

Thank you!!

answered Aug 16, 2018 by Priyaj
• 58,090 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
• 58,090 points
4,455 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
16,204 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
21,000 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
1,338 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 959 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, 2019 in Azure by Prerna
• 1,960 points
3,398 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, 2019 in Azure by Archana
• 5,640 points
929 views
0 votes
1 answer

Azure: Getting error in loading 'Microsoft.TeamFoundation.WorkItemTracking.Client.Cache'

The error is occurring because you are trying ...READ MORE

answered Mar 26, 2019 in Azure by Prerna
• 1,960 points
747 views
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
4,183 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
3,654 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP