Reputation: 5706
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?
Upvotes: 6
Views: 5145
Reputation: 1
Install-Module Azure
Install-Module Azure -AllowClobber #{Close the powershell and reopen}
Import-Module Azure
{Reserve classic IP}
New-AzureReservedIP –ReservedIPName MyReservedIP –Location "Central US" -ServiceName busa
###Serice name = busa ## ==> DNS Name:- Busa.cloudapp.net
Upvotes: 0
Reputation: 1
I couldn't get the old ASM PowerShell commands to work in the Azure Portal's Cloud Shell. Here's how you can migrate a classic Reserved IP to Public IP using the Azure CLI.
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>
Upvotes: 0
Reputation: 5706
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.
Upvotes: 11