Skip to content

Commit a95dd77

Browse files
authored
Update rule-based-routing-custom-domain.md
1 parent bc44b95 commit a95dd77

File tree

1 file changed

+49
-15
lines changed

1 file changed

+49
-15
lines changed

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

Lines changed: 49 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,37 @@ 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 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+
2443
> [!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.
2645
>
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
2849

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}
3055
3156
Update your Container Apps YAML file to include a `customDomains` section. The following example demonstrates how to set up this configuration.
3257

@@ -80,22 +105,12 @@ Other properties not listed that may affect your routes include the following.
80105
| `target.label` | Route to a specific labeled revision within a container app. |
81106
| `target.revision` | Route to a specific revision within a container app. |
82107

83-
## Work with your custom domain
108+
## Work with your route configuration
84109

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

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

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-
99114
### Create a new route configuration
100115

101116
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 \
108123
--yaml <CONTAINER_APPS_CONFIG_FILE>
109124
```
110125

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+
111136
### Update a route configuration
112137

113138
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 \
142167
--http-route-config-name <CONFIGURATION_NAME>
143168
```
144169

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+
145179
## Verify HTTP routing
146180

147181
After configuring your custom domain with rule-based routing:

0 commit comments

Comments
 (0)