Skip to content

Commit 0baff47

Browse files
authored
Merge pull request #248543 from cachai2/additionalPorts
additionalPorts
2 parents ad7de4f + d3efaf0 commit 0baff47

File tree

2 files changed

+110
-2
lines changed

2 files changed

+110
-2
lines changed

articles/container-apps/ingress-how-to.md

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,100 @@ Disable ingress for your container app by omitting the `ingress` configuration p
162162

163163
::: zone-end
164164

165+
## <a name="use-additional-tcp-ports"></a>Use additional TCP ports (preview)
166+
167+
You can expose additional TCP ports from your application. To learn more, see the [ingress concept article](ingress-overview.md#additional-tcp-ports).
168+
169+
170+
::: zone pivot="azure-cli"
171+
172+
# [Azure CLI](#tab/azure-cli)
173+
174+
Adding additional TCP ports can be done through the CLI by referencing a YAML file with your TCP port configurations.
175+
176+
```azurecli
177+
az containerapp update
178+
--name <app-name> \
179+
--resource-group <resource-group> \
180+
--yaml <your-yaml-file>
181+
```
182+
183+
The following is an example YAML file you can reference in the above CLI command. The configuration for the additional TCP ports is under `additionalPortMappings`.
184+
185+
```yml
186+
location: northcentralus
187+
name: multiport-example
188+
properties:
189+
configuration:
190+
activeRevisionsMode: Single
191+
ingress:
192+
additionalPortMappings:
193+
- exposedPort: 21025
194+
external: true
195+
targetPort: 1025
196+
allowInsecure: false
197+
external: true
198+
targetPort: 1080
199+
traffic:
200+
- latestRevision: true
201+
weight: 100
202+
transport: http
203+
managedEnvironmentId: <env id>
204+
template:
205+
containers:
206+
- image: maildev/maildev
207+
name: maildev
208+
resources:
209+
cpu: 0.25
210+
memory: 0.5Gi
211+
scale:
212+
maxReplicas: 1
213+
minReplicas: 1
214+
workloadProfileName: Consumption
215+
type: Microsoft.App/containerApps
216+
```
217+
218+
::: zone-end
219+
220+
::: zone pivot="azure-portal"
221+
222+
# [Portal](#tab/portal)
223+
224+
This feature is not supported in the Azure portal.
225+
226+
::: zone-end
227+
228+
::: zone pivot="azure-resource-manager"
229+
230+
# [ARM template](#tab/arm-template)
231+
232+
The following ARM template provides an example of how you can add additional ports to your container apps. Each additional port should be added under `additionalPortMappings` within the `ingress` section for `configuration` within `properties` for the container app. The following is an example:
233+
234+
```json
235+
{
236+
...
237+
"properties": {
238+
...
239+
"configuration": {
240+
"ingress": {
241+
...
242+
"additionalPortMappings": [
243+
{
244+
"external": false
245+
"targetPort": 80
246+
"exposedPort": 12000
247+
}
248+
]
249+
}
250+
}
251+
...
252+
}
253+
```
254+
255+
---
256+
257+
::: zone-end
258+
165259
## Next steps
166260

167261
> [!div class="nextstepaction"]

articles/container-apps/ingress-overview.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ HTTP ingress adds headers to pass metadata about the client request to your cont
6464
| `X-Forwarded-Proto` | Protocol used by the client to connect with the Container Apps service. | `http` or `https` |
6565
| `X-Forwarded-For` | The IP address of the client that sent the request. | |
6666
| `X-Forwarded-Host` | The host name the client used to connect with the Container Apps service. | |
67-
| `X-Forwarded-Client-Cert` | The client certificate if `clientCertificateMode` is set. | Semicolon seperated list of Hash, Cert, and Chain. For example: `Hash=....;Cert="...";Chain="...";` |
67+
| `X-Forwarded-Client-Cert` | The client certificate if `clientCertificateMode` is set. | Semicolon separated list of Hash, Cert, and Chain. For example: `Hash=....;Cert="...";Chain="...";` |
6868

6969
### <a name="tcp"></a>TCP
7070

@@ -78,11 +78,25 @@ With TCP ingress enabled, your container app:
7878
- Is accessible to other container apps in the same environment via its name (defined by the `name` property in the Container Apps resource) and exposed port number.
7979
- Is accessible externally via its fully qualified domain name (FQDN) and exposed port number if the ingress is set to "external".
8080

81+
## <a name="additional-tcp-ports"></a>Additional TCP ports (preview)
82+
83+
In addition to the main HTTP/TCP port for your container apps, you may expose additional TCP ports to enable applications that accept TCP connections on multiple ports. This feature is in preview.
84+
85+
The following apply to additional TCP ports:
86+
- Additional TCP ports can only be external if the app itself is set as external and the container app is using a custom VNet.
87+
- Any externally exposed additional TCP ports must be unique across the entire Container Apps environment. This includes all external additional TCP ports, external main TCP ports, and 80/443 ports used by built-in HTTP ingress. If the additional ports are internal, the same port can be shared by multiple apps.
88+
- If an exposed port is not provided, the exposed port will default to match the target port.
89+
- Each target port must be unique, and the same target port cannot be exposed on different exposed ports.
90+
- There is a maximum of 5 additional ports per app. If additional ports are required, please open a support request.
91+
- Only the main ingress port supports built-in HTTP features such as CORS and session affinity. When running HTTP on top of the additional TCP ports, these built-in features are not supported.
92+
93+
Visit the [how to article on ingress](ingress-how-to.md#use-additional-tcp-ports) for more information on how to enable additional ports for your container apps.
94+
8195
## Domain names
8296

8397
You can access your app in the following ways:
8498

85-
- The default fully-qualified domain name (FQDN): Each app in a Container Apps environment is automatically assigned an FQDN based on the environment's DNS suffix. To customize an environment's DNS suffix, see [Custom environment DNS Suffix](environment-custom-dns-suffix.md).
99+
- The default fully qualified domain name (FQDN): Each app in a Container Apps environment is automatically assigned an FQDN based on the environment's DNS suffix. To customize an environment's DNS suffix, see [Custom environment DNS Suffix](environment-custom-dns-suffix.md).
86100
- A custom domain name: You can configure a custom DNS domain for your Container Apps environment. For more information, see [Custom domain names and certificates](./custom-domains-certificates.md).
87101
- The app name: You can use the app name for communication between apps in the same environment.
88102

0 commit comments

Comments
 (0)