3

Im trying to add a Public IP to a virtual machine but I received the following error:

Failed to save IP address changes for network interface 'XXX'. Error: Compute resource VMNAME has a zone constraint 1 but the PublicIPAddress /subscriptions/XXX/resourceGroups/Enterprise_Search/providers/Microsoft.Network/publicIPAddresses/VMNAME used by the compute resource via NetworkInterface or LoadBalancer has a different zone constraint Regional.

4c74356b41
  • 69,186
  • 6
  • 100
  • 141
exitista
  • 563
  • 2
  • 10
  • 21

1 Answers1

3

What the error suggests - your VM is deployed into a specific zone in a region, whereas your Public IP address isnt. its a regular IP address. try creating a Public Ip address in the same zone as the VM is in and link the VM to that Public IP.

just in case something happens with the comments: Only Standard SKU Public IP can be zone pinned.

4c74356b41
  • 69,186
  • 6
  • 100
  • 141
  • yes! That is what I thougth but both are on "East US 2". Any other idea? – exitista Oct 01 '19 at 17:33
  • its about zones, not regions: https://learn.microsoft.com/en-us/azure/availability-zones/az-overview – 4c74356b41 Oct 01 '19 at 17:36
  • 1
    pick the zone when creating the public ip, you cannot change it – 4c74356b41 Oct 01 '19 at 17:53
  • 3
    I have to created as "standard SKU". This solved my issue! Thanks – exitista Oct 01 '19 at 18:06
  • there must be another option. standard sku justs sets a static IP where as you may want to set a dynamic one. – Panagiss Jun 04 '21 at 20:56
  • @Panagiss - did you find a solution to this? I've just hit the same issue... I want a dynamic IP address for a VM, but can't create it due to the zone of the VM i'm trying to associate to and don't want a static IP so can't use standard! – mutex Aug 31 '21 at 05:09
  • why do you think standard IP must be static? – 4c74356b41 Aug 31 '21 at 06:54
  • @mutex What i think i did is i created a new VM with the same disk, in order to keep data, but the crucial part is after you chose region, to set Availability options to *No infrastructure redundancy required* – Panagiss Sep 03 '21 at 06:51
  • @4c74356b41 because when i select standard sku it disables the option for dynamic. – mutex Sep 03 '21 at 22:44