Jump to content

Instance level public ip address configuration in the cloud service.


Recommended Posts

Guest Frank_Pan
Posted

An Instance-Level Public IP Address (PIP) unlike the Virtual IP Address (VIP) is not load balanced. While the virtual ip is assigned to the cloud service and shared by all virtual machines and role instances in it, the public ip is associated only with a single instance’s NIC. The public ip is particularly useful in multi-instance deployments where each instance can be reachable independently from the Internet. The picture below illustrates the value of PIP and differentiates it from the VIP. The blog will help you understand how to configure the instance level public ip.

 

 

 

mediumvv2px400.png.4412288669c1e9c9fb45604b5bb2a717.png

 

 

 

For some background knowledge, please find the reference Instance-Level Public IP Address | Azure Blog and Updates | Microsoft Azure.

 

 

 

Classic cloud service:

 

  1. How to configurate instance level public ip by role:

 

<?xml version="1.0" encoding="utf-8"?>

 

<ServiceConfiguration serviceName="TestVirtualnetwork" xmlns="
" osFamily="6" osVersion="*" schemaVersion="2015-04.2.6">

 

<Role name="WebRole1">

 

<Instances count="1" />

 

<ConfigurationSettings>

 

<Setting name="APPINSIGHTS_INSTRUMENTATIONKEY" value="xxx" />

 

</ConfigurationSettings>

 

</Role>

 

<Role name="WebRole2">

 

<Instances count="1" />

 

<ConfigurationSettings>

 

<Setting name="APPINSIGHTS_INSTRUMENTATIONKEY" value="xxx" />

 

</ConfigurationSettings>

 

</Role>

 

<Role name="WebRole3">

 

<Instances count="1" />

 

<ConfigurationSettings>

 

<Setting name="APPINSIGHTS_INSTRUMENTATIONKEY" value="xxx" />

 

</ConfigurationSettings>

 

</Role>

 

<Role name="WebRole4">

 

<Instances count="1" />

 

<ConfigurationSettings>

 

<Setting name="APPINSIGHTS_INSTRUMENTATIONKEY" value="xxx" />

 

</ConfigurationSettings>

 

</Role>

 

<NetworkConfiguration>

 

<VirtualNetworkSite name="Group <resource group> <virtual network name>" />

 

<AddressAssignments>

 

<InstanceAddress roleName="WebRole1">

 

<Subnets><Subnet name="subnet001" /></Subnets>

 

<PublicIPs><PublicIP name="PubIP" domainNameLabel="pip" /></PublicIPs>
// with domain

 

</InstanceAddress>

 

<InstanceAddress roleName="WebRole2">

 

<Subnets><Subnet name="subnet003" /></Subnets>

 

<PublicIPs><PublicIP name="PubIP"/></PublicIPs>
// without domain

 

</InstanceAddress>

 

</AddressAssignments>

 

</NetworkConfiguration>

 

</ServiceConfiguration>

 

 

2. How to know current public ip of role:

 

 

 

 

Get-AzureRole -ServiceName <Cloud Service Name> -Slot Production -RoleName WebRole2 -InstanceDetails

 

largevv2px999.png.35d4f3c1756a0e4252a143e602aa7230.png

 

 

 

Get-AzureRole -ServiceName <Cloud Service Name> -Slot Production -RoleName WebRole1 -InstanceDetails

 

largevv2px999.png.3aee3bc24dc07c606f2b1882473c992f.png

 

 

 

largevv2px999.png.e1829ce3948efd086cffcd2354fcc3f5.png

 

 

 

Cloud Service Extended Support:

 

1. How to configurate instance level public ip by role:

 

<?xml version="1.0" encoding="utf-16"?>

 

<ServiceConfiguration xmlns:xsd="
" xmlns:xsi="
" serviceName="Test_cloudservice" osFamily="6" osVersion="*" schemaVersion="2015-04.2.6" xmlns="
">

 

<Role name="TestWebRole">

 

<ConfigurationSettings>

 

<Setting name="Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString" value="UseDevelopmentStorage=true" />

 

</ConfigurationSettings>

 

<Instances count="2" />

 

</Role>

 

<Role name="TestWorkerRole">

 

<ConfigurationSettings>

 

<Setting name="Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString" value="UseDevelopmentStorage=true" />

 

</ConfigurationSettings>

 

<Instances count="1" />

 

</Role>

 

<NetworkConfiguration>

 

<VirtualNetworkSite name="test001VNet" />

 

<AddressAssignments>

 

<InstanceAddress roleName="TestWebRole">

 

<Subnets>

 

<Subnet name="default" />

 

</Subnets>

 

<PublicIPs>

 

<PublicIP name="PubIP" domainNameLabel="pip" />

 

</PublicIPs>

 

</InstanceAddress>

 

<InstanceAddress roleName="TestWorkerRole">

 

<Subnets>

 

<Subnet name="default" />

 

</Subnets>

 

</InstanceAddress>

 

<ReservedIPs>

 

<ReservedIP name="Group TESTCSES cses-prod" />

 

</ReservedIPs>

 

</AddressAssignments>

 

</NetworkConfiguration>

 

</ServiceConfiguration>

 

 

2. Then, we can use the rest api PublicIPAddress In CloudService - List Cloud Service Public IP Addresses - REST API (Azure Virtual Networks) | Microsoft Learn to get the public ip of NIC.

 

 

 

largevv2px999.thumb.png.b47fea111a88325333fe5698c180b4c2.png

 

 

 

 

Continue reading...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...