Skip to content

Commit 0248133

Browse files
authored
Merge pull request #201898 from seligj95/customdns
ASEv3 custom dns doc and updates
2 parents 3f4339a + 5bc394d commit 0248133

16 files changed

+211
-1
lines changed
Lines changed: 200 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,200 @@
1+
---
2+
title: Configure custom domain suffix for App Service Environment
3+
description: Configure a custom domain suffix for the Azure App Service Environment.
4+
author: seligj95
5+
ms.topic: tutorial
6+
ms.date: 07/05/2022
7+
ms.author: jordanselig
8+
zone_pivot_groups: app-service-environment-portal-arm
9+
---
10+
11+
# Custom domain suffix for App Service Environments
12+
13+
An App Service Environment is an Azure App Service feature that provides a fully isolated and dedicated environment for running App Service apps securely at high scale. The DNS settings for your App Service Environment's default domain suffix don't restrict your apps to only being accessible by those names. Custom domain suffix is an internal load balancer (ILB) App Service Environment feature that allows you to use your own domain suffix to access the apps in your App Service Environment.
14+
15+
If you don't have an App Service Environment, see [How to Create an App Service Environment v3](./creation.md).
16+
17+
> [!NOTE]
18+
> This article covers the features, benefits, and use cases of App Service Environment v3, which is used with App Service Isolated v2 plans.
19+
>
20+
21+
The custom domain suffix defines a root domain that can be used by the App Service Environment. In the public variation of Azure App Service, the default root domain for all web apps is *azurewebsites.net*. For ILB App Service Environments, the default root domain is *appserviceenvironment.net*. However, since an ILB App Service Environment is internal to a customer's virtual network, customers can use a root domain in addition to the default one that makes sense for use within a company's internal virtual network. For example, a hypothetical Contoso Corporation might use a default root domain of *internal-contoso.com* for apps that are intended to only be resolvable and accessible within Contoso's virtual network. An app in this virtual network could be reached by accessing *APP-NAME.internal-contoso.com*.
22+
23+
The custom domain name works for app requests but doesn't for the scm site. The scm site is only available at *APP-NAME.scm.ASE-NAME.appserviceenvironment.net*.
24+
25+
The custom domain suffix is for the App Service Environment. This feature is different from a custom domain binding on an App Service. For more information on custom domain bindings, see [Map an existing custom DNS name to Azure App Service](../app-service-web-tutorial-custom-domain.md).
26+
27+
## Prerequisites
28+
29+
- ILB variation of App Service Environment v3.
30+
- Valid SSL/TLS certificate must be stored in an Azure Key Vault. For more information on using certificates with App Service, see [Add a TLS/SSL certificate in Azure App Service](../configure-ssl-certificate.md).
31+
32+
### Managed identity
33+
34+
A [managed identity](../../active-directory/managed-identities-azure-resources/overview.md) is used to authenticate against the Azure Key Vault where the SSL/TLS certificate is stored. If you don't currently have a managed identity associated with your App Service Environment, you'll need to configure one.
35+
36+
You can use either a system assigned or user assigned managed identity. To create a user assigned managed identity, see [manage user-assigned managed identities](../../active-directory/managed-identities-azure-resources/how-manage-user-assigned-managed-identities.md). If you'd like to use a system assigned managed identity and don't already have one assigned to your App Service Environment, the Custom domain suffix portal experience will guide you through the creation process. Alternatively, you can go to the **Identity** page for your App Service Environment and configure and assign your managed identities there.
37+
38+
To enable a system assigned managed identity, set the Status to On.
39+
40+
:::image type="content" source="./media/custom-domain-suffix/ase-system-assigned-managed-identity.png" alt-text="Screenshot of a sample system assigned managed identity for App Service Environment.":::
41+
42+
To assign a user assigned managed identity, select "Add", and find the managed identity you want to use.
43+
44+
:::image type="content" source="./media/custom-domain-suffix/ase-user-assigned-managed-identity.png" alt-text="Screenshot of a sample user assigned managed identity for App Service Environment.":::
45+
46+
Once you assign the managed identity to your App Service Environment, ensure the managed identity has sufficient permissions for the Azure Key Vault. You can either use a vault access policy or Azure role-based access control.
47+
48+
If you use a vault access policy, the managed identity will need at a minimum the "Get" secrets permission for the key vault.
49+
50+
:::image type="content" source="./media/custom-domain-suffix/key-vault-access-policy.png" alt-text="Screenshot of a sample key vault access policy for managed identity.":::
51+
52+
If you choose to use Azure role-based access control to manage access to your key vault, you'll need to give your managed identity at a minimum the "Key Vault Secrets User" role.
53+
54+
:::image type="content" source="./media/custom-domain-suffix/key-vault-rbac.png" alt-text="Screenshot of a sample key vault role based access control for managed identity.":::
55+
56+
### Certificate
57+
58+
The certificate for custom domain suffix must be stored in an Azure Key Vault. App Service Environment will use the managed identity you selected to get the certificate. The Key Vault must be publicly accessible, however you can lock down the key vault by restricting access to your App Service Environment's outbound IPs. You can find your App Service Environment's outbound IPs under "Default outbound addresses" on the **IP addresses** page for your App Service Environment. You'll need to add both IPs to your key vault's firewall rules. For more information on key vault network security and firewall rules, see [Configure Azure Key Vault firewalls and virtual networks](../../key-vault/general/network-security.md#key-vault-firewall-enabled-ipv4-addresses-and-ranges---static-ips).
59+
60+
:::image type="content" source="./media/custom-domain-suffix/key-vault-networking.png" alt-text="Screenshot of a sample networking page for key vault to allow custom domain suffix feature.":::
61+
62+
Your certificate must be a wildcard certificate for the selected custom domain name. For example, *contoso.com* would need a certificate covering **.contoso.com*.
63+
64+
::: zone pivot="experience-azp"
65+
66+
## Use the Azure portal to configure custom domain suffix
67+
68+
1. From the [Azure portal](https://portal.azure.com), navigate to the **Custom domain suffix** page for your App Service Environment.
69+
1. Enter your custom domain name.
70+
1. Select the managed identity you've defined for your App Service Environment. You can use either a system assigned or user assigned managed identity. You'll be able to configure your managed identity if you haven't done so already directly from the custom domain suffix page using the "Add identity" option in the managed identity selection box.
71+
:::image type="content" source="./media/custom-domain-suffix/managed-identity-selection.png" alt-text="Screenshot of a configuration pane to select and update the managed identity for the App Service Environment.":::
72+
1. Select the certificate for the custom domain suffix.
73+
1. Select "Save" at the top of the page. To see the latest configuration updates, you may need to refresh your browser page.
74+
:::image type="content" source="./media/custom-domain-suffix/custom-domain-suffix-portal-experience.png" alt-text="Screenshot of an overview of the custom domain suffix portal experience.":::
75+
1. It will take a few minutes for the custom domain suffix configuration to be set. Select "Refresh" at the top of the page to check the status. The banner will update with the latest progress. Once complete, the banner will state that the custom domain suffix is configured.
76+
:::image type="content" source="./media/custom-domain-suffix/custom-domain-suffix-success.png" alt-text="Screenshot of a sample custom domain suffix success page.":::
77+
78+
::: zone-end
79+
80+
::: zone pivot="experience-arm"
81+
82+
## Use Azure Resource Manager to configure custom domain suffix
83+
84+
To configure a custom domain suffix for your App Service Environment using an Azure Resource Manager template, you'll need to include the below properties. Ensure that you've met the [prerequisites](#prerequisites) and that your managed identity and certificate are accessible and have the appropriate permissions for the Azure Key Vault.
85+
86+
You'll need to configure the managed identity and ensure it exists before assigning it in your template. For more information on managed identities, see the [managed identity overview](../../active-directory/managed-identities-azure-resources/overview.md).
87+
88+
### Use a user assigned managed identity
89+
90+
```json
91+
"resources": [
92+
{
93+
"apiVersion": "2022-03-01",
94+
"type": "Microsoft.Web/hostingEnvironments",
95+
"name": ...,
96+
"location": ...,
97+
"identity": {
98+
"type": "UserAssigned",
99+
"userAssignedIdentities": {
100+
"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/asev3-cdns-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/ase-cdns-managed-identity"
101+
}
102+
},
103+
"properties": {
104+
"customDnsSuffixConfiguration": {
105+
"dnsSuffix": "antares-test.net",
106+
"certificateUrl": "https://kv-sample-key-vault.vault.azure.net/secrets/wildcard-antares-test-net",
107+
"keyVaultReferenceIdentity": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/asev3-cdns-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/ase-cdns-managed-identity"
108+
},
109+
"internalLoadBalancingMode": "Web, Publishing",
110+
etc...
111+
}
112+
}
113+
```
114+
115+
### Use a system assigned managed identity
116+
117+
```json
118+
"resources": [
119+
{
120+
"apiVersion": "2022-03-01",
121+
"type": "Microsoft.Web/hostingEnvironments",
122+
"name": ...,
123+
"location": ...,
124+
"identity": {
125+
"type": "SystemAssigned"
126+
}
127+
"properties": {
128+
"customDnsSuffixConfiguration": {
129+
"dnsSuffix": "antares-test.net",
130+
"certificateUrl": "https://kv-sample-key-vault.vault.azure.net/secrets/wildcard-antares-test-net",
131+
"keyVaultReferenceIdentity": "systemassigned"
132+
},
133+
"internalLoadBalancingMode": "Web, Publishing",
134+
etc...
135+
}
136+
}
137+
```
138+
139+
## Use Azure Resource Explorer to configure custom domain suffix
140+
141+
Alternatively, you can update your existing ILB App Service Environment using [Azure Resource Explorer](https://resources.azure.com).
142+
143+
1. In Resource Explorer, go to the node for the App Service Environment (**subscriptions** > **{your Subscription}** > **resourceGroups** > **{your Resource Group}** > **providers** > **Microsoft.Web** > **hostingEnvironments**). Then select the specific App Service Environment that you want to update.
144+
1. Select **Read/Write** in the upper toolbar to allow interactive editing in Resource Explorer.
145+
1. Select the **Edit** button to make the Resource Manager template editable.
146+
1. Scroll to the bottom of the right pane. The **customDnsSuffixConfiguration** attribute is at the bottom.
147+
1. Enter your values for **dnsSuffix**, **certificateUrl**, and **keyVaultReferenceIdentity**.
148+
1. Navigate to the **identity** attribute and enter the details associated with the managed identity you're using.
149+
1. Select the **PUT** button that's located at the top to commit the change to the App Service Environment.
150+
1. The **provisioningState** under **customDnsSuffixConfiguration** will provide a status on the configuration update.
151+
152+
::: zone-end
153+
154+
## DNS configuration
155+
156+
To access your apps in your App Service Environment using your custom domain suffix, you'll need to either configure your own DNS server or configure DNS in an Azure private DNS zone for your custom domain.
157+
158+
If you want to use your own DNS server, add the following records:
159+
160+
1. Create a zone for your custom domain.
161+
1. Create an A record in that zone that points * to the inbound IP address used by your App Service Environment.
162+
1. Create an A record in that zone that points @ to the inbound IP address used by your App Service Environment.
163+
164+
To configure DNS in Azure DNS private zones:
165+
166+
1. Create an Azure DNS private zone named for your custom domain. In the example below, the custom domain is *internal-contoso.com*.
167+
1. Create an A record in that zone that points * to the inbound IP address used by your App Service Environment.
168+
1. Create an A record in that zone that points @ to the inbound IP address used by your App Service Environment.
169+
:::image type="content" source="./media/custom-domain-suffix/custom-domain-suffix-dns-configuration.png" alt-text="Screenshot of a sample DNS configuration for your custom domain suffix.":::
170+
1. Link your Azure DNS private zone to your App Service Environment's virtual network.
171+
:::image type="content" source="./media/custom-domain-suffix/private-dns-zone-vnet-link.png" alt-text="Screenshot of a sample virtual network link for private DNS zone.":::
172+
173+
For more information on configuring DNS for your domain, see [Use an App Service Environment](./using.md#dns-configuration).
174+
175+
## Access your apps
176+
177+
After configuring the custom domain suffix and DNS for your App Service Environment, you can go to the **Custom domains** page for one of your App Service apps in your App Service Environment and confirm the addition of the assigned custom domain for the app.
178+
179+
:::image type="content" source="./media/custom-domain-suffix/app-custom-domain-sample.png" alt-text="Screenshot of a sample custom domain for an app created by App Service Environment custom domain suffix feature.":::
180+
181+
Apps on the ILB App Service Environment can be accessed securely over HTTPS by going to either the custom domain you configured or the default domain *appserviceenvironment.net* like in the previous image. The ability to access your apps using the default App Service Environment domain and your custom domain is a unique feature that is only supported on App Service Environment v3.
182+
183+
However, just like apps running on the public multi-tenant service, you can also configure custom host names for individual apps, and then configure unique SNI [TLS/SSL certificate bindings for individual apps](./overview-certificates.md#tls-settings).
184+
185+
## Troubleshooting
186+
187+
If your permissions or network settings for your managed identity, key vault, or App Service Environment aren't set appropriately, you won't be able to configure a custom domain suffix, and you'll receive an error similar to the example below. Review the [prerequisites](#prerequisites) to ensure you've set the needed permissions. You'll also see a similar error message if the App Service platform detects that your certificate is degraded or expired.
188+
189+
:::image type="content" source="./media/custom-domain-suffix/custom-domain-suffix-error.png" alt-text="Screenshot of a sample custom domain suffix error message.":::
190+
191+
## Next steps
192+
193+
> [!div class="nextstepaction"]
194+
> [Using an App Service Environment v3](using.md)
195+
196+
> [!div class="nextstepaction"]
197+
> [App Service Environment v3 Networking](networking.md)
198+
199+
> [!div class="nextstepaction"]
200+
> [Tutorial: Map an existing custom DNS name to Azure App Service](../app-service-web-tutorial-custom-domain.md)
322 KB
Loading
98.5 KB
Loading
127 KB
Loading
145 KB
Loading
106 KB
Loading
814 KB
Loading
195 KB
Loading
760 KB
Loading
214 KB
Loading

0 commit comments

Comments
 (0)