[Issue] Figure out flow for custom domain names
- Dominant language
- Go
- Stars
- 569
- Forks
- 364
- Avg merge
- 2d 22h
- Merged PRs (30d)
- 139
Description
- [X] Make sure you've installed the latest version using [instructions in the wiki](../wiki/install)
**Output from `azd version`**
azd version 0.7.0-beta.1 (commit 9ce71659f7688d0dc3dda8b84e5accedca58cf01)
**Describe the bug**
Everything is working as currently designed, so this is more a bug in the process than the code.
I would like to be able to use azd to deploy a website that has a custom domain attached (on Static Web Apps, App Service, or Container Apps). However, if I specify a domain name in Bicep using 'Microsoft.Web/staticSites/customDomains@2022-03-01' that has not yet been verified, then I get an error during the provision stage. I cannot verify a domain name until I know the website endpoint, however, since the DNS record is a CNAME for 'www' with the value of the website endpoint.
This is how I ended up doing it for my personal website, www.pamelafox.org:
1) I set up the infra with domainName as a parameter defaulting to empty string, and only conditionally create the custom domain if the parameter is non-empty:
https://github.com/pamelafox/pamelafox-site/blob/main/infra/swa.bicep#L24
2) I then run `azd up` with domainName still empty in main.parameters.json
3) When I see the deployed endpoint URI, I go to my registrar and add a CNAME of www->endpoint
and wait a few minutes
4) I set domainName in main.parameters.json and re-deploy.
That seemed to work, but it's possible that I also intervened in the Portal in between those steps.
Maybe there'd be a more straightforward approach if I used Azure's registrar? I already have a registrar I pay for, so I set it up there.
Contributor guide
Research direction
Start with the azd up provisioning flow and the conditional custom-domain pattern shown in infra/swa.bicep, using main.parameters.json and the Static Web Apps, App Service, and Container Apps cases as context. Done means defining a straightforward azd flow that lets users obtain the endpoint, verify DNS, and then attach the custom domain without manual uncertainty.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure
- Domain
- cli, cloud
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100