Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I migrate an Azure Reserved IP (classic) to an Azure Public IP (ARM)?

When migrating services in Azure from the Classic Model to the Azure Resource Manager (ARM) you might have some reserved IP addresses in your classic model. The ARM counterpart of the reserved IP is the public IP. Creating a new public IP will result in another IP address and might cause issues with clients that have whitelisted your IP address.

Although it's best to use whitelisting based on the FQDN. However, it is sometimes not possible and IP whitelisting is the next-best alternative. How do you migrate from a reserved IP address to a public IP address, without getting a new IP address?

like image 398
Ramon de Klein Avatar asked Jul 19 '17 12:07

Ramon de Klein


People also ask

How do I migrate from classic Azure to arm?

Classic Azure Virtual Network Classic Azure Reserved IP (Azure Public IP) Each classic Resource (except Cloud Services) has a new option in the blade called Migrate to ARM. Using this option you can migrate them into ARM.

How to migrate a VM IP to arm?

If you can convert the IP to a Reserved IP Address, you can migrate the VM and IP Address to ARM, then switch the Public IPs. There will be a small downtime associated with the switch, typically no more than a minute. If the IP Address is an Instance Level Public IP, there is no way to migrate the IP Address.

What IP addresses are available for migration from classic to arm?

Only Reserved IP Addresses are available for migration from classic to ARM. You can take an existing cloud service IP Address and make it reserved using Azure PowerShell. I assume that you have gotten this far, as you speak about the limit with Cloud Services.

How do I import Azure firewall rules into a new policy?

As part of creating a new firewall policy, on the rule tab, you can import your Azure Firewall rules. This means you can capture your existing configuration, work on any changes in advance, then simply attach your newly updated policy


1 Answers

The actual credits for this topic are for Vatsana Kongtakane in this log entry. I have adapted the items, because I think most people will already have a reserved IP. The reason I put it on StackOverflow is to prevent the information from being lost.

Step 1 – Login and prepare your ARM environment

# 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

Step 2 – Login to your classic account

# Login to your ASM account
Add-AzureAccount

# Get a list of available subscriptions
Get-AzureSubscription

# Select your subscription
Select-AzureSubscription –SubscriptionName <SubscriptionName>

Step 3 – Migrate your reserved IP address

# 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

Step 4 – Verify & Cleanup

At this point if you login to portal.azure.com, you should see the resource under Public IP Address with the correct IP address. It is being transferred to a new resource group, but you can move it to the resource group that you like.

like image 131
Ramon de Klein Avatar answered Nov 15 '22 09:11

Ramon de Klein