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
+49-15Lines changed: 49 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,12 +21,37 @@ 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 that is hosting your domain, create DNS records for your custom domain.
27
+
28
+
- If you are using the root domain (for example, contoso.com), create the following DNS records:
29
+
30
+
| Record type | Host | Value |
31
+
|--|--|--|
32
+
| A | `@` | The IP address of your Container Apps environment. |
33
+
| TXT | `asuid` | The domain verification code. |
34
+
35
+
36
+
- If you are using a subdomain (for example, www.contoso.com), create the following DNS records:
37
+
38
+
| Record type | Host | Value |
39
+
|--|--|--|
40
+
| A | The subdomain (for example, www) | The IP address of your Container Apps environment. |
41
+
| TXT | `asuid.{subdomain}` (for example, asuid.www) | The domain verification code. |
42
+
24
43
> [!NOTE]
25
-
> To set up your own custom domain and certificate, see [Custom domain names and free managed certificates](./custom-domains-managed-certificates.md).
44
+
> The IP address of your Container Apps environment and the domain verification code can be found in the [Custom DNS suffix settings](https://learn.microsoft.com/azure/container-apps/environment-custom-dns-suffix#add-a-custom-dns-suffix-and-certificate) of the Container App Environment.
26
45
>
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.
46
+
> Don't bind the custom domain to the Container App Environment or to a Container App.
47
+
48
+
## Route configuration
28
49
29
-
## Configuration
50
+
> [!NOTE]
51
+
> If you set bindingType: "Auto" or "Disabled", you don't need a certificateId. Create the route before you [add the certificate](#add-a-certificate) so that the certificate registration check for ownership succeeds. If you are bringing your own certificate, set the bindingType to "Auto" or "Disabled" when you first create the route, and then set bindingType to "SniEnabled" and set the certificateId after you add the certificate to the environment.
52
+
Once you add 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.
53
+
>
54
+
> The certificateId is in the format /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{ContainerAppEnvironmentName}/certificates/{CertificateFriendlyName}
30
55
31
56
Update your Container Apps YAML file to include a `customDomains` section. The following example demonstrates how to set up this configuration.
32
57
@@ -80,22 +105,12 @@ Other properties not listed that may affect your routes include the following.
80
105
| `target.label` | Route to a specific labeled revision within a container app. |
81
106
| `target.revision` | Route to a specific revision within a container app. |
82
107
83
-
## Work with your custom domain
108
+
## Work with your route configuration
84
109
85
-
Use the following commands to configure and use your custom domain mapping.
110
+
Use the following commands to manage your route configuration.
86
111
87
112
Before running the following commands, make sure to replace placeholders surrounded by `<>` with your own values.
88
113
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
114
### Create a new route configuration
100
115
101
116
Use `az containerapp env http-route-config create` to create a new route configuration.
@@ -108,6 +123,16 @@ az containerapp env http-route-config create \
108
123
--yaml <CONTAINER_APPS_CONFIG_FILE>
109
124
```
110
125
126
+
### List route configurations
127
+
128
+
Use `az containerapp env http-route-config list` to list all the defined route configurations.
129
+
130
+
```azurecli
131
+
az containerapp env http-route-config list \
132
+
--resource-group <RESOURCE_GROUP_NAME> \
133
+
--name <ENVIRONMENT_NAME>
134
+
```
135
+
111
136
### Update a route configuration
112
137
113
138
Use `az containerapp env http-route-config update` to update an existing route configuration.
@@ -142,6 +167,15 @@ az containerapp env http-route-config delete \
142
167
--http-route-config-name <CONFIGURATION_NAME>
143
168
```
144
169
170
+
## Add a certificate
171
+
172
+
To add a certificate to your environment, use one of the following methods:
173
+
- To add a Container Apps managed certificate, use the [az containerapp env certificate create](https://learn.microsoft.com/cli/azure/containerapp/env/certificate?view=azure-cli-latest#az-containerapp-env-certificate-create) CLI command.
174
+
- To bring your own existing certificate, use the [az containerapp env certificate upload](https://learn.microsoft.com/cli/azure/containerapp/env/certificate?view=azure-cli-latest#az-containerapp-env-certificate-upload) CLI command.
175
+
176
+
> [!NOTE]
177
+
> Don't bind the certificate to a Container App.
178
+
145
179
## Verify HTTP routing
146
180
147
181
After configuring your custom domain with rule-based routing:
0 commit comments