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

后端 未结 3 632
醉梦人生
醉梦人生 2020-12-29 01:32

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.

相关标签:
3条回答
  • 2020-12-29 01:57

    If you are using Resource Manager, the correct 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
    
    0 讨论(0)
  • 2020-12-29 02:08
    • Connect-AzureRmAccount then login to Azure as normal
    • Run the command cmdlet Get-AzureRmSubscription –SubscriptionName "<name>" | Select-AzureRmSubscription (see answer by @Bruno Faria)
    0 讨论(0)
  • 2020-12-29 02:13

    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.

    0 讨论(0)
提交回复
热议问题