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

Failed to add custom domain to SWA with error message: Name <var> is not valid. #923

Open
deathmarine opened this issue Sep 16, 2022 · 3 comments

Comments

@deathmarine
Copy link

Describe the bug
CNAME record is generated in Azure DNS while an error message is displayed in the portal.

To Reproduce
Steps to reproduce the behavior:

  1. Go to Portal
  2. Click on Custom Domains ->Add
  3. Enter subdomain
  4. See error
  5. Navigate to Azure DNS
  6. See CNAME Record

Expected behavior
A clear and concise description of what you expected to happen.
Not create the CNAME record and clearly describe the error.

Screenshots
If applicable, add screenshots to help explain your problem.

Adding the custom domain requires the FQDN and errors if the subdomain is provided.
image
However, the CNAME record is generated if using Azure DNS.
image

Behavior
Adding the FQDN resolves the issue.

Additional context
Add any other context about the problem here.

@ggoodro
Copy link

ggoodro commented Sep 20, 2022

I was having a similar error. There is some validation that needs to happen on the root domain. See this article:
https://learn.microsoft.com/en-us/azure/static-web-apps/apex-domain-azure-dns

I had to first configure my root/apex domain with the Custom Domains tool. In your case, you need to enter your root domain name where it says Domain Name...not the name of a subdomain you're trying to configure. Once your root domain is validated as a custom domain, I believe you can create subdomains just using the DNS zone page, though I haven't tried this fully myself yet.

Even though you might have a DNS zone set up, it's not validated and fully configured until these validations happen. You have to take a string they give you and create a TXT record in your DNS zone to prove you have proper access to your own domain.

Read the article above for more details!

@mkarmark
Copy link
Collaborator

Hi, can you try entering test. to see if that works? I believe the confusion comes from how our portal messages the fields.

@jacobgarder
Copy link

jacobgarder commented Jan 9, 2023

Yes, the portal is a bit confusing.
The FQDN is needed as domain name and zone is parent. Eg:
domain: test.mydomain.com
DNS zone: mydomain.com

You cannot only specify "test" as domain in this case.
The error message should be something indicating that the FQDN must be specified.

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

4 participants