New (Standard) VMs and Dynamic, Public IPs

SBD 20 Reputation points
2023-09-29T06:41:08.2533333+00:00

As the Oct. 10th deadline for Classic VMs is approaching, I am working to migrate my Classic VMs to new VMs. Instead of trying to do a migration, I opted for just creating new VMs with roughly the same configuration. However, I'm bumping into a few problems I'm hoping someone can point me in the right direction for. The desired network setup for my VMs are:

  1. Dynamic, public IPv4 (same as old VMs)
  2. Dynamic, public IPv6 (new for the new VMs)

My desire for Dynamic IPs is rooted in the fact that I will be using these infrequently and have no need for a static IP, so an ongoing charge for static IPs is undesirable. However, I am having trouble trying to configure VMs and their network interfaces for Dynamic IPs (more on this later).

I have seen these pages regarding public IPs and pricing:

https://azure.microsoft.com/en-us/pricing/details/ip-addresses/

https://learn.microsoft.com/en-us/azure/virtual-network/ip-services/public-ip-addresses

My first question is in regards to public Static IPs. From the pricing page, it would seem to indicate that I would be charged hourly from the time of IP creation until it's destroyed (meaning an ongoing charge of ~12 cents a day per IP address), unlike Dynamic IPs which are only charged while the VM is running. Is that correct?

Pursuant to trying to create Dynamic IPs, I attempted to separately create Public IP Addresses in the portal, and set them to be dynamic. However, when I attempt to Associate them with the network interface it gives an error indicating that the VM has been set up with a zone constraint (1), whereas the PublicIPAdddress has a Regional zone constraint. However, I can't seem to change or configure the zone constraint on the VM and/or the Public IP Address as it seems necessary.

When creating the VMs, it seems I have to select an Availability Zone.

When creating the Public IP Address, in order to have Dynamic IP as an option, one must select the Basic SKU. However, the Basic SKU does not provide Availability Zone selection.

The added wrinkle is that I would very much like to enable public IPv6 as well, so as I understand it that introduces a new wrinkle as that requires using the Load Balancer?

How can I configure my VMs, Public IPs, Network Interfaces, etc. so that my VMs have dynamic, public IPv4 and IPv6?

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
7,374 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Prrudram-MSFT 22,921 Reputation points
    2023-10-05T15:50:13.74+00:00

    Hi @SBD

    I understand that you are trying to create new VMs with dynamic public IPv4 and IPv6 addresses, but you are running into some issues with the configuration. I'll do my best to help you out.

    First, regarding the pricing for static and dynamic public IP addresses, you are correct that static public IP addresses are charged hourly from the time of creation until they are destroyed, while dynamic public IP addresses are only charged while the VM is running. So, if you don't need a static IP address, it's best to use a dynamic IP address to avoid ongoing charges.

    Regarding the error you are seeing when trying to associate a dynamic public IP address with a network interface, it sounds like the issue may be related to the availability zone configuration. When you create a VM, you are required to select an availability zone, which determines the physical location of the VM. However, when you create a public IP address with the Basic SKU, you are not given the option to select an availability zone. This can cause issues when trying to associate the public IP address with the network interface, as the availability zone constraints may not match.

    To resolve this issue, you may need to create a public IP address with the Standard SKU, which allows you to select an availability zone. This should allow you to associate the public IP address with the network interface without encountering the zone constraint error.

    Regarding IPv6, you are correct that enabling public IPv6 requires the use of a load balancer. This is because Azure does not currently support assigning public IPv6 addresses directly to virtual machines. Instead, you must use a load balancer to distribute incoming traffic to the virtual machines. You will need to create a load balancer and configure it to use a public IPv6 address. You can then associate the load balancer with your VMs to enable public IPv6 connectivity.

    <If this does answer your question, please accept it as the answer as a token of appreciation.>


  2. SBD 20 Reputation points
    2023-10-07T20:47:06.1766667+00:00

    I was able to address the dynamic public IP issue by creating my VM with "No Infrastructure Redundancy Required" for the Availability Zone, which then allowed for creating the Public IP with the Basic SKU and Dynamic assignment. This has allowed me to get running and configured as I was with my Classic VM.

    The setup for Public IPv6 (with Load Balancer, it's configuration, etc.) remains more complex than it's worth for me at the moment, so I'm setting that problem aside until this is more easily accomplished (via the portal).