Table of contents
1.
Introduction
2.
Public IP addresses in Azure 
2.1.
IP Address Assignment
2.2.
Limitations of public IP addresses for IPv6
3.
Private IP addresses in Azure 
3.1.
IP Address Assignment
3.2.
Internal DNS hostname resolution (for Virtual Machines)
4.
Frequently Asked Questions 
4.1.
What is an IP address?
4.2.
What is DNS?  
4.3.
Mention a few features of the public IP addresses. 
5.
Conclusion
Last Updated: Mar 27, 2024

IP Addresses in Azure

Career growth poll
Do you think IIT Guwahati certified course can help you in your career?

Introduction

Microsoft Azure, which was earlier known as Windows Azure. It is a public cloud computing platform of Microsoft. It offers a wide variety of cloud services, that includes computing, analytics, storage, and networking.  

For these services, it also provides IP addresses which can be of two types - public and private. 

In this article, we will discuss both these types of IP addresses in Azure in detail.  

Public IP addresses in Azure 

Public IP addresses enable Internet resources to communicate inbound to Azure resources. Public IP addresses allow Azure resources to communicate to the Internet and public-facing Azure services. The address is reserved for the resource until gets unassigned by the user. A resource can communicate outbound without a public IP address assigned. Azure assigns an available IP address that is not dedicated to the resource dynamically.

A public IP address in Azure Resource Manager is a resource and has its own properties. Some of the resources that public IP address resources can be associated with are:

  • Virtual Network Gateways(VPN/ER)
  • Application Gateways
  • Virtual Machine Network Interfaces
  • Virtual Machine Scale Sets
  • Public Load Balancers
  • NAT Gateways
  • Azure Firewall
  • Bastion Host
  • Route Server

 

The below table shows the property a public IP can be related with a resource and the allocation methods. Note that public IPv6 support is not available for all resource types.

IP Address Assignment

Public IPs have two types of allocations:

  • Static The resource is given an IP address at that time it is created. When the resource is deleted, the IP address is released.
  • Dynamic - The IP address is not given to the resource at the time of creation when selecting dynamic. The IP is assigned when the user associates the public IP address with a resource. The IP address is released when the user stops or deletes the resource

 

Static public IP addresses are usually used in the following situations:

  • When the user must update firewall rules to communicate with the user’s Azure resources.
  • DNS name resolution - where a change in IP address would require updating records.
  • The user’s Azure resources communicate with other services or apps that use an IP address-based security model.
  • The user uses TLS/SSL certificates connected to an IP address. 

Limitations of public IP addresses for IPv6

  • Either directly or peered with "UseRemoteGateway", VPN gateways cannot be used in a virtual network with IPv6 enabled, .
  • Public IPv6 addresses are locked at a constant timeout of 4 minutes.
  • While adding IPv6 to existing IPv4 deployments, IPv6 ranges can not be added to a virtual network with existing resource navigation links.
  • Azure does not allow IPv6 communication for containers.
  • The usage of IPv6-only virtual machines or virtual machines scale sets is not supported. Each NIC should include at least one IPv4 IP configuration (dual-stack).
  • Reverse DNS for IPv6 is not supported. Forward DNS for IPv6 is allowed for Azure public DNS. 
  • Routing Preference and cross-region load-balancing are not allowed.

Private IP addresses in Azure 

Private IP addresses enable communication among resources in Azure.

Resources can be:

  • In a virtual network.
  • Azure Services such as:
    • Virtual machine network interfaces
    • Internal load balancers (ILBs)
    • Application gateways
  • On-premise network via a VPN gateway or ExpressRoute circuit.

 

Private IP addresses enable communication with these resources without the usage of a public IP address.

IP Address Assignment

Private IP addresses are assigned to resources from the address range of the virtual network subnet where the resource is by Azure.

Azure reserves the first 4 addresses in each subnet address range. The addresses can not be allocated to resources. IP addresses within the address range of a subnet can only be assigned to one resource at a time.

There are two ways through which a private IP address is given:

  • Dynamic: Azure assigns the next available unreserved or unassigned IP address in the address range of the subnet. For example, Azure assigns 10.0.0.8 to a new resource, if addresses 10.0.0.3-10.0.0.7 are already assigned to other resources.
  • Dynamic is the default allocation method. Once assigned, dynamic IP addresses are resolved if a network interface is:
    • Deleted
    • within the same virtual network, reassigned to a different subnet.
    • The allocation method is switched to static, and a different IP address is mentioned.

 

By default, Azure allocates the previous dynamically assigned address as the static address when the user changes the allocation method from dynamic to static.

  • Static: The user selects and assigns any unreserved or unassigned IP address in the subnet's address range of the subnet.
  • For example, an address range of a subnet is 10.0.0.0/16, and addresses 10.0.0.3-10.0.0.6 are assigned to other resources. The user can assign any address between 10.0.0.7 - 10.0.255.254. Static addresses are only given if a network interface is deleted.
  • Azure offers the static IP as the dynamic IP when the allocation method is changed. The reassignment takes place even if the address is not the next available in the subnet. The address changes if the network interface is assigned to another subnet.
  • To assign the network interface to another subnet, the user needs to change the allocation method from static to dynamic. He needs to assign the network interface to a different subnet, then change the allocation method back to static, then assign an IP address from the new subnet's address range.

Internal DNS hostname resolution (for Virtual Machines)

By default, Azure Virtual Machines are configured with Azure-managed DNS servers. Users can configure custom DNS servers explicitly. These DNS servers offer internal name resolution for virtual machines that are within the same virtual network.

A mapping for the hostname to a private IP address of the virtual machine is added to the Azure-managed DNS servers.

A hostname is mapped to the primary IP of the main network interface if a virtual machine has:

  • Multiple IP Addresses
  • Multiple Network Interfaces
  • Both

 

Azure-managed DNS which are configured with virtual machines resolve the hostnames within the same virtual network. 

Frequently Asked Questions 

What is an IP address?

The IP address is short for the internet protocol address. It is an identifying figure that is related to a specific computer or computer network. When connected to the internet, the IP address enables the computers to pass information.

What is DNS?  

The Domain Name System (DNS) resolves domain names into IP addresses, which browsers use to load internet pages. Each device connected to the internet has its own IP address, that is used by other devices to locate the device.

Mention a few features of the public IP addresses. 

Some features of the public IP addresses are:

  • The Global Tier enables a public IP address to be used with cross-region load balancers.
  • The Internet Routing Preference option optimizes the time that traffic spends on the Microsoft network, decreasing the egress data transfer cost. 

Conclusion

This article extensively discusses the concept of IP Addresses in Azure in detail.

We hope that this blog has helped you enhance your knowledge regarding IP Addresses in Azure, and if you would like to learn more, check out our articles on Coding Ninjas Blogs

You can refer to our Guided Path on Coding Ninjas Studio to upskill yourself in Data Structures and AlgorithmsCompetitive ProgrammingJavaScriptSQLSystem Design, and many more!
If you want to test your competency in coding, you may check out the Mock Test Series and participate in the Contests organized on Coding Ninjas Studio! But if you have just started your learning process and are looking for questions asked by tech giants like Amazon, Microsoft, Uber, etc; you must look at the Problems, Interview Experiences, and Interview Bundle for placement preparations.

Nevertheless, you may consider our Courses to give your career an edge over others!

Do upvote our blog to help other ninjas grow. 

Happy Coding!

Thank You Thanks GIF - Thank You Thanks Gratitude - Discover & Share GIFs
Live masterclass