From 6bb1e35a8d15b3d6b4c5b550999a7812ab0ec3c4 Mon Sep 17 00:00:00 2001 From: zhenqxuMSFT Date: Thu, 15 Jun 2023 15:13:46 +0800 Subject: [PATCH] Support multiple port for container app (#24332) (#24459) * Support multiple port for container app * lint * comment --- .../2023-05-02-preview/ContainerApps.json | 34 +++++++++++++++++++ .../ContainerApps_CreateOrUpdate.json | 13 ++++++- 2 files changed, 46 insertions(+), 1 deletion(-) diff --git a/specification/app/resource-manager/Microsoft.App/preview/2023-05-02-preview/ContainerApps.json b/specification/app/resource-manager/Microsoft.App/preview/2023-05-02-preview/ContainerApps.json index e0a83fc01aca..d4c0aff57af9 100644 --- a/specification/app/resource-manager/Microsoft.App/preview/2023-05-02-preview/ContainerApps.json +++ b/specification/app/resource-manager/Microsoft.App/preview/2023-05-02-preview/ContainerApps.json @@ -961,6 +961,16 @@ "corsPolicy": { "description": "CORS policy for container app", "$ref": "#/definitions/CorsPolicy" + }, + "additionalPortMappings": { + "description": "Settings to expose additional ports on container app", + "type": "array", + "items": { + "$ref": "#/definitions/IngressPortMapping" + }, + "x-ms-identifiers": [ + "targetPort" + ] } } }, @@ -1166,6 +1176,30 @@ } } }, + "IngressPortMapping": { + "description": "Port mappings of container app ingress", + "type": "object", + "required": [ + "external", + "targetPort" + ], + "properties": { + "external": { + "description": "Specifies whether the app port is accessible outside of the environment", + "type": "boolean" + }, + "targetPort": { + "format": "int32", + "description": "Specifies the port user's container listens on", + "type": "integer" + }, + "exposedPort": { + "format": "int32", + "description": "Specifies the exposed port for the target port. If not specified, it defaults to target port", + "type": "integer" + } + } + }, "CustomHostnameAnalysisResult": { "description": "Custom domain analysis.", "type": "object", diff --git a/specification/app/resource-manager/Microsoft.App/preview/2023-05-02-preview/examples/ContainerApps_CreateOrUpdate.json b/specification/app/resource-manager/Microsoft.App/preview/2023-05-02-preview/examples/ContainerApps_CreateOrUpdate.json index 0e88ace4af7e..a90356136e44 100644 --- a/specification/app/resource-manager/Microsoft.App/preview/2023-05-02-preview/examples/ContainerApps_CreateOrUpdate.json +++ b/specification/app/resource-manager/Microsoft.App/preview/2023-05-02-preview/examples/ContainerApps_CreateOrUpdate.json @@ -69,7 +69,18 @@ ], "maxAge": 1234, "allowCredentials": true - } + }, + "additionalPortMappings": [ + { + "external": true, + "targetPort": 1234 + }, + { + "external": false, + "targetPort": 2345, + "exposedPort": 3456 + } + ] }, "dapr": { "enabled": true,