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
+7-8Lines changed: 7 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,9 +6,8 @@ author: craigshoemaker
6
6
ms.service: azure-container-apps
7
7
ms.custom: devx-track-azurecli, devx-track-bicep
8
8
ms.topic: how-to
9
-
ms.date: 04/15/2025
9
+
ms.date: 04/16/2025
10
10
ms.author: cshoe
11
-
zone_pivot_groups: azure-cli-bicep
12
11
---
13
12
14
13
# Use a custom domain with rule-based routing in Azure Container Apps (preview)
@@ -44,7 +43,7 @@ rules:
44
43
action:
45
44
prefixRewrite: "/"
46
45
targets:
47
-
- containerApp: "<CONTAINER_APP_NAME>"
46
+
- containerApp: "<APP1_CONTAINER_APP_NAME>"
48
47
- description: "Routing to App2"
49
48
routes:
50
49
- match:
@@ -54,20 +53,20 @@ rules:
54
53
- match:
55
54
prefix: "/"
56
55
targets:
57
-
- containerApp: "<CONTAINER_APP_NAME>"
56
+
- containerApp: "<APP2_CONTAINER_APP_NAME>"
58
57
```
59
58
60
-
This YAML configuration defines two routing rules for HTTP traffic.
59
+
This configuration defines two routing rules for HTTP traffic.
61
60
62
61
| Property | Description |
63
62
|---|---|
64
63
| `customDomains.name` | The domain name you want to use (example: "app.contoso.com") |
65
64
| `customDomains.certificateId` | Resource ID of your certificate (not needed with `bindingType: "Auto"`) |
66
65
| `customDomains.bindingType` | How SSL is handled: "SniEnabled" (Server Name Indication), "Disabled" (HTTP only), or "Auto" (automatic certificate) |
67
66
| `description` | Human-readable label for the rule |
68
-
| `routes.match.prefix` | URL path prefix to match (example: "/api") |
69
-
| `routes.action.prefixRewrite` | What to replace the matched prefix with before forwarding |
70
-
| `targets.containerApp` | The name of the container app to route matching requests to |
67
+
| `routes.match.prefix` | URL path prefix to match. For example, `/api`. |
68
+
| `routes.action.prefixRewrite` | What to replace the matched prefix with before forwarding. |
69
+
| `targets.containerApp` | The name of the container app where matching route request are sent. |
71
70
72
71
These rules allow different paths on your custom domain to route to different container apps while also modifying the request path before it reaches the destination app.
Copy file name to clipboardExpand all lines: articles/container-apps/rule-based-routing.md
+43-30Lines changed: 43 additions & 30 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ author: craigshoemaker
6
6
ms.service: azure-container-apps
7
7
ms.custom: devx-track-azurecli, devx-track-bicep
8
8
ms.topic: tutorial
9
-
ms.date: 04/15/2025
9
+
ms.date: 04/16/2025
10
10
ms.author: cshoe
11
11
zone_pivot_groups: azure-cli-bicep
12
12
---
@@ -30,44 +30,44 @@ In this article, you learn how to use rule-based routing with Azure Container Ap
30
30
31
31
## Setup
32
32
33
-
To sign in to Azure from the CLI, run the following command and follow the prompts to complete the authentication process.
33
+
1. Run the following command so sign in to Azure from the CLI.
34
34
35
-
```azurecli
36
-
az login
37
-
```
35
+
```azurecli
36
+
az login
37
+
```
38
38
39
-
To ensure you're running the latest version of the CLI, run the upgrade command.
39
+
1. To ensure you're running the latest version of the CLI, run the upgrade command.
40
40
41
-
```azurecli
42
-
az upgrade
43
-
```
41
+
```azurecli
42
+
az upgrade
43
+
```
44
44
45
-
Ignore any warnings about modules currently in use.
45
+
Ignore any warnings about modules currently in use.
46
46
47
-
Install or update the Azure Container Apps extension for the CLI.
47
+
Install or update the Azure Container Apps extension for the CLI.
48
48
49
-
If you receive errors about missing parameters when you run `az containerapp` commands in Azure CLI or cmdlets from the `Az.App` module in PowerShell, be sure you have the latest version of the Azure Container Apps extension installed.
49
+
If you receive errors about missing parameters when you run `az containerapp` commands in Azure CLI or cmdlets from the `Az.App` module in PowerShell, be sure you have the latest version of the Azure Container Apps extension installed.
50
50
51
-
```azurecli
52
-
az extension add --name containerapp --upgrade
53
-
```
51
+
```azurecli
52
+
az extension add --name containerapp --upgrade
53
+
```
54
54
55
-
> [!NOTE]
56
-
> Starting in May 2024, Azure CLI extensions no longer enable preview features by default. To access Container Apps [preview features](whats-new.md), install the Container Apps extension with `--allow-preview true`.
57
-
>
58
-
> ```azurecli
59
-
> az extension add --name containerapp --upgrade --allow-preview true
60
-
> ```
55
+
> [!NOTE]
56
+
> Starting in May 2024, Azure CLI extensions no longer enable preview features by default. To access Container Apps [preview features](whats-new.md), install the Container Apps extension with `--allow-preview true`.
57
+
>
58
+
> ```azurecli
59
+
> az extension add --name containerapp --upgrade --allow-preview true
60
+
> ```
61
61
62
-
Now that the current extension or module is installed, register the `Microsoft.App` and `Microsoft.OperationalInsights` namespaces.
62
+
1. Now that the current extension or module is installed, register the `Microsoft.App` and `Microsoft.OperationalInsights` namespaces.
63
63
64
-
```azurecli
65
-
az provider register --namespace Microsoft.App
66
-
```
64
+
```azurecli
65
+
az provider register --namespace Microsoft.App
66
+
```
67
67
68
-
```azurecli
69
-
az provider register --namespace Microsoft.OperationalInsights
70
-
```
68
+
```azurecli
69
+
az provider register --namespace Microsoft.OperationalInsights
This configuration defines two routing rules for HTTP traffic.
148
+
149
+
| Property | Description |
150
+
|---|---|
151
+
| `description` | Human-readable label for the rule |
152
+
| `routes.match.prefix` | URL path prefix to match. For example, `/api`. |
153
+
| `routes.action.prefixRewrite` | What to replace the matched prefix with before forwarding. |
154
+
| `targets.containerApp` | The name of the container app where matching route request are sent. |
155
+
156
+
These rules allow different paths on your custom domain to route to different container apps while also modifying the request path before it reaches the destination app.
157
+
147
158
1. Run the following command to create the HTTP route configuration.
0 commit comments