Share via


Reverse DNS for Azure Cloud Services using Service Management API

 

The Azure Networking team has got the Reverse DNS feature out.This article https://azure.microsoft.com/en-us/updates/reverse-dns-support-for-azure-cloud-services/ which mentions that it can be done by SMAPI and PowerShell.

“Azure Cloud Services supports reverse DNS records for all PaaS and IaaS Cloud Services. This support is backwards compatible with all existing Cloud Services, is supported in the Service Management API and PowerShell, and is being offered at no additional cost.”

For details on the same and the PowerShell implementation please refer Stephen’s article https://azure.microsoft.com/blog/2014/07/21/announcing-reverse-dns-for-azure-cloud-services/. The current blog intends to detail on how to manage Reverse DNS records for your Cloud Services using the Azure Service Management API.

The existing Service Management APIs can be used for Creating and Updating Hosted Service with Reverse DNS names by adding an optional element.

ReverseDnsFqdn can only be specified if the version is 2014-06-01 or higher. Please refer https://msdn.microsoft.com/en-us/library/azure/gg592580.aspx for Service Management Versioning.

Create Cloud Service : https://msdn.microsoft.com/en-us/library/azure/gg441304.aspx

With Reverse DNS

 <?xml version="1.0" encoding="utf-8"?>
 <CreateHostedService xmlns="https://schemas.microsoft.com/windowsazure">
       <ServiceName>service-name</ServiceName>
       <Label>base64-encoded-service-label</Label>
       <Description>description</Description>
       <Location>location</Location>
       <AffinityGroup>affinity-group</AffinityGroup>
       <ExtendedProperties>
           <ExtendedProperty>
               <Name>property-name</Name>
             <Value>property-value</Value>
         </ExtendedProperty>
     </ExtendedProperties>
 <ReverseDnsFqdn>reverse-dns-fqdn</ReverseDnsFqdn>
 </CreateHostedService>

 

Element Name

Description

ServiceName

Required. Specifies the name for the cloud service. This name must be unique within Azure. This name is the DNS prefix name that is used to access the service. To verify the availability of a name, you can use Check Cloud Service Name Availability.

Label

Required. Specifies the base-64-encoded identifier of the cloud service. The identifier can be up to 100 characters long. The label can be used for your tracking purposes.

Description

Optional. Specifies the description of the cloud service. The description can be up to 1024 characters long.

Location

Required if AffinityGroup is not specified. Specifies the location where the cloud service is created.

You must specify Location or AffinityGroup, but not both. To see the available locations, you can use List Locations.

AffinityGroup

Required if Location is not specified. Specifies the name of an existing affinity group that is associated with the subscription. You must specify Location or AffinityGroup, but not both. To see the available affinity groups, you can use List Affinity Groups.

Extended properties Collection of name value pairs representing hosted service extended properties. Optional.

Name

Optional. Specifies the name of an extended cloud service property. The name can be up to 64 characters long, only alphanumeric characters and underscores are valid in the name, and it must start with a letter. Each extended property must have both a defined name and value. You can define a maximum of 50 extended properties.

The Name element is only available using version 2012-03-01 or higher.

Value

Optional. Specifies the value of an extended cloud service property. The extended property value can be up to 255 characters long.

The Value element is only available using version 2012-03-01 or higher.

ReverseDnsFqdn Dns address to which the hosted service’s IP address resolves when queried using a reverse Dns query. Optional.

Update An Existing Cloud Service : https://msdn.microsoft.com/en-us/library/azure/gg441303.aspx

Currently

 <?xml version="1.0" encoding="utf-8"?>
 <UpdateHostedService xmlns="https://schemas.microsoft.com/windowsazure">
   <Label>base64-encoded-label-of-cloud-service</Label>
   <Description>description-of-cloud-service</Description>
   <ExtendedProperties>
     <ExtendedProperty>
       <Name>name-of-property</Name>
       <Value>value-of-property</Value>
     </ExtendedProperty>
   </ExtendedProperties>
   <GuestAgentType>type-of-guest-agent</GuestAgentType
 </UpdateHostedService>

With Reverse DNS

 <?xml version="1.0" encoding="utf-8"?>
 <UpdateHostedService xmlns="https://schemas.microsoft.com/windowsazure">
       <Label>base64-encoded-service-label</Label>
       <Description>description</Description>
       <ExtendedProperties>
           <ExtendedProperty>
               <Name>property-name</Name>
             <Value>property-value</Value>
         </ExtendedProperty>
             <GuestAgentType>ProdGA|TestGA</GuestAgentType>
     </ExtendedProperties>
 <ReverseDnsFqdn>reverse-dns-fqdn</ReverseDnsFqdn>
 </UpdateHostedService>

Element Name

Description

Label

Optional if Description is specified. Specifies the base-64-encoded identifier for the cloud service. The identifier can be up to 100 characters long. It is recommended that the label be unique within the subscription. The label can be used for your tracking purposes.

Description

Optional if Label is specified. Specifies the description of the cloud service. The description can be up to 1024 characters long.

Name

Optional. Specifies the name of an extended cloud service property. You must provide a name and value for each property. A maximum of 50 extended properties is allowed. The name can be up to 64 characters long. Only alphanumeric characters and underscores are valid in the name, and it must start with a letter.

The Name element is only available using version 2012-03-01 or higher.

Value

Optional. Specifies the value of an extended cloud service property. Each extended property must have both a defined name and value. The value can be up to 255 characters long. You can delete an existing property by setting the value to NULL.

The Value element is only available using version 2012-03-01 or higher.

GuestAgentType

Optional. Specifies the type of guest agent that is installed on deployments of web roles and worker roles.

Possible values are:

  • ProdGA
  • TestGA

GuestAgentType is a restricted element that can only be used by authorized subscriptions that are configured for early access to future versions of the guest agent. When the GuestAgentType is set to ProdGA, the latest guest agent that has been released publically is installed on instances of web roles and worker roles in a cloud service. When GuestAgentType is set to TestGA, the newest test version of the guest agent is installed.

ReverseDnsFqdn Dns address to which the hosted service’s IP address resolves when queried using a reverse Dns query. Optional.

Angshuman Nayak, Cloud Integration Engineering