Subject: Unable to obtain EPP/Auth code for domain custom domain transfer

Thomas Kwaks 0 Reputation points
2026-08-12T11:23:32.4366667+00:00

On this site https://azure.github.io/AppService/2021/09/22/2021-Managing-ASD#transfering-domain-out there is a description how to retrieve a transfer code for a custom domain. The problem is:

Using the

PUT https://management.azure.com/subscriptions/<SUBSCRIPTION-ID>/resourceGroups/<RESOURCE-GROUP-NAME>/providers/Microsoft.DomainRegistration/domains/<DOMAIN-NAME>/transferout?api-version=2021-02-01

with multiple PowerShell environments I receive a Error: DomainResellerWebService_INVALID_BODY using a Invoke method

Request: Please provide the authorization (EPP) code for domain my custom domain to enable transfer to an external registrar.

Impact: Domain migration blocked pending auth code retrieval.

Azure App Service
Azure App Service

Azure App Service is a service used to create and deploy scalable, mission-critical web apps.


3 answers

Sort by: Most helpful
  1. Mukesh Kumar 0 Reputation points
    2026-08-12T12:47:51.74+00:00

    The important fix is to send an explicit empty JSON body. The blog example shows a bare PUT, but in some PowerShell environments the backend can reject the request with:

    DomainResellerWebService_INVALID_BODY

    
      ```powershell
      Try This:$subscriptionId = "<subscription-id>"
      $resourceGroupName = "<resource-group-name>"
      $domainName = "<your-domain.com>"
      Connect-AzAccount
      Set-AzContext -Subscription $subscriptionId
      $path = "/subscriptions/$subscriptionId/resourceGroups/$resourceGroupName/providers/Microsoft.DomainRegistration/domains/$domainName/transferout?api-version=2021-02-01"
      $response = Invoke-AzRestMethod `
        -Method PUT `
        -Path $path `
        -Payload "{}"
      $response.Content | ConvertFrom-Json
    

    The response should contain an authCode value. That is the EPP/authorization code needed by the new registrar.

    If that still fails, try the raw ARM request with an explicit content type:

    $token = Get-AzAccessToken -ResourceUrl "https://management.azure.com/"
    $accessToken = if ($token.Token -is [securestring]) {
      [System.Net.NetworkCredential]::new("", $token.Token).Password
    } else {
      $token.Token
    }
    
    $uri = "https://management.azure.com/subscriptions/$subscriptionId/resourceGroups/$resourceGroupName/providers/Microsoft.DomainRegistration/domains/$domainName/transferout?api-version=2021-02-01"
    
    Invoke-RestMethod `
      -Method Put `
      -Uri $uri `
      -Headers @{
        Authorization = "Bearer $accessToken"
        "Content-Type" = "application/json"
      } `
      -Body "{}"
    
    

    Also make sure the domain name is the App Service Domain resource name, for example example.com, not www.example.com.

    A few other things to check:

    • The domain may not be transferable within 60 days of new registration, registrar transfer, or registrant contact changes.
    • .uk domains are handled differently and usually require Azure Support to update the IPS tag.
    • If local PowerShell fails, try Azure Cloud Shell PowerShell to rule out local module or environment issues.

    If the API still returns DomainResellerWebService_INVALID_BODY even with body {}, then it is likely a backend/domain-reseller issue and should be raised with Azure Support.The important fix is to send an explicit empty JSON body.

    Was this answer helpful?

    1 person found this answer helpful.

  2. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

  3. Aditya N 3,810 Reputation points Microsoft External Staff Moderator
    2026-08-12T12:10:36.3366667+00:00

    Hello @Thomas Kwaks

    Thank you for reaching out Microsoft Q&A.

    As you're using powershell, please could you use

    Invoke-AzRestMethod -Path "/subscriptions/<SUBSCRIPTION-ID>/resourceGroups/<RESOURCE-GROUP-NAME>/providers/Microsoft.DomainRegistration/domains/<DOMAIN-NAME>/transferout?api-version=2021-02-01" -Method PUT

    Upon successful response, you can find the authcode under properties.

    However please ensure that your domain lock should be off and domain registration has crossed 60 days.

    Also please domain privacy is disabled as it is needed for domain transfer. You can find the attribute below

    Azure Portal > App Service Domain > Advanced management (preview) > Domain privacy

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.