Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add validation message for sso with multiple API portal instances #44

Merged
merged 1 commit into from
Dec 22, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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