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/container-apps/rule-based-routing-custom-domain.md
+55-16Lines changed: 55 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,14 +21,53 @@ HTTP route configurations support custom domains, allowing you to route traffic
21
21
- SSL certificate for your domain (unless using automatic certificates)
22
22
- Container apps deployed to your environment
23
23
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. |
> 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.
26
66
>
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.
28
68
29
-
## Configuration
30
69
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.
32
71
33
72
```yml
34
73
customDomains:
@@ -80,22 +119,12 @@ Other properties not listed that may affect your routes include the following.
80
119
| `target.label` | Route to a specific labeled revision within a container app. |
81
120
| `target.revision` | Route to a specific revision within a container app. |
82
121
83
-
## Work with your custom domain
122
+
## Work with your route configuration
84
123
85
-
Use the following commands to configure and use your custom domain mapping.
124
+
Use the following commands to manage your route configuration.
86
125
87
126
Before running the following commands, make sure to replace placeholders surrounded by `<>` with your own values.
88
127
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
-
99
128
### Create a new route configuration
100
129
101
130
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 \
108
137
--yaml <CONTAINER_APPS_CONFIG_FILE>
109
138
```
110
139
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
+
111
150
### Update a route configuration
112
151
113
152
Use `az containerapp env http-route-config update` to update an existing route configuration.
0 commit comments