Skip to content

Commit dc9cc32

Browse files
Merge pull request #301550 from gabesmsft/main
Update rule-based-routing-custom-domain.md
2 parents 450b9a8 + b3171d0 commit dc9cc32

File tree

1 file changed

+55
-16
lines changed

1 file changed

+55
-16
lines changed

articles/container-apps/rule-based-routing-custom-domain.md

Lines changed: 55 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,53 @@ HTTP route configurations support custom domains, allowing you to route traffic
2121
- SSL certificate for your domain (unless using automatic certificates)
2222
- Container apps deployed to your environment
2323

24+
## Custom domain configuration
25+
26+
Using the DNS provider hosting your domain, create the appropriate DNS records for your custom domain.
27+
- If you are using the root domain (for example, `contoso.com`), create the following DNS records:
28+
29+
| Record type | Host | Value |
30+
|--|--|--|
31+
| A | `@` | The IP address of your Container Apps environment. |
32+
| TXT | `asuid` | The domain verification code. |
33+
34+
- If you are using a subdomain (for example, `www.contoso.com`), create the following DNS records:
35+
36+
| Record type | Host | Value |
37+
|--|--|--|
38+
| A | The subdomain (for example, `www`) | The IP address of your Container Apps environment. |
39+
| TXT | `asuid.{subdomain}` (for example, `asuid.www`) | The domain verification code. |
40+
41+
> [!NOTE]
42+
> The IP address of your Container Apps environment and the domain verification code can be found in the [Custom DNS suffix settings](./environment-custom-dns-suffix.md#add-a-custom-dns-suffix-and-certificate) of your Container Apps environment.
43+
>
44+
> Don't bind the custom domain to your Container Apps environment or to a container app. Domains are only bound to one app, route, or environment.
45+
46+
## Route configuration
47+
48+
Update your Container Apps YAML file to include a `customDomains` section. Include a `bindingType` and `certificateId`, based on the following criteria:
49+
50+
| bindingType value | Description |
51+
|--|--|
52+
| Disabled | No certificate is provided. The domain is only available over HTTP, and HTTPS is not available. |
53+
| Auto | A certificate is optional. If a managed certificate is already created for this domain, it is added to the route automatically. Otherwise, the domain is initially only available over HTTP. To create a managed certificate for this domain, create a new managed certificate after the route is created. After the certificate is created, it is automatically added to the route. |
54+
| SniEnabled | A certificate is required. |
55+
56+
| Certificate type | certificateId format |
57+
| -- | -- |
58+
| None | Leave blank |
59+
| Managed | `/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{ContainerAppEnvironmentName}/managedCertificates/{CertificateFriendlyName}` |
60+
| Unmanaged | `/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{ContainerAppEnvironmentName}/certificates/{CertificateFriendlyName}` |
61+
2462
> [!NOTE]
25-
> To set up your own custom domain and certificate, see [Custom domain names and free managed certificates](./custom-domains-managed-certificates.md).
63+
> To add a certificate to your environment, use one of the following methods:
64+
> - To add a Container Apps managed certificate, use the [az containerapp env certificate create](/cli/azure/containerapp/env/certificate#az-containerapp-env-certificate-create) CLI command.
65+
> - To bring your own existing certificate, use the [az containerapp env certificate upload](/cli/azure/containerapp/env/certificate#az-containerapp-env-certificate-upload) CLI command.
2666
>
27-
> If you set `bindingType: "Auto"`, you don't need a `certificateId`. Create the route first so the certificate registration check for ownership succeeds. Once you set up the certificate, Container Apps automatically adds it to the route spec and binds it to the domain. The site is only accessible over HTTP (not HTTPS) until setup is complete.
67+
> Don't bind the certificate to a container app.
2868
29-
## Configuration
3069

31-
Update your Container Apps YAML file to include a `customDomains` section. The following example demonstrates how to set up this configuration.
70+
The following example demonstrates how to set up the route configuration.
3271

3372
```yml
3473
customDomains:
@@ -80,22 +119,12 @@ Other properties not listed that may affect your routes include the following.
80119
| `target.label` | Route to a specific labeled revision within a container app. |
81120
| `target.revision` | Route to a specific revision within a container app. |
82121

83-
## Work with your custom domain
122+
## Work with your route configuration
84123

85-
Use the following commands to configure and use your custom domain mapping.
124+
Use the following commands to manage your route configuration.
86125

87126
Before running the following commands, make sure to replace placeholders surrounded by `<>` with your own values.
88127

89-
### List route configurations
90-
91-
Use `az containerapp env http-route-config list` to list all the defined route configurations.
92-
93-
```azurecli
94-
az containerapp env http-route-config list \
95-
--resource-group <RESOURCE_GROUP_NAME> \
96-
--name <ENVIRONMENT_NAME>
97-
```
98-
99128
### Create a new route configuration
100129

101130
Use `az containerapp env http-route-config create` to create a new route configuration.
@@ -108,6 +137,16 @@ az containerapp env http-route-config create \
108137
--yaml <CONTAINER_APPS_CONFIG_FILE>
109138
```
110139

140+
### List route configurations
141+
142+
Use `az containerapp env http-route-config list` to list all the defined route configurations.
143+
144+
```azurecli
145+
az containerapp env http-route-config list \
146+
--resource-group <RESOURCE_GROUP_NAME> \
147+
--name <ENVIRONMENT_NAME>
148+
```
149+
111150
### Update a route configuration
112151

113152
Use `az containerapp env http-route-config update` to update an existing route configuration.

0 commit comments

Comments
 (0)