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.
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.