代码之家  ›  专栏  ›  技术社区  ›  Ramon de Klein

如何将Azure保留IP(经典)迁移到Azure公共IP(ARM)?

  •  6
  • Ramon de Klein  · 技术社区  · 7 年前

    当将Azure中的服务从经典模型迁移到Azure资源管理器(ARM)时,您的经典模型中可能有一些保留的IP地址。保留IP的ARM对应物是公共IP。创建新的公共IP将导致另一个IP地址,并可能导致已将您的IP地址列入白名单的客户端出现问题。

    3 回复  |  直到 7 年前
        1
  •  10
  •   Ramon de Klein    7 年前

    本主题的实际学分为Vatsana Kongtakane在本 log entry .我已经修改了这些项目,因为我认为大多数人都已经有了保留的IP。我把它放在StackOverflow上的原因是为了防止信息丢失。

    # Login to your ARM account
    Add-AzureRmAccount
    
    # Get a list of available subscriptions
    Get-AzureRMSubscription
    
    # Select your subscription
    Select-AzureRmSubscription -SubscriptionName <SubscriptionName>
    
    # Register migration provider, this can take a couple minuites
    Register-AzureRmResourceProvider -ProviderNamespace Microsoft.ClassicInfrastructureMigrate
    
    # View the current RegistrationState status, do not proceed to step 2 until the status says Registered
    Get-AzureRmResourceProvider -ProviderNamespace Microsoft.ClassicInfrastructureMigrate
    

    第2步登录到您的经典帐户

    # Login to your ASM account
    Add-AzureAccount
    
    # Get a list of available subscriptions
    Get-AzureSubscription
    
    # Select your subscription
    Select-AzureSubscription –SubscriptionName <SubscriptionName>
    

    # Show the list of all reserved IP addresses
    Get-AzureReservedIP
    
    # De-associate the reserved IP address from your cloud service
    # (only necessary if the IP is still assigned to a service)
    Remove-AzureReservedIPAssociation -ReservedIPName <ReservedIPName> -ServiceName <ServiceName>
    
    # Check for issues during migration
    Move-AzureReservedIP -ReservedIPName <ReservedIPName> -Validate
    
    # Prepare the ReservedIP for migration
    Move-AzureReservedIP -ReservedIPName <ReservedIPName> -Prepare
    
    # Commit to migrating the ReservedIP (take a pretty long time)
    Move-AzureReservedIP -ReservedIPName <ReservedIPName> -Commit
    

    portal.azure.com ,您应该可以看到具有正确IP地址的公共IP地址下的资源。它正在被转移到新的资源组,但您可以将其移动到您喜欢的资源组。

        2
  •  0
  •   Ken    4 年前

    我无法在Azure门户的云Shell中使用旧的ASM PowerShell命令。下面介绍了如何使用Azure CLI将经典保留IP迁移到公共IP。

    azure account set <subscriptionNameOrId>
    azure provider register Microsoft.ClassicInfrastructureMigrate
    azure provider show Microsoft.ClassicInfrastructureMigrate
    azure config mode asm
    azure network reserved-ip list
    azure network reserved-ip disassociate <name> <service-name> <deployment-name>
    azure network reserved-ip list
    azure network reserved-ip validate-migration <name>
    azure network reserved-ip prepare-migration <name>
    azure network reserved-ip commit-migration <name>
    
        3
  •  0
  •   Prafulbusa    4 年前

    安装模块Azure-AllowClobber #{关闭powershell并重新打开}

    {保留经典IP}

    https://docs.microsoft.com/en-us/previous-versions/azure/virtual-network/virtual-networks-reserved-public-ip#reserve-the-ip-address-of-an-existing-cloud-service

    新AzureReservedIP ReservedIPName MyReservedIP位置“ 美国中部 “-服务名称 布萨

    ### 服务名称=busa ##==>DNS名称:- .cloudapp.net