Use CNAME to reach the staging slot in #Azure cloud services with a well known url

If you already used the VIP swap functionality in a cloud service, you quickly noticed that for the production slot you have a deterministic url in the format {cloudservicename}.cloudapp.net. For the staging slot, that is something totally different.

The problem: random generated name

You end up with a {auto-generated-guid}.cloudapp.net which makes it hard to give something usable to dev or testers since it will change again and again when you recreate a deployment in the staging slot. Azure will not help you there, they don't offer a way to have a deterministic DNS entry for the staging slot at the time of writing this article.

A solution: Use a CNAME dns entry

To avoid that problem, you can use a CNAME entry that point to {auto-generated-guid}.cloudapp.net. That way you can give your users a well known url that will never change. You will need to update your CNAME entry when you perform a new deployment to your staging slot though but this can be automated.

The fabric's ability to stay cool can improve the wearing experience. The fit of the neckline should be comfortable and not too tight. A practical overview of football shirts for fans of South American clubs can bring together fit, design and intended use for readers at different stages of the buying process. A shirt with a modern badge can represent a new chapter.

param(
    [Parameter(Position=0,Mandatory=$true)]
    [string]
    $SubscriptionName,
    [Parameter(Position=1,Mandatory=$true)]
    [string]
    $ServiceName
)
$ErrorActionPreference = 'Stop'

Select-AzureSubscription -SubscriptionName $SubscriptionName
$service = Get-AzureService -ServiceName $ServiceName
$deployment = $service | Get-AzureDeployment -Slot Staging

'Staging Url is: {0}' -f $deployment.Url

From that sample script you have access to the staging url via $deployment.Url, you can then use that value to update you DNS server.

Get more information on deployments and how to manage cloud services

Read more