From 7e3c214c530450488168819b688b1fbe12119314 Mon Sep 17 00:00:00 2001 From: Ningting Pan Date: Tue, 21 Dec 2021 14:49:04 +0800 Subject: [PATCH] Add validation message for sso with multiple API portal instances --- src/spring-cloud/azext_spring_cloud/api_portal.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/spring-cloud/azext_spring_cloud/api_portal.py b/src/spring-cloud/azext_spring_cloud/api_portal.py index 1b4d2b09cc2..bd166434662 100644 --- a/src/spring-cloud/azext_spring_cloud/api_portal.py +++ b/src/spring-cloud/azext_spring_cloud/api_portal.py @@ -3,11 +3,11 @@ # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- +from knack.util import CLIError from .vendored_sdks.appplatform.v2022_01_01_preview import models as models DEFAULT_NAME = "default" - def api_portal_show(cmd, client, resource_group, service): return client.api_portals.get(resource_group, service, DEFAULT_NAME) @@ -41,6 +41,9 @@ def api_portal_update(cmd, client, resource_group, service, sku = models.Sku(name=api_portal.sku.name, tier=api_portal.sku.tier, capacity=instance_count or api_portal.sku.capacity) + if sku.capacity > 1 and properties.sso_properties: + raise CLIError("API Portal doesn't support to configure SSO with multiple replicas for now.") + api_portal_resource = models.ApiPortalResource( properties=properties, sku=sku) return client.api_portals.begin_create_or_update(resource_group, service, DEFAULT_NAME, api_portal_resource)