【问题标题】:How to reserve a static IP for Azure Virtual Machines?如何为 Azure 虚拟机保留静态 IP?
【发布时间】:2015-07-31 03:34:42
【问题描述】:

亚马逊有弹性 IP,您可以将其分配给实例,

如何使用 Azure 为现有 VM 做到这一点?

(如果 IP 更改,我不想更改所有 DNS 条目)

我发现了一些关于运行 power shell 命令的文章 1.http://michaelwasham.com/windows-azure-powershell-reference-guide/using-reserved-ip-addresses-with-microsoft-azure-virtual-machines/ 2.http://azure.microsoft.com/blog/2014/05/14/reserved-ip-addresses/ 3.http://azure.microsoft.com/blog/2014/04/22/static-internal-ip-address-for-virtual-machines/

但是我的服务器上无法识别这些命令(Windows server 2012 R2)

知道我该怎么做吗?

这是我在 Power Shell 上遇到的错误:

PS C:\> New-AzureReservedIP – ReservedIPName "137.117.11.18" –Label "people-dns-ip" –Location "US West"
New-AzureReservedIP : The term 'New-AzureReservedIP' is not recognized as the name of a cmdlet, function, script file,
or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and
try again.
At line:1 char:1
+ New-AzureReservedIP – ReservedIPName "137.117.11.18" –Label "people-dns-ip" –Loc ...
+ ~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (New-AzureReservedIP:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

【问题讨论】:

    标签: powershell azure


    【解决方案1】:

    听起来您缺少 PowerShell 所需的 CMD。请下载 Microsoft Webinstaller:

    Download Microsoft Web-Installer

    并全新安装 Microsoft PowerShell。在此之后,您应该能够使用“New-AzureReservedIP”命令。也许您正在运行没有此 CMDlet 的旧版本的 PowerShell。

    有关安装 PowerShell 的详细信息,请参阅:Configure and Install PowerShell (Azure)

    【讨论】:

    • 谢谢,现在我收到一个新错误 - New-AzureReservedIP:未指定默认订阅。使用 Select-AzureSubscription -Default 设置默认订阅。我找不到正确的订阅名称(在我的 Azure 门户上显示为“BizSpark”...)
    • 使用 Get-AzureSubscription 查看名称正确的列表。
    猜你喜欢
    • 1970-01-01
    • 2018-12-30
    • 2016-08-05
    • 2020-03-07
    • 2020-11-02
    • 1970-01-01
    • 2020-01-28
    • 1970-01-01
    • 2012-08-04
    相关资源
    最近更新 更多