Loading...

Instance level public ip address configuration in the cloud service.

Instance level public ip address configuration in the cloud service.

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. 

 

Frank_Pan_0-1673149144349.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="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceConfiguration" 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 

Frank_Pan_0-1673150168240.png

 

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

Frank_Pan_1-1673150227186.png

 

Frank_Pan_0-1673150822719.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="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" serviceName="Test_cloudservice" osFamily="6" osVersion="*" schemaVersion="2015-04.2.6" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceConfiguration">

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

 

Frank_Pan_1-1673151024066.png

 

 

Published on:

Learn more
Azure PaaS Blog articles
Azure PaaS Blog articles

Azure PaaS Blog articles

Share post:

Related posts

Azure Storage - TLS 1.0 and 1.1 retirement

Overview TLS 1.0 and 1.1 retirement on Azure Storage was previously announced for Nov 1st, 2024, and it was postponed recently to 1 year later...

1 year ago

Efficient Management of Append and Page Blobs Using Azure Storage Actions

  Overview In Azure Storage, Blob Lifecycle Management (BLM) allows you to automate the management of your data based on rules defined by...

1 year ago

[Azure AI Search] Internal Server Error when creating CMK encrypted objects

Scenario Customers follow the Microsoft doc to create CMK encrypted objects (data source, index etc.), but get the 500 Internal Serv...

1 year ago

Optimizing Azure Table Storage: Automated Data Cleanup using a PowerShell script with Azure Automate

Scenario This blog’s aim is to manage Table Storage data efficiently. Imagine you have a large Azure Table Storage that accumulates logs from ...

1 year ago

Optimizing Azure Table Storage: Automated Data Clean-up using a PowerShell script with Azure Automat

Scenario This blog’s aim is to manage Table Storage data efficiently. Imagine you have a large Azure Table Storage that accumulates logs from ...

1 year ago

Restoring Soft-Deleted Blobs with multithreading in Azure Storage Using C#

Blob soft delete is an essential feature that safeguards your data against accidental deletions or overwrites. By retaining deleted data for a...

1 year ago

Performing simple Azure Table Storage REST API operations using curl command.

The blog provides guidance to perform simple Table Storage REST API operations such as Create table, Delete Table, Insert entity, Delete entit...

1 year ago

Bulk delete all the old jobs from the batch account

Deleting a Job also deletes all Tasks that are part of that Job, and all Job statistics. This also overrides the retention period for Task dat...

1 year ago

Utilizing Azure Storage and Runbooks for scheduled automated backups of Azure SQL Databases

In this article, we are going to provide detailed steps to create a scheduled Azure SQL Database backup to storage account using automation. T...

2 years ago

[Azure Service Bus] JMS messages getting dead-lettered

The article discusses a problem where numerous messages end up in the dead letter queue (DLQ) when the JMS service bus consumer connects to th...

2 years ago

Newsletter

Get the latest Dynamics 365 and Power Platform content in your inbox

A curated digest of community blogs, product news, videos, and podcasts — delivered without the noise.

Weekly updates Unsubscribe anytime Fresh community picks
We use your email only for the newsletter and you can unsubscribe at any time.
By subscribing, you agree to the privacy policy.