Skip to content

Commit

Permalink
Add validation message for sso with multiple API portal instances (Az…
Browse files Browse the repository at this point in the history
  • Loading branch information
ninpan-ms authored Dec 22, 2021
1 parent b906548 commit ab0be9c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/spring-cloud/azext_spring_cloud/api_portal.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit ab0be9c

Please sign in to comment.