Azure Static Web Apps cannot reuse custom hostname from an inaccessible expired subscription

Lionel Staal 20 Reputation points
2026-08-03T09:00:53.42+00:00

Service

Azure Static Web Apps

Objective

I need to bind the following subdomain to a newly created Azure Static Web App:

XXXXXXXXXXXXXXXXXXXXXXXXXX

The new Static Web App is:

  • Name: mta-sts-edge
  • Resource group: Static_Web_Resources
  • Current default hostname: thankful-cliff-0f5be6610.7.azurestaticapps.net
  • DNS provider: external provider, not Azure DNS

Background

Several months ago, I successfully attached the same custom hostname, XXXXXXXXXXX to another Azure Static Web App created under a 30-day Azure free-trial subscription.

I did not convert that free-trial subscription to pay-as-you-go when it expired. The old subscription and the old Static Web App are no longer visible or accessible in the Azure portal or Azure CLI.

I have since created a new pay-as-you-go subscription and the replacement Static Web App identified above.

Current error

In the new Static Web App, I open:

Settings > Custom domains > Add > Custom domain on other DNS

I enter:

XXXXXXXXXXXXXX

I select TXT validation and then select Generate code.

Azure immediately returns:

domainName is invalid. The domain name given was not found.

Azure does not generate the TXT validation value.

Troubleshooting already performed

I used Azure Cloud Shell to:

  1. Run az account list.
  2. Confirm that only the current active subscription is accessible.
  3. Run az staticwebapp list.
  4. Confirm that only the new Static Web App is visible.
  5. Run az staticwebapp hostname list against every visible Static Web App.
  6. Confirm that XXXX is not attached to any Static Web App visible in the current subscription.

The GitHub deployment to the new Static Web App is operational through its Azure-generated hostname.

I own and control the authoritative DNS zone for liXXXXXXXXXXXXting.lu and can create a temporary TXT record to prove domain ownership if requested.

Suspected cause

The hostname may still have an orphaned Azure Static Web Apps backend association with the Static Web App from the expired and now-inaccessible free-trial subscription.

Microsoft documentation states that Azure Static Web Apps permits a custom domain to be bound to only one Static Web Apps resource within a slice and that the domain must first be disassociated from the original resource before reuse.

Assistance requested

Could a Microsoft representative please confirm whether mta-XXXXXXXXXXXXsulting.lu remains associated with an inaccessible Static Web App from the expired subscription?

If an orphaned association exists, I need assistance escalating the case to the appropriate Azure support team so that the previous custom-domain binding can be released from the Azure Static Web Apps backend.

I can provide the current subscription ID, tenant ID, and proof of DNS ownership privately through an official support channel. I have deliberately not included those identifiers in this public Q&A post.

Azure Static Web Apps
Azure Static Web Apps

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

0 comments No comments

Answer accepted by question author
Allan Solomon Mejia 3,670 Reputation points
2026-08-03T19:47:46.2166667+00:00

Hello @Lionel Staal

Thanks for the detailed description.

If the custom hostname has already been removed from the previous Azure Static Web App but Azure still reports that it cannot be reused, it often indicates that the hostname binding hasn't been fully released by the platform yet rather than an issue with your DNS configuration.

A few things worth checking are:

  • Verify that the hostname is no longer associated with any Azure resource (Static Web App, App Service, Front Door, or CDN endpoint) within the subscription or another subscription/tenant.
  • Confirm that the public DNS records (CNAME, ALIAS, or TXT) reflect the current intended configuration and that any stale records have fully propagated.
  • If the hostname was only recently removed, allow additional time for the backend to complete the cleanup, as hostname bindings may take longer than DNS propagation to be released.

If you've already confirmed that:

  • the hostname is no longer bound to any Azure resource,
  • DNS is correct, and
  • the issue persists after sufficient propagation time,

then this is likely a stale backend hostname reservation. A Microsoft moderator may need to engage the Azure Static Web Apps engineering team to verify and clear the orphaned hostname binding so it can be reused. Similar cases involving stuck custom domain bindings have required backend intervention.

It would also help to include:

  • the custom hostname (or a masked version),
  • the Azure region,
  • the approximate time the hostname was removed,
  • and the correlation ID or Activity Log entry for the failed binding attempt, as these can assist the engineering team in locating the stale record.

Please "Accept the Answer" if this information helped you. This will help us and others in the community as well.

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Lionel Staal 20 Reputation points
    2026-08-04T10:48:14.4833333+00:00

    Hi @Allan Solomon Mejia , hi @Praneeth Maddali ,

    Wow.

    I am quite used to Microsoft interfaces shenanigans in Azure and elsewhere (e.g., waiting the longest minutes of your life without blinking and almost without breathing that a quick-flashing popup in the upper-right corner confirms or denies your action and if you did not desperately hit the PrintScreen button at this very second to just be able to read the displayed error message later, oh gosh you are so done), so I had already searched everywhere in Azure if another resource was in the way, and I had also immediately set the DNS TXT record '_mta-sts' to a new value "v=STSv1; id=20260801T1931" alongside the new value of the 'mta-sts' CNAME record.

    But I have so much work on my plate (still waiting for a government decree finally putting 50 or 60 hours in a day instead of only 24...) that I surely have grown impatient.

    Or someone silently did something in the background.

    Because I just tried again to add my custom domain some minutes ago, and, besides a quick-displayed error message on a missing CAA record (Nobel Prize to the PrintScreen inventor), it never told me again that the domain name 'mta-sts.liajocom-consulting.lu' was not found and my custom domain got registered and validated and a Digicert certificate was issued for it in a matter of... well, long minutes with buttons turned grey and without anything moving in the interface. But it successfully went through the whole process.

    So something happened and I miraculously escaped the issue of a stale backend -- that is quite a relief.

    Anyway, thank you very much for your concern and your quick answers, they were very appreciated!

    Was this answer helpful?


  2. Praneeth Maddali 12,185 Reputation points Microsoft External Staff Moderator
    2026-08-03T21:09:52.85+00:00

    Hi @Lionel Staal

    Thanks for the detailed write-up — this is a known scenario with Azure Static Web Apps.

    Azure Static Web Apps only allow a custom domain to be bound to one resource within a given slice. When the original Static Web App lived in a free-trial subscription that later expired and became inaccessible, the hostname association can remain locked at the platform level even though the resource is no longer visible to you. That’s why you’re seeing the “domainName is invalid. The domain name given was not found” error when trying to generate the TXT validation code.

    Reference:

    https://learn.microsoft.com/en-us/azure/static-web-apps/custom-domain#migrating-domains-between-instances

    If the answer is helpful, Please do 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?

    0 comments No comments

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.