You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/static-web-apps/azure-dns-zone.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,25 +27,25 @@ The following procedure requires you to copy settings from an Azure DNS zone you
27
27
28
28
1. Select **DNS zones**.
29
29
30
-
2. Select **Create**.
30
+
1. Select **Create**.
31
31
32
-
3. In the *Basics* tab, enter the following values.
32
+
1. In the *Basics* tab, enter the following values.
33
33
34
34
| Property | Value |
35
35
|---|---|
36
36
| Subscription | Select your Azure subscription. |
37
37
| Resource group | Select to create a resource group. |
38
38
| Name | Enter the domain name for this zone. |
39
39
40
-
4. Select **Review + Create**.
40
+
1. Select **Review + Create**.
41
41
42
-
5. Select **Create** and wait for the zone to provision.
42
+
1. Select **Create** and wait for the zone to provision.
43
43
44
-
6. Select **Go to resource**.
44
+
1. Select **Go to resource**.
45
45
46
46
With the DNS zone created, you now have access to Azure's DNS name servers for your application.
47
47
48
-
7. From the *Overview* window, copy the values for all four name servers listed as **Name server 1** to **Name server 4** and set them aside in a text editor for later use.
48
+
1. From the *Overview* window, copy the values for all four name servers listed as **Name server 1** to **Name server 4** and set them aside in a text editor for later use.
Copy file name to clipboardExpand all lines: articles/static-web-apps/custom-domain-azure-dns.md
+24-59Lines changed: 24 additions & 59 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,88 +5,53 @@ services: static-web-apps
5
5
author: craigshoemaker
6
6
ms.service: static-web-apps
7
7
ms.topic: how-to
8
-
ms.date: 02/11/2021
8
+
ms.date: 05/30/2024
9
9
ms.author: cshoe
10
10
---
11
11
12
12
# Set up a custom domain with Azure DNS in Azure Static Web Apps
13
13
14
-
By default, Azure Static Web Apps provides an auto-generated domain name for your website, but you can point a custom domain to your site. Free SSL/TLS certificates are automatically created for the auto-generated domain name and any custom domains you may add.
14
+
By default, Azure Static Web Apps provides an autogenerated domain name for your website, but you can point a custom domain to your site. Free SSL/TLS certificates are automatically created for the autogenerated domain name and any custom domains you may add.
15
15
16
-
This guide demonstrates how to configure your domain name with the `www` subdomain. Once this procedure is complete, you can set up an [apex domain](apex-domain-azure-dns.md).
16
+
Suppose you buy the domain `example.com` from a domain name registrar and then create a zone with the name `example.com` in Azure DNS. You want `www.example.com` to point to your Static Web Apps site.
17
17
18
-
The following procedure requires you to copy settings from an Azure DNS zone you create and your existing static web app. Consider opening the Azure portal in two different windows to make it easier to switch between the two services.
18
+
- If you're using an apex domain (a domain without a subdomain, also known as a root domain), see [configuring a custom apex domain with Azure DNS](apex-domain-azure-dns.md).
19
+
- If you're using an external DNS provider, see [configuring a custom domain with external DNS](custom-domain-external.md) or [configuring a custom apex domain with external DNS](apex-domain-external.md).
19
20
20
21
## Prerequisites
21
22
22
-
- A custom domain
23
-
- An existing Azure DNS zone
24
-
- If you don't already have one, refer to [Delegate your domain to Azure DNS](azure-dns-zone.md)
23
+
- A domain purchased from a domain name registrar and hosted on Azure DNS. For details, see [Delegate your domain to Azure DNS](/azure/dns/dns-delegate-domain-azure-dns).
25
24
26
25
## Map the domain to your website
27
26
28
-
Now that your domain is configured for Azure to manage the DNS, you can now link your DNS zone to your static web app.
27
+
Now that your domain is hosted on Azure DNS, you can create a CNAME record for `www.<your domain>` to point to your Static Web App.
29
28
30
-
### Get static web app URL
29
+
1. Sign in to the [Azure portal](https://portal.azure.com).
31
30
32
-
1.Open the [Azure portal](https://portal.azure.com).
31
+
1.Enter the name of your Static Web App in the top search bar, or find the Static Web App in your resources.
33
32
34
-
1.Go to your static web app.
33
+
1.Under **Settings**, select **Custom domains**.
35
34
36
-
1.From the *Overview* window, copy the generated **URL** of your site and set it aside in a text editor for future use.
35
+
1.Select **+ Add**, then select **Custom domain on Azure DNS**.
37
36
38
-
### Create DNS records in Azure DNS
37
+
1. Enter the following values in the *Add custom domain on Azure DNS* window.
39
38
40
-
1. Return to the DNS zone you created in the Azure portal.
39
+
| Field name | Value |
40
+
| --- | --- |
41
+
| DNS zone | Select your domain name hosted on Azure DNS |
42
+
| Subdomain |**www**|
41
43
42
-
2. Select **+ Record set**.
44
+
The *Full domain* is updated and should match the desired custom domain name.
43
45
44
-
3. Enter the following values in the *Add record set* window.
46
+
1. Select **Add**
45
47
46
-
| Setting | Property |
47
-
|---|---|
48
-
| Name | Enter **www**|
49
-
| Type | Select **CNAME - Link your subdomain to another account**|
50
-
| Alias record set | Select **No**. |
51
-
| TTL | Keep default value. |
52
-
| TTL unit | Keep default value. |
53
-
| Alias | Paste in the Static Web Apps generated URL you set aside in a previous step. Make sure to remove the `https://` prefix from your URL. |
54
-
55
-
Additionally, you can select **Yes** for **Alias record set** and select your static web app instead of explicitly providing the URL to take advantage of alias record sets like [prevention from dangling DNS records](/azure/dns/dns-alias#prevent-dangling-dns-records).
48
+
Static Web Apps makes the necessary adjustments to the DNS zone (including adding a CNAME), then validates the changes are available in the global DNS system.
56
49
57
-
4. Select **OK**.
50
+
> [!WARNING]
51
+
> If you receive the message *CNAME Record is invalid*, then check that your DNS zone lists the Microsoft DNS services with your DNS registrar. If you have recently moved the domain to Azure DNS, you may need to wait for DNS propagation before adding the custom domain.
58
52
59
-
### Configure static web app custom domain
53
+
##Validate the custom domain
60
54
61
-
1. Return to your static web app in the portal.
55
+
It may take some time for the DNS changes to propagate. The default time for Azure DNS is 1 hour.
62
56
63
-
1. Under *Settings*, select **Custom domains**.
64
-
65
-
2. Select **+ Add**.
66
-
67
-
3. In the *Subdomain* box, enter your subdomain name (*i.e.*, **www**). The **Full domain** field should then display the name of your custom domain, including subdomain.
68
-
69
-
> [!NOTE]
70
-
> If you have delegated your domain to Azure DNS, and also elected to *Add custom domain on Azure DNS* when configuring your custom domain, you will have the option to select the *Azure DNS zone*. The following steps will then be performed automatically for you after you select **Add**.
71
-
72
-
4. Select **Next**.
73
-
74
-
5. In the *Validate + add* tab, enter the following values.
75
-
76
-
| Setting | Value |
77
-
|---|---|
78
-
| Domain name | This value should match the domain name you entered in the previous step (with the `www` subdomain). |
79
-
| Hostname record type | Select **CNAME**. |
80
-
81
-
6. Select **Add**.
82
-
83
-
If you get an error saying that the action is invalid, wait 5 minutes and try again.
84
-
85
-
7. Open a new browser tab and go to your domain with the `www` subdomain.
86
-
87
-
After the DNS records are updated, you should see your static web app in the browser. Also, inspect the location to verify that your site is served securely using `https`.
88
-
89
-
## Next steps
90
-
91
-
> [!div class="nextstepaction"]
92
-
> [Set up the apex domain in Azure DNS](apex-domain-azure-dns.md)
57
+
Open a new browser and go to your domain (for example, `https://www.example.com`). Inspect the location to verify that your site is served securely using `https`.
Copy file name to clipboardExpand all lines: articles/static-web-apps/custom-domain-external.md
+14-18Lines changed: 14 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,24 +5,25 @@ services: static-web-apps
5
5
author: craigshoemaker
6
6
ms.service: static-web-apps
7
7
ms.topic: how-to
8
-
ms.date: 10/13/2022
8
+
ms.date: 05/29/2024
9
9
ms.author: cshoe
10
10
---
11
11
12
12
# Set up a custom domain in Azure Static Web Apps
13
13
14
-
By default, Azure Static Web Apps provides an auto-generated domain name for your website, but you can point a custom domain to your site. Free SSL/TLS certificates automatically get created for the auto-generated domain name and any custom domains that you might add. This article shows how to configure your domain name with the `www` subdomain, using an external provider.
14
+
By default, Azure Static Web Apps provides an autogenerated domain name for your website, but you can point a custom domain to your site. Free SSL/TLS certificates automatically get created for the autogenerated domain name and any custom domains that you might add. This article shows how to configure your domain name with the `www` subdomain, using an external provider.
15
15
16
-
> [!NOTE]
17
-
> Static Web Apps doesn't support set-up of a custom domain with a private DNS server, hosted on-premises. Consider using an [Azure Private DNS zone](../dns/private-dns-privatednszone.md).
18
-
## Prerequisites
16
+
There are multiple methods of configuring a custom domain for use with Static Web Apps:
19
17
20
-
- Consider how you want to support your apex domain. Domain names without a subdomain are known as apex root domains. For example, the domain `www.example.com` is the `www` subdomain joined with the `example.com` apex domain.
21
-
22
-
- You create an apex domain by configuring an `ALIAS` or `ANAME` record or flattening `CNAME`. Some domain registrars, like GoDaddy and Google, don't support these DNS records. If your domain registrar doesn't support all the DNS records you need, consider using [Azure DNS to configure your domain](custom-domain-azure-dns.md).
18
+
- If you're using an apex domain (a domain without a subdomain, also known as a root domain), see [configuring a custom apex domain on Static Web Apps](apex-domain-external.md).
19
+
- If you're using Azure DNS, see [configuring a custom domain with Azure DNS](custom-domain-azure-dns.md) or [configuring a custom apex domain with Azure DNS](apex-domain-azure-dns.md).
23
20
24
21
> [!NOTE]
25
-
> If your domain registrar doesn't support specialized DNS records and you don't want to use Azure DNS, you can forward your apex domain to the `www` subdomain. For more information, see [Set up an apex domain in Azure Static Web Apps](apex-domain-external.md).
22
+
> Static Web Apps doesn't support set-up of a custom domain with a private DNS server, hosted on-premises. Consider using an [Azure Private DNS zone](../dns/private-dns-privatednszone.md).
23
+
24
+
## Prerequisites
25
+
26
+
- You must be able to create a **CNAME** record on your DNS domain using the tools that your DNS service or domain registrar provides.
26
27
27
28
## Watch the video
28
29
@@ -38,7 +39,7 @@ By default, Azure Static Web Apps provides an auto-generated domain name for you
38
39
39
40
## Create a CNAME record on your domain registrar account
40
41
41
-
Domain registrars are the services you can use to purchase and manage domain names. Common providers include GoDaddy, Namecheap, Google, Tucows, and the like.
42
+
Domain registrars are services you can use to purchase and manage domain names. To find a domain registrar, see the [ICANN list of accredited registrars](https://www.icann.org/en/accredited-registrars).
42
43
43
44
1. Open a new browser tab and sign in to your domain registrar account.
44
45
@@ -66,7 +67,7 @@ Domain registrars are the services you can use to purchase and manage domain nam
66
67
For instance, if your domain name is `example.com`, enter `www.example.com`.
67
68
:::image type="content" source="media/custom-domain/add-domain.png" alt-text="Screenshot showing sequence of steps in add custom domain form.":::
68
69
69
-
1. In the *Validate + Configure* tab, enter the following values.
70
+
1. In the *Validate + add* tab, enter the following values.
70
71
71
72
| Setting | Value |
72
73
|---|---|
@@ -75,13 +76,8 @@ Domain registrars are the services you can use to purchase and manage domain nam
75
76
76
77
1. Select **Add**.
77
78
78
-
Azure creates your `CNAME` record and updates the DNS settings. Since DNS settings need to propagate, this process can take up to an hour or longer to complete.
79
+
Azure validates that the CNAME record was created correctly and is available in the global DNS system. Propagation depends on the time to live (TTL) for your domain and may take several days. If the validation fails, return to add the custom domain later.
79
80
80
81
1. When the update completes, open a new browser tab and go to your domain with the `www` subdomain.
81
82
82
-
You should see your static web app in the browser. Also, inspect the location to verify that your site is served securely using `https`.
83
-
84
-
## Next steps
85
-
86
-
> [!div class="nextstepaction"]
87
-
> [Set up the apex domain](apex-domain-external.md)
83
+
You should see your static web app in the browser. Inspect the location to verify that your site is served securely using `https`.
0 commit comments