Custom domain stuck in 'Deleting' state on Azure Static Web App — cannot remove or re-add

Mikael Mib Barnholdt 0 Reputation points
2026-06-14T15:18:57.9666667+00:00

A custom domain (apex/root domain) has been stuck in 'Deleting' status for over 24 hours on my Static Web App.

All attempts to remove it have failed. Steps tried: - Deleted via Azure Portal — shows 'Deleting' indefinitely - az staticwebapp hostname delete via CLI — returns 'OK' but domain remains - az rest --method delete against ARM API — same result - az staticwebapp hostname set to re-add — fails with 'Apex Domains must use dns-txt-token as the ValidationMethod' The domain cannot be deleted or re-added.

This appears to require backend intervention from the product team, as seen in this similar case: https://learn.microsoft.com/en-us/answers/questions/2167796/unable-to-delete-custom-domain-from-static-web-app

Could someone from the product team assist with clearing this stuck entry?

Azure Static Web Apps
Azure Static Web Apps

An Azure service that provides streamlined full-stack web app development.


2 answers

Sort by: Most helpful
  1. Praneeth Maddali 11,190 Reputation points Microsoft External Staff Moderator
    2026-06-22T01:00:24.2366667+00:00

    HI @Mikael Mib Barnholdt

    I am glad that your issue is resolved thanks for confirming from the private message

    Thanks for the details from deep investigation . I can see XXXXX.com (the apex domain) is stuck in Deleting status with an Expired error code, while using the older http-token validation method. The www subdomain looks healthy, which is typical in these cases.

    This is a known situation with Static Web Apps, especially for long-standing apex domains. When the http-token renewal fails and deletion gets into a bad state, the backend sometimes holds onto the binding even though Portal/CLI/ARM operations report success. Client-side retries usually don't clear it at that point

    Quick things to try first

    1. Clean up DNS completely — Remove any A, ALIAS, CNAME, or TXT records for bifrostpixel.com at your registrar.
    2. Wait 15–30 minutes, then refresh the Custom Domains page and try deleting again.
    3. If you have the environment name (), try the CLI with it:
            az staticwebapp hostname delete \    --name BXXXXXXtpixelHomePage \    --resource-group [YourResourceGroup] \    --hostname XXXXXXXX.com \    --environment-name red-ocean-XXXXXXXX
      

     Please do not forget to click "Accept the answer” and Yes, this can be beneficial to other community members.

    If you have any other questions, let me know in the "comments" and I would be happy to help you

    Was this answer helpful?

    1 person found this answer helpful.

  2. AI answer

    2026-06-14T15:19:19.1866667+00:00

    The domain entry is stuck because Azure enforces that a custom domain can only be bound to a single resource and must be fully disassociated before it can be reused. When a delete operation gets into a bad state, client-side retries (Portal, CLI, az rest) cannot clear the backend association.

    From the available guidance, the only supported way to resolve a custom domain that is still logically bound to a resource but cannot be managed anymore is to have Azure Support manually unbind it. This is the same pattern used when a domain is still linked to another app or to a resource that is no longer accessible:

    1. Open a support ticket in Azure Portal.
    2. Clearly state that:
      • The custom domain is in Deleting for more than 24 hours on an Azure Static Web App.
      • Portal, az staticwebapp hostname delete, and direct ARM DELETE calls all report success but the domain remains.
      • The domain cannot be re-added due to the validation requirement and the existing stuck binding.
    3. Be prepared to prove ownership of the domain if requested (this is standard when Azure manually releases a domain binding).
    4. Ask support to manually remove the custom domain binding from the Static Web App slice/backend so the domain can be added again.

    For future migrations or reassignments of the same domain between Static Web Apps:

    • Ensure the domain is completely removed from the original Static Web App before adding it to another one in the same slice. Azure Static Web Apps only permit binding a unique domain to a single resource within a slice; otherwise, binding fails.
    • If both apps are in the same slice and the domain must be moved without downtime, either:
      • Remove the domain from the old instance, then add it to the new one (accepting downtime), or
      • Delete and redeploy the new instance until it lands in a different slice, then bind the domain there.

    If the stuck state is due to a previously deleted or inaccessible resource, the same support path applies: Azure Support can manually unbind a locked domain that is still tied to a resource that cannot be managed.


    References:

    AI-generated content may be incorrect. Read our transparency notes for more information.

    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.