diff --git a/libraries/microsoft-agents-copilotstudio-client/microsoft_agents/copilotstudio/client/power_platform_environment.py b/libraries/microsoft-agents-copilotstudio-client/microsoft_agents/copilotstudio/client/power_platform_environment.py index a25321b1..8a5f76e8 100644 --- a/libraries/microsoft-agents-copilotstudio-client/microsoft_agents/copilotstudio/client/power_platform_environment.py +++ b/libraries/microsoft-agents-copilotstudio-client/microsoft_agents/copilotstudio/client/power_platform_environment.py @@ -330,7 +330,7 @@ def get_environment_endpoint( @staticmethod def get_endpoint_suffix(cloud: PowerPlatformCloud, cloud_base_address: str) -> str: - return { + res = { PowerPlatformCloud.LOCAL: "api.powerplatform.localhost", PowerPlatformCloud.EXP: "api.exp.powerplatform.com", PowerPlatformCloud.DEV: "api.dev.powerplatform.com", @@ -347,7 +347,11 @@ def get_endpoint_suffix(cloud: PowerPlatformCloud, cloud_base_address: str) -> s PowerPlatformCloud.EX: "api.powerplatform.eaglex.ic.gov", PowerPlatformCloud.RX: "api.powerplatform.microsoft.scloud", PowerPlatformCloud.OTHER: cloud_base_address, - }.get(cloud, ValueError(f"Invalid cloud category value: {cloud}")) + }.get(cloud) + + if not res: + raise ValueError(f"Invalid cloud category value: {cloud}") + return res @staticmethod def get_id_suffix_length(cloud: PowerPlatformCloud) -> int: