Azure vm public ip? - azure

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.

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?

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's external IP does not match DNS

I have an MSDN account and created a VM (Windows 2012 R2) to which I have added several software packages for a proof of concept.
The problem is that with my limited $50/month credit, I'm forced to shutdown the VM at night, especially over weekends. When you shutdown a VM from the admin console (the only way they stop charging you) you will also lose the IP address.
The problem occurs when you restart the VM the next day, it will get a different IP. If you try to lookup the machine through a ping, their advertised external IP retrieved through DNS does NOT match the external IP address of the VM.
This makes it impossible for the software to resolve the host.
I figured it might take a couple hours for DNS to push the change, but it's been all day now and the DNS address is still incorrect.
Anyone else run into this?
(I cant create a support ticket because I only have an MSDN subscription.)
Where are you looking up the IP address? When you shutdown the machine and restart it you are correct in that it assigns a new external ip address. This only happens if this is the only VM running in that cloud service. This sounds like your setup.
The IP address you should be looking for is the one attached to the cloud service that your VM is a part of. If you go to the dashboard of the cloud service it will show you the public virtual IP address along with the FQDN. This IP will also match your VM's public IP.
See below
One thing I would suggest is to use Reserved IP option. It allows you to hook up semi permanent IP address to your cloud service.
https://azure.microsoft.com/en-us/documentation/articles/virtual-networks-reserved-public-ip/
Worth mentioning that Public IP may be returned back to the pool under certain circumstances, i.e. if your subscription run out of money. This is public cloud service after all, and however big the pool is, it is still limited.
Worth noting that I'm using the same approach shutting down my VMs when I'm not using them, but I don't experience IP change too often. Possibly because I have A0 domain controller VM always running.

How do I safely access one Azure VM from another within a Cloud Service and Availability Set

I have an Azure Cloud Service, mywebapp.cloudapp.net, that consists of two Azure VMs - mywebappvm1 and mywebappvm2. Both VMs are in the same Availability Set and have the same DNS name.
I also have a Regional Reserved IP address assigned to the Cloud Service so that I can give our clients a guaranteed IP address that our app uses.
Part of the app uses a private background process, currently only running on one of the VMs. I want to be able to make a connection to that process over TCP running on mywebappvm1 from mywebappvm2. I could use the public IP and an endpoint on mywebappvm1 but I don't want the background service to be publicly accessible.
I'm currently using the private IP address, but is that safe? Will the private IP of each VM change if it's rebooted? I can't see an easy way of fixing the private IP of each VM - that seems like something you can do with a VNET but I can't find any information on how to do it with a cloud service and an availability group as well.
Is there perhaps another way to run a web app on multiple load-balanced VMs within an availability set that would make this easier?
What you do is absolutely safe and actually a recommended best practice. You should not go out to public IP address in order to communicate between the Virtual Machines.
It is also a recommended best practice to organize your Virtual Machines into Virtual Network and sub-nets.
This excellent blog post describes how can you even use static IP addresses for the VMs, so you are always 100% sure that mywebappvm1 always get XXX.XXX.XXX.XXX IP Address andyour mywebappvm2 always get YYY.YYY.YYY.YYY IP Address.
Please note that if you do not use Static IP Address assigned to the VM, it is guaranteed that the IP Address of the VM may change.
The IP for a webRole VM instance will not change for the lifetime of the deployment regardless of reboot, update or swapping. The IP will be released only if you delete the deployment, detailed here

Retain Public Virtual IP Address?

When you reboot an Azure Virtual Machine, its public virtual IP address does not change. However, if you shutdown the VM and then start it back up, it will receive a different public virtual IP address.
This VM server is hosting a service which end users may need to create a firewall rule for. This may require them to have the public IP address of the server.
Is there a method to keep the same public virtual IP address? Can Microsoft allow this on a per account / per VM / per subscription basis?
Thanks
Yes, there is a way for you to do this, but you will still be charged compute charges. The Public IP is linked to the cloud service container the VM runs in and as long as something is running (or appears to be running) in that container than the VIP will stay assigned to you. You can shutdown the VM from within the VM itself.
Check out the following post by Keith Mayer for more info on this: http://blogs.technet.com/b/keithmayer/archive/2013/06/19/windows-azure-virtual-machines-there-s-more-than-1-way-to-shutdown-a-vm.aspx#.UqInbRwo5aQ
Currently leasing a VIP or having a fully assigned VIP that is just for you across deployments and such is not an option. They have been hearing this feedback for quite some time and from many people.

Resources