Unable to add Custom Domain to Static Web App

Nikolay Arhangelov 36 Reputation points
2022-04-10T12:23:54.507+00:00

Hello,

I am facing a problem with assigning a custom domain to a Static Web App.

I initially created an app and added a custom domain like app.mydomain.com and generated a TXT verification code.
Afterwards, the domain vas in a verifying state, at which point I clicked on Set default in the list of domains.
Some time passed and the domain disappeared from the list.
Trying to add it again failed.
I deleted the Static Web App and created a new one.
Now I cannot add the same custom domain with a domainName is invalid error.
Inspecting the response reveals Request Envelope is invalid. Please ensure the custom domain is not linked to another site., even though the old site has been deleted for two days.

Issue comment I posted on GitHub: https://github.com/Azure/static-web-apps/issues/609#issuecomment-1092172473

Any help or workarounds are greatly appreciated!

Regards,
Nikolay

Azure Static Web Apps
Azure Static Web Apps
An Azure service that provides streamlined full-stack web app development.
762 questions
0 comments No comments
{count} vote

Accepted answer
  1. Ryan Hill 25,476 Reputation points Microsoft Employee
    2022-04-13T03:58:05.917+00:00

    Let me pass this along to the product team to see if they're aware of this issue @NikolayArhangelov-3344. I'll post any updates I come across.

    1 person found this answer helpful.

2 additional answers

Sort by: Most helpful
  1. Nikolay Arhangelov 36 Reputation points
    2022-04-26T13:01:55.213+00:00

    It turned out that I had assigned the custom hostname to a different app by accident. This means that even deleting the old static web app did not release the custom domain.
    I removed the custom domain from the correct app and managed to assign it to the correct one.
    Afterwards I verified using CNAME - works even for subdomains.

    All the credit goes to @Ryan Hill who did an amazing job discovering this misconfiguration!

    Marking this as answered.

    2 people found this answer helpful.
    0 comments No comments

  2. Jerry Teague 0 Reputation points
    2023-09-18T11:41:48.09+00:00

    HI, I have this exact issue. Three days ago (with no changes - no deployments), my site started getting 404s from Azure. I'm using another DNS provider (again, no changes there). I tried to set up the custom DNS, but I'm getting the same error:

    Could not add custom domain. Please ensure the custom domain is not linked to another app or that a previous implementation is not still being cleaned up.

    @Ryan Hill, sorry to link you directly, but I'm getting nowhere with this, and no-one from support is getting in touch.

    0 comments No comments