升级公共 IP 地址Upgrade public IP addresses

Azure 公共 IP 地址是采用某个 SKU 创建的,该 SKU 可以是基本的,也可以是标准的,它决定了公共 IP 地址的功能的各个方面(包括分配方法、跨可用性区域的使用以及它们可以与哪些资源关联)。Azure public IP addresses are created with a SKU--either Basic or Standard--which determines aspects of their functionality (including allocation method, usage across availability zones, and which resources they can be associated with).

本文介绍了以下方案:The following scenarios are reviewed in this article:

  • 如何将基本 SKU 公共 IP 升级到标准 SKU 公共 IP(使用门户、PowerShell 或 CLI)How to upgrade a Basic SKU public IP to a Standard SKU public IP (using Portal, PowerShell, or CLI)
  • 如何将经典 Azure 保留 IP 迁移到 Azure 资源管理器基本 SKU 公共 IPHow to migrate a Classic Azure Reserved IP to an Azure Resource Manager Basic SKU public IP

将公共 IP 地址从基本 SKU 升级到标准 SKUUpgrade public IP address from Basic to Standard SKU

若要升级公共 IP,则它不得与任何资源相关联(有关如何将公共 IP 解除关联的详细信息,请查看此页)。In order to upgrade a public IP, it must not be associated with any resource (see this page for more information about how to disassociate public IPs).


下面的示例假设之前创建了一个基本 SKU 公共 IP,具体而言,是使用此页上提供的示例在“myResourceGroup”中创建了一个基本公共 IP“myBasicPublicIP”。The following example assumes previous creation of a Basic SKU public IP, using the example given on this page with a Basic public IP myBasicPublicIP in myResourceGroup.

若要升级 IP,只需使用 PowerShell 执行以下命令即可。In order to upgrade the IP, simply execute the commands below using PowerShell. 注意,如果已静态分配了 IP 地址,则可以跳过该部分。Note if the IP address is already statically allocated, that section can be skipped.

## Variables for the command ##
$rg = 'myResourceGroup'
$name = 'myBasicPublicIP'
$newsku = 'Standard'
$pubIP = Get-AzPublicIpAddress -name $name -ResourceGroupName $rg

## This section is only needed if the Basic IP is not already set to Static ##
$pubIP.PublicIpAllocationMethod = 'Static'
Set-AzPublicIpAddress -PublicIpAddress $pubIP

## This section is for conversion to Standard ##
$pubIP.Sku.Name = $newsku
Set-AzPublicIpAddress -PublicIpAddress $pubIP

将经典保留 IP 升级(迁移)到静态公共 IPUpgrade (migrate) a classic Reserved IP to a static public IP

若要利用 Azure 资源管理器中的新功能,可以将现有的公共静态 IP 地址(称为保留 IP)从经典模型迁移到新式 Azure 资源管理器模型。To benefit from the new capabilities in Azure Resource Manager, you can migrate existing public static IP address--called Reserved IPs--from the Classic model to the modern Azure Resource Manager model. 迁移的公共 IP 将是基本 SKU 类型。The migrated public IP will be a Basic SKU type.


下面的示例假设之前在 myResourceGroup 中创建了一个经典 Azure 保留 IP“myReservedIP”。 The following example assumes previous creation of a classic Azure Reserved IP myReservedIP in myResourceGroup. 进行迁移的另一个先决条件是确保 Azure 资源管理器订阅已针对迁移进行了注册。Another prerequisite for migration is to ensure the Azure Resource Manager subscription has registered for migration. 此页上的步骤 3 和 4 详细介绍了这一点。This is covered in detail on Steps 3 and 4 of this page.

若要迁移保留 IP,请使用 PowerShell 执行以下命令。In order to migrate the Reserved IP, execute the commands below using PowerShell. 注意,如果 IP 地址没有与任何服务(下面有一个名为“myService”的服务)相关联,则可以跳过该步骤。Note if the IP address is not associated with any service (below there is a service named myService), that step can be skipped.

## Variables for the command ##
$name = 'myReservedIP'

## This section is only needed if the Reserved IP is not already disassociated from any Cloud Services ##
$serviceName = 'myService'
Remove-AzureReservedIPAssociation -ReservedIPName $name -ServiceName $service

$validate = Move-AzureReservedIP -ReservedIPName $name -Validate
$validate.ValidationMessages

上一命令显示任何阻止迁移的警告和错误。The previous command displays any warnings and errors that block migration. 如果验证成功,则可继续执行以下步骤来准备并提交迁移:If validation is successful, you can proceed with the following steps to Prepare and Commit the migration:

Move-AzureReservedIP -ReservedIPName $name -Prepare
Move-AzureReservedIP -ReservedIPName $name -Commit

将使用迁移的保留 IP 的名称在 Azure 资源管理器中创建一个新资源组(在上面的示例中,它将是资源组“myReservedIP-Migrated”)。A new resource group in Azure Resource Manager is created using the name of the migrated Reserved IP (in the example above, it would be resource group myReservedIP-Migrated).

限制Limitations

  • 若要升级基本的公共 IP,则它不能与任何 Azure 资源相关联。In order to upgrade a Basic Public IP, it cannot be associated with any Azure resource. 请查看此页来详细了解如何将公共 IP 解除关联。Please review this page for more information on how to disassociate public IPs. 类似地,若要迁移保留 IP,则它不能与任何云服务相关联。Similarly, in order to migrate a Reserved IP, it cannot be associated with any Cloud Service. 请查看此页来详细了解如何将保留 IP 解除关联。Please review this page for more information on how to disassociate reserved IPs.

  • 无法从标准 SKU 降级到基本 SKU。You cannot downgrade from Standard to Basic.

后续步骤Next Steps