Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Cannot generate TXT validation code if custom domain is already used #609

Open
sinedied opened this issue Oct 12, 2021 · 7 comments
Open

Comments

@sinedied
Copy link
Member

Describe the bug

I'm trying to migrate a custom domain I own, currently used on a SWA created for a test environment, to another SWA used for production.

When I'm trying to generate the TXT validation code in the production SWA, I get this error:
image

The error exists whether CNAME or TXT validation was used previously on the other (test) SWA.
TXT validation use case was specifically to avoid issues like this to allow for async validation scenarios without downtime, but in the case of SWA to SWA domain name transfer it's broken.

This is VERY problematic as the only workaround is to remove the custom domain from the old SWA (test), way for the DNS to be updated (takes 24-48h), then generate then TXT validation codes on the new SWA (production), with the validation taking 24-48h due to DNS propagation.

That means a lot of forced downtime, just to simply transfer a domain name usage.

Expected behavior
You should be able to generate TXT validation code for custom domains in SWA whether the domain name is already used or not. Then you can do the DNS migration without downtime.

@ghost
Copy link

ghost commented Mar 19, 2023

Were you able to come up with a solution for this?

@sinedied
Copy link
Member Author

Nope, AFAIK this is still an issue. My workaround was to delete the link on the old domain, wait 48h and link the one.
Not a critical production app so I could live with 48h downtime, but that may not be the case for every website 😞

@Xitric
Copy link

Xitric commented Aug 21, 2023

@thomasgauvin Can you verify whether it is possible (or is supposed to be possible) to issue a TXT record for a subdomain which is already in use by a different static web app?

We need to migrate our documentation site from one Azure tenant to another. As part of this process, we need to change our DNS records for the static web app, but we absolutely cannot accept several days of downtime due to high traffic on the site.

When we try to generate a code for the TXT record, we get the following error response:

{
    "message": "Failed to create custom domain",
    "error": {
        "Code": "InternalServerError",
        "Message": "Internal server error occurred. Certificate creation failed unexpectedly.",
        "Target": null,
        "Details": [
            {
                "Message": "Internal server error occurred. Certificate creation failed unexpectedly."
            },
            {
                "Code": "InternalServerError"
            },
            {
                "ErrorEntity": {
                    "ExtendedCode": "51017",
                    "MessageTemplate": "Internal server error occurred. {0}",
                    "Parameters": [
                        "Certificate creation failed unexpectedly."
                    ],
                    "Code": "InternalServerError",
                    "Message": "Internal server error occurred. Certificate creation failed unexpectedly."
                }
            }
        ],
        "Innererror": null
    },
    "resourceId": "<redacted>",
    "logLevel": "error"
}

Followed by:

{
    "message": "Failed to get custom domain",
    "error": {
        "Code": "NotFound",
        "Message": "domainName is invalid.  The domain name given was not found.",
        "Target": null,
        "Details": [
            {
                "Message": "domainName is invalid.  The domain name given was not found."
            },
            {
                "Code": "NotFound"
            },
            {
                "ErrorEntity": {
                    "ExtendedCode": "51021",
                    "MessageTemplate": "{0} is invalid.  {1}",
                    "Parameters": [
                        "domainName",
                        "The domain name given was not found."
                    ],
                    "Code": "NotFound",
                    "Message": "domainName is invalid.  The domain name given was not found."
                }
            }
        ],
        "Innererror": null
    },
    "resourceId": "<redacted>",
    "logLevel": "error"
}

Currently, the only workaround I could think of is:

  1. Migrate from the old static web app to a third-party solution
  2. Migrate from the third-party solution to the new static web app

Is it really supposed to be this convoluted?

@masonhuemmer
Copy link

Experiencing the same issue on my end.

@draganya
Copy link

Still the same!

@mwolfaardt
Copy link

Same issue here, I'm getting an error saying internal server error. Certificate creation failed unexpectedly.

@Emxm3
Copy link

Emxm3 commented May 14, 2024

Issue still persists. Is this an Azure thing? Or an internet thing?

I will try again in 12 hours rolls eyes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants