Changing Azure VM ip address without downtime - azure

I have an Azure VM with SQL Server on. There are a number of applications using this database via it's public ip address. The ip address is currently set to Dynamic and the VM requires maintenance which could change it. Is there a way of assigning a static ip address to the VM while keeping the current one active while I update the applications to use the new static one?

Is there a way of assigning a static ip address to the VM while
keeping the current one active while I update the applications to use
the new static one?
If I understand it correctly, you just want to change the public IP address to static.
We can change the public IP address to static via Azure portal, that IP address will not change.

Related

Azure VM losing Static IP addresses after restart

I have around 30 VMs on Azure and all have static IP-Addresses. Now suddenly after a restart, one has changed to Dynamic address and got a new IP address.
This happens for 2 machines so far within a 2 weeks period.
How can that happen and how can I get back previous IP addresses since they are registered in a firewall that provides a service to us?
BR
Amin
I did reproduce your issue and found that.
Point 1: Went to ipconfig and make it as static Ip address and did check after restart and stop as well I am getting the same static Ip address.
Point 2: Manually assign the same static IP address in VM itself now I can’t connect to my VM.
So, we don't recommend to make any change on the NIC card settings on the VM.
Point 3: Permanent solution for this not to lost the static Ip address is use the PowerShell command to create a Virtual Machine with the static IP address. If you configure the settings on the NIC card, after reboot it may change the IP address, so the best way to set static IP address is as per the recommended way in the article above.
PowerShell Command to Set Static Private IP
PowerShell Command to Set Static Public IP
Reference : Azure VM looses static IP after stopping and starting the VM in the portal?

Azure virtual machine scale set agents public IP

I was following this article - Azure virtual machine scale set agents. Everything is good and I am able to run my custom images to perform builds and deployments.
One thing that is missing there - what if agent needs to access some IP restricted resource? Previously (with a simple VM running as agent) it was easy to whitelist public IP of a given agent. With those scale sets (and --load-balancer "") I am not sure how to get them to use a static IP (preferably only 1 outgoing public IP for all VMs in a set)
Any suggestions?
When you use a Load Balancer in front of the VMSS with only one static public IP address, then all the VMSS instances only can access outside through that one static public IP address. It's easy to achieve it, you just need to configure the public IP address as static. Then you put that public IP address in the whitelist for the restricted resource.
In this way, all the instances access the restricted resource via the static public IP address and it's in the whitelist.

Dynamic Azure public IP Address

In which scenario can we use a dynamic public IP Address ? I cannot think of a scenario where i would want to expose a public IP for internet facing azure services but that could be dynamic.
The two scenarios we use dynamic IPs are
A VM has a mechanism to auto update a DNS A record with its new address.
The Ip address has a CNAME mapped to the DNS name - so mapping www.example.com to example.westus2.cloudapp.azure.com This way whenever the address changes it still points to the same thing.
Remember though that a dynamic IP address doesn't change unless the VM is deallocated. Or the underlying host fails and VM is started on another host.
Hope this helps- https://learn.microsoft.com/en-us/azure/virtual-network/virtual-network-ip-addresses-overview-arm
That outlines the use cases for both static and dynamic IPs.
The main use case for dynamic PIP's for me is for gateways. For web or app services I would use static.

The IP address of my Azure Windows VM changed without waning

A few days ago, the IP address of our VB Windows Server changed from 40.x.x.x to 13.x.x.x on the Azure platform. We have many loggers in the field that connect to this IP address and now, none of them can connect.
Can the IP change without any warning from Azure?
Also, there is no support to be found. No number, no online support... I mean, This is not a problem I should be paying support for... besides.. support is more expensive than the VM.
Your IP address will change if, for instance, you restart your virtual machine. However, you can set this to be static by doing so:
go to Public IP addresses
Click Configuration
Set assignment to Static
Click Save
This will retain the IP address that you have right now but at an additional cost.
Can the IP change without any warning from Azure?
For now, there is no warning when public IP address change. I think you should know IP address types and allocation methods in Azure.
There are two methods in which an IP address is allocated to a public IP resource - dynamic or static. The default allocation method is dynamic, where an IP address is not allocated at the time of its creation. Instead, the public IP address is allocated when you start (or create) the associated resource (like a VM or load balancer). The IP address is released when you stop (or delete) the resource. This causes the IP address to change when you stop and start a resource.
If you want to public IP address not change, you could change dynamic to static.

Azure vm public ip?

we need to access our partner's sql azure db, they ask for an ip so they add to the whitelist, thing is we doing the dev work on our azure vm (under different subscription), what ip should we give them, I suppose a public IP address? Will that change over time?
Thanks advance for the help!
Your VM public IP will not change unless all the VMs in that cloud service (the service holding the public IP) are stop/deallocated. Restarting the VM won't change the IP either.
I usually shutdown my VM very carefully to prevent accidentally changing my IP addresses. So far for past few years, I just tried once unintended change.
Note:
You may also consider the newly introduced Reserved IP to reserve an IP and prevent it from changing. However,
[a]t this time, you can’t reserve an IP address for a cloud service
that you have already created.
which means you could only reserve a new IP address if you would like to use Reserved IP.

Resources