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/app-service/app-service-web-tutorial-custom-domain.md
+38-32Lines changed: 38 additions & 32 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,15 +28,15 @@ The DNS record type you need to add with your domain provider depends on the dom
28
28
29
29
*[Create an App Service app](./index.yml), or use an app that you created for another tutorial. The web app's [App Service plan](overview-hosting-plans.md) must be a paid tier and not **Free (F1)**. See [Scale up an app](manage-scale-up.md#scale-up-your-pricing-tier) to update the tier.
30
30
* Make sure you can edit the DNS records for your custom domain. To edit DNS records, you need access to the DNS registry for your domain provider, such as GoDaddy. For example, to add DNS entries for `contoso.com` and `www.contoso.com`, you must be able to configure the DNS settings for the `contoso.com` root domain. Your custom domains must be in a public DNS zone; private DNS zone is only supported on Internal Load Balancer (ILB) App Service Environment (ASE).
31
-
* If you don't have a custom domain yet, you can [purchase an App Service domain](manage-custom-dns-buy-domain.md).
31
+
* If you don't have a custom domain yet, you can [purchase an App Service domain](manage-custom-dns-buy-domain.md) instead.
32
32
33
33
## 1. Configure a custom domain
34
34
35
35
1. In the [Azure portal](https://portal.azure.com), navigate to your app's management page.
36
36
1. In the left menu for your app, select **Custom domains**.
37
37
1. Select **Add custom domain**.
38
38
39
-
:::image type="content" source="./media/app-service-web-tutorial-custom-domain/add-custom-domain.png" alt-text="A screenshot showing how to open the Add custom domain dialog.":::
39
+
:::image type="content" source="./media/app-service-web-tutorial-custom-domain/add-custom-domain.png" alt-text="A screenshot showing how to open the Add custom domain dialog." border="true":::
40
40
41
41
1. For **Domain provider**, select **All other domain services** to configure a third-party domain.
42
42
@@ -57,84 +57,90 @@ The DNS record type you need to add with your domain provider depends on the dom
57
57
58
58
The following screenshot shows the default selections for a `www.contoso.com` domain, which shows a CNAME record and a TXT record to add.
59
59
60
-
:::image type="content" source="./media/app-service-web-tutorial-custom-domain/configure-custom-domain.png" alt-text="A screenshot showing how to configure a new custom domain, along with a managed certificate.":::
60
+
:::image type="content" source="./media/app-service-web-tutorial-custom-domain/configure-custom-domain.png" alt-text="A screenshot showing how to configure a new custom domain, along with a managed certificate." border="true":::
61
61
62
62
> [!WARNING]
63
63
> While it's not absolutely required to add the TXT record, it's highly recommended for security. The TXT record is a *domain verification ID* that helps avoid subdomain takeovers from other App Service apps. For custom domains you previously configured without this verification ID, you should protect them from the same risk by adding the verification ID (the TXT record) to your DNS configuration. For more information on this common high-severity threat, see [Subdomain takeover](../security/fundamentals/subdomain-takeover.md).
64
64
65
+
<aname="a"aria-hidden="true"></a>
66
+
67
+
<aname="enable-a"aria-hidden="true"></a>
68
+
69
+
<aname="wildcard"aria-hidden="true"></a>
70
+
71
+
<aname="cname"aria-hidden="true"></a>
72
+
65
73
## 2. Create the DNS records
66
74
67
75
[!INCLUDE [Access DNS records with domain provider](../../includes/app-service-web-access-dns-records-no-h.md)]
68
76
69
77
Select the type of record to create and follow the instructions. You can use either a [CNAME record](https://en.wikipedia.org/wiki/CNAME_record) or an [A record](https://en.wikipedia.org/wiki/List_of_DNS_record_types#A) to map a custom DNS name to App Service.
70
78
71
-
# [A](#tab/a)
79
+
# [Root domain (e.g. contoso.com)](#tab/root)
80
+
81
+
Create two records according to the following table:
82
+
83
+
| Record type | Host | Value | Comments |
84
+
| - | - | - | - |
85
+
| A |`@`| The app's IP address shown in the **Add custom domain** dialog. | The domain mapping itself (`@` typically represents the root domain). |
86
+
| TXT |`asuid`| The domain verification ID shown in the **Add custom domain** dialog. | For root domain, App Service accesses `asuid` TXT record to verify your ownership of the custom domain. |
72
87
73
-
- For a root domain like `contoso.com`, create two records according to the following table:
88
+

74
89
75
-
| Record type | Host | Value | Comments |
76
-
| - | - | - |
77
-
| A |`@`| The app's IP address shown in the **Add custom domain** dialog. | The domain mapping itself (`@` typically represents the root domain). |
78
-
| TXT |`asuid`| The domain verification ID shown in the **Add custom domain** dialog. | For root domain, App Service accesses `asuid` TXT record to verify your ownership of the custom domain. |

92
+
# [With an A record](#tab/subdomain/a)
81
93
82
-
- To map a subdomain like `www.contoso.com` with an A record instead of a recommended CNAME record, your A record and TXT record should look like the following table instead:
94
+
Create two records according to the following table:
83
95
84
-
|Record type|Host|Value|Comments|
85
-
|--- |--- |--- |--- |
86
-
|A|\<subdomain\> (for example, www)|IP address shown in the **Add custom domain** dialog.||
87
-
|TXT|asuid.\<subdomain\> (for example, asuid.www)|The domain verification ID shown in the **Add custom domain** dialog.||
96
+
|Record type|Host|Value|Comments|
97
+
|--- |--- |--- |--- |
98
+
|A|\<subdomain\> (for example, www)|IP address shown in the **Add custom domain** dialog.| The domain mapping itself. |
99
+
|TXT|asuid.\<subdomain\> (for example, asuid.www)|The domain verification ID shown in the **Add custom domain** dialog.| App Service accesses the `asuid.<subdomain>` TXT record to verify your ownership of the custom domain. |
88
100
89
-

101
+

90
102
91
-
# [CNAME](#tab/cname)
103
+
# [With a CNAME record](#tab/subdomain/cname)
92
104
93
-
For a subdomain like `www` in `www.contoso.com`, create two records according to the following table:
105
+
Create two records according to the following table:
94
106
95
107
| Record type | Host | Value | Comments |
96
108
| - | - | - |
97
109
| CNAME |`<subdomain>` (for example, `www`) |`<app-name>.azurewebsites.net`| The domain mapping itself. |
98
-
| TXT |`asuid.<subdomain>` (for example, `asuid.www`) | The verification ID shown in the **Add custom domain** dialog. | App Service accesses the `asuid.<subdomain>` TXT record to verify your ownership of the custom domain. |
110
+
| TXT |`asuid.<subdomain>` (for example, `asuid.www`) | The domain verification ID shown in the **Add custom domain** dialog. | App Service accesses the `asuid.<subdomain>` TXT record to verify your ownership of the custom domain. |
99
111
100
112

101
113
114
+
---
115
+
102
116
# [Wildcard (CNAME)](#tab/wildcard)
103
117
104
118
For a wildcard name like `*` in `*.contoso.com`, create two records according to the following table:
105
119
106
120
| Record type | Host | Value | Comments |
107
-
| - | - | - |
121
+
| - | - | - | - |
108
122
| CNAME |`*`|`<app-name>.azurewebsites.net`| The domain mapping itself. |
109
123
| TXT |`asuid`| The domain verification ID shown in the **Add custom domain** dialog. | App Service accesses the `asuid` TXT record to verify your ownership of the custom domain. |
110
124
111
125

112
126
113
-
-----
114
-
115
-
<aname="a"aria-hidden="true"></a>
116
-
117
-
<aname="enable-a"aria-hidden="true"></a>
118
-
119
-
<aname="wildcard"aria-hidden="true"></a>
120
-
121
-
<aname="cname"aria-hidden="true"></a>
127
+
---
122
128
123
129
## 3. Validate and complete
124
130
125
131
1. Back in the **Add custom domain** dialog in the Azure portal, select **Validate**.
126
132
127
-
:::image type="content" source="./media/app-service-web-tutorial-custom-domain/configure-custom-domain-validate.png" alt-text="A screenshot showing how to validate your DNS record settings in the Add a custom domain dialog.":::
133
+
:::image type="content" source="./media/app-service-web-tutorial-custom-domain/configure-custom-domain-validate.png" alt-text="A screenshot showing how to validate your DNS record settings in the Add a custom domain dialog." border="true":::
128
134
129
135
1. If the **Domain validation** section shows green check marks next for both domain records, then you've configured them correctly. Select **Add**. If it shows any red X, fix any errors in the DNS record settings in your domain provider's website.
130
136
131
-
:::image type="content" source="./media/app-service-web-tutorial-custom-domain/configure-custom-domain-add.png" alt-text="A screenshot showing the Add button activated after validation.":::
137
+
:::image type="content" source="./media/app-service-web-tutorial-custom-domain/configure-custom-domain-add.png" alt-text="A screenshot showing the Add button activated after validation." border="true":::
132
138
133
139
1. You should see the custom domain added to the list. You may also see a red X with **No binding**.
134
140
135
141
If you selected **App Service Managed Certificate** earlier, wait a few minutes for App Service to create the managed certificate for your custom domain. When the process is complete, the red X becomes a green check mark with **Secured**. If you selected **Add certificate later**, this red X will remain until you [add a private certificate for the domain](configure-ssl-certificate.md) and [configure the binding](configure-ssl-bindings.md).
136
142
137
-
:::image type="content" source="./media/app-service-web-tutorial-custom-domain/add-custom-domain-complete.png" alt-text="A screenshot showing the custom domains page with the new secured custom domain.":::
143
+
:::image type="content" source="./media/app-service-web-tutorial-custom-domain/add-custom-domain-complete.png" alt-text="A screenshot showing the custom domains page with the new secured custom domain." border="true":::
138
144
139
145
> [!NOTE]
140
146
> Unless you configure a certificate binding for your custom domain, Any HTTPS request from a browser to the domain will receive an error or warning, depending on the browser.
0 commit comments