Domain name registration transfer to Azure App Service domains

Updated 03/11/2018 [ A transfer-in of a .uk domain into Azure is not currently supported as the IPSTAG is required by Nominet on the existing provider side. I assume it would be GODADDY when transferring into Azure. The Azure portal will be updated soon to support UI based migrations ]

What?

If you have some domain names registered with say 123-reg or another provider and want to migrate/transfer the ownership into Azure, you can do this with the supported top level domains: com, net, co.uk, org, nl, in, biz, org.uk, and co.in (as documented here: Buy a custom domain name for Azure Web Apps.

Why?

Some of the reasons you might want to do this:

  • Take advantage of Microsoft Azure’s flat rate pricing, for all domains, that they have agreed with GoDaddy
  • Single console to control domains, DNS, traffic manager, web sites (app service) etc. etc.
  • Better automation/api functionality (in my opinion) than what some of the domain name hosting companies offer.

How?

There are a few blogs on the internet on how to achieve this with PowerShell using:

New-AzureRmResource -ResourceType Microsoft.DomainRegistration/domains

like on Jos Liebens site.

Issue

However, like others had commented, I also received this error back after running appropriate PoSh:

New-AzureRmResource : {"Code":"BadRequest","Message":"Parameter domain is null or empty.","Target":null,"Details":[{"Message":"Parameter domain is null or empty."},{"Code":"BadRequest"},{"ErrorEntity":{"ExtendedCode":"51011″,"MessageTemplate":"Parameter {0} is null or empty.","Parameters":["domain"],"Code":"BadRequest","Message":"Parameter domain is nullor empty."}}],"Innererror":null}

So seems there maybe a bug with this AzureRM cmdlet? I couldn’t see this domain property mentioned in the Microsoft.DomainRegistration/domains documentation.

Solution

The Microsoft Azure REST API.

There are probably other ways to initiate a domain name transfer into Azure using the REST API, but I found this way to be pretty simple.

    1. Go to the Domains – Create Or Update page where you interact with the API from the Microsoft docs page.
    2. Click on the ‘Try it‘ button and login with your Azure AD credentials. ( I have global admin permissions in my tenant ).
      Azure_TryIt
    3. Add the mandatory parameters:
      resourceGroupName – where the App Service object will be created
      domainName – the domain name you are migrating from another provider into Azure
      api-version – I left this as defaultdomain_transfer_params
    4. For a domain transfer, I used the following body:
      Note: some of the properties are mandatory/required

      {
       location: "Global",
       properties: {
        contactAdmin: "Jack Rudlin",
        contactBilling: "Jack Rudlin",
        contactRegistrant: "Jack Rudlin",
        contactTech: "Jack Rudlin",
        privacy: "True",
        autoRenew: "True",
        authCode: "q\\1u{b=wbY9bNT193iNS",
        Consent: {
         agreedAt: "2018-10-21T20:10:40",
         agreedBy: "70.80.90.100",
         agreementKeys: ["DNPA","DNTA"]
        }
       }
      }
      

      domain_transfer_body

      You should get a 202 response back if the post was successful

      Note: Don’t forget to escape your JSON! Check the authCode. I had a backslash \ in mine so I had to escape it with an additional \

 

    1. In the Azure Resource Group that you specified in the earlier parameters, the App Service should be listed with the domain name you are transferring:rg

 

    1. A day or two later, the annual charge for the domain hosting service should be taken from your Azure funds:azure domain cost

 

  1. Finally once the domain transfer has been successfully completed, you will get access to manage the domains DNS:
    appdomain_active
  2. Post domain transfer you’ll probably want to migrate you DNS and then web services.

I quite liked using the REST API post method from the browser. In an enterprise environment, I can immediately see these benefits:

  • Browser supports authenticated proxies natively  – PowerShell has issues with this
  • No need to download/install modules for PowerShell
  • No local administrator rights required
  • I guess the Azure cloud shell is similar, but that requires a storage account and has an additional cost association
Advertisements

11 thoughts on “Domain name registration transfer to Azure App Service domains”

  1. hi,
    i have just tried running this.
    my scenario is that I am attempting to transfer my domain from domain monster to azure.
    my name servers are pointing at cloudflare.
    i have unlocked my domain and retrieved the auth code.
    having attempted the transfer following the steps you outline above i receive the following error:

    {
    “Code”: “DomainResellerWebService_UNAVAILABLE_DOMAIN”,
    “Message”: “`domain` (davidbuckell.com) isn’t available for transfer”,
    “Target”: null,
    “Details”: [
    {
    “Message”: “`domain` (davidbuckell.com) isn’t available for transfer”
    },
    {
    “Code”: “DomainResellerWebService_UNAVAILABLE_DOMAIN”
    },
    {
    “ErrorEntity”: null
    }
    ],
    “Innererror”: null
    }

    any ideas?
    thanks

    Like

    1. Interesting. How long after you requested the authcode did you try and initiate the transfer? I didn’t initiate my transfer until at least 3 days after I got the code, but that was purely because I was trying to figure out how to get the transfer working with the new API 🙂

      Like

      1. well i remember generating an auth code some months ago and couldn’t quickly work out how to do it so left it.
        now i have picked it up again i am immediately attempting the transfer having generated an auth code.
        can’t be certain if the latest attempt is a new or existing auth code though. i have attempted this over the past 3 days and have been presented with the same auth code on each occasion………
        maybe my auth code has expired???

        Like

  2. domain monster have confirmed that they have not seen any transfer requests of my domain within their logs. azure support believe its a domain monster issue and domain monster support believe its an azure issue. arrgh 🙂

    Like

      1. ah interesting to know. my domain is due to expire in a couple of weeks and was hoping to get it transferred to azure prior to renewal. i understand if you transfer you have to wait 2 months before being able to transfer again?
        if i can’t get it working over the next week then i guess i will try that route.
        thanks!

        Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s