Azure的PowerShell中选择,AzureSubscription - 错误:预订名称不存在 [英] Azure powershell Select-AzureSubscription - error: the subscription name doesn't exist

查看:503
本文介绍了Azure的PowerShell中选择,AzureSubscription - 错误:预订名称不存在的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚安装了最新的PowerShell 1.1和我跟随此博客条目​​反向DNS添加到我正在运行的现有Linux虚拟机

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

<一个href=\"https://azure.microsoft.com/en-us/blog/announcing-reverse-dns-for-azure-cloud-services/\">https://azure.microsoft.com/en-us/blog/announcing-reverse-dns-for-azure-cloud-services/

我能够登录并运行Get-AzureRmSubscription看到我的订阅:

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

如果我尝试运行Set-AzureService命令,错误信息告诉我,我需要设置一个默认的订阅

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

我试过

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"

我甚至尝试了运行选择-AzureSubscription然后在提示时输入订阅名称,不带引号,单引号和双引号,并没有能够得到这个工作。

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.

我不断收到一个错误说类似预订名称Visual Studio企业与MSDN不存在。

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

我也尝试使用选择-AzureSubscription -SubscriptionID与上市认购的ID这样做,有类似的结果。

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

我在做什么错了?

推荐答案

如果您使用的是资源管理器,正确的cmdlet的是:

If you are using Resource Manager, the correct cmdlet is:

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

或只使用-SubscriptionId代替-SubscriptionName的。

or just use -SubscriptionId instead of -SubscriptionName.

选择-AzureSubscription是用于管理经典资源。为了使它工作,你还必须添加使用经典的凭据:

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

Add-AzureAccount

这篇关于Azure的PowerShell中选择,AzureSubscription - 错误:预订名称不存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆