diff --git a/libraries/microsoft-agents-a365-runtime/microsoft_agents_a365/runtime/environment_utils.py b/libraries/microsoft-agents-a365-runtime/microsoft_agents_a365/runtime/environment_utils.py index 3c086b99..63ec52ab 100644 --- a/libraries/microsoft-agents-a365-runtime/microsoft_agents_a365/runtime/environment_utils.py +++ b/libraries/microsoft-agents-a365-runtime/microsoft_agents_a365/runtime/environment_utils.py @@ -7,13 +7,9 @@ import os # Authentication scopes for different environments -TEST_OBSERVABILITY_SCOPE = "https://api.test.powerplatform.com/.default" -PREPROD_OBSERVABILITY_SCOPE = "https://api.preprod.powerplatform.com/.default" PROD_OBSERVABILITY_SCOPE = "https://api.powerplatform.com/.default" # Cluster categories for different environments -TEST_OBSERVABILITY_CLUSTER_CATEGORY = "test" -PREPROD_OBSERVABILITY_CLUSTER_CATEGORY = "preprod" PROD_OBSERVABILITY_CLUSTER_CATEGORY = "prod" # Default environment names @@ -28,43 +24,7 @@ def get_observability_authentication_scope() -> list[str]: Returns: list[str]: The authentication scope for the current environment. """ - environment = _get_current_environment() - - environment_lower = environment.lower() - - if environment_lower == "development": - # For now, map "development" to preprod scope for local testing - return [PREPROD_OBSERVABILITY_SCOPE] - elif environment_lower == "test": - return [TEST_OBSERVABILITY_SCOPE] - elif environment_lower == "production": - return [PROD_OBSERVABILITY_SCOPE] - else: - # Default to production scope - return [PROD_OBSERVABILITY_SCOPE] - - -def get_observability_cluster_category() -> str: - """ - Returns the cluster category for the observability service based on the current environment. - - Returns: - str: The cluster category for the current environment. - """ - environment = _get_current_environment() - - environment_lower = environment.lower() - - if environment_lower == "development": - # For now, map "development" to preprod scope for local testing - return PREPROD_OBSERVABILITY_CLUSTER_CATEGORY - elif environment_lower == "test": - return TEST_OBSERVABILITY_CLUSTER_CATEGORY - elif environment_lower == "production": - return PROD_OBSERVABILITY_CLUSTER_CATEGORY - else: - # Default to production cluster category - return PROD_OBSERVABILITY_CLUSTER_CATEGORY + return [PROD_OBSERVABILITY_SCOPE] def is_development_environment() -> bool: diff --git a/libraries/microsoft-agents-a365-runtime/microsoft_agents_a365/runtime/power_platform_api_discovery.py b/libraries/microsoft-agents-a365-runtime/microsoft_agents_a365/runtime/power_platform_api_discovery.py index 564d5e83..f3891a36 100644 --- a/libraries/microsoft-agents-a365-runtime/microsoft_agents_a365/runtime/power_platform_api_discovery.py +++ b/libraries/microsoft-agents-a365-runtime/microsoft_agents_a365/runtime/power_platform_api_discovery.py @@ -70,9 +70,9 @@ def _get_hex_api_suffix_length(self) -> int: def _get_environment_api_host_name_suffix(self) -> str: cluster_to_suffix = { "local": "api.powerplatform.localhost", - "dev": "api.dev.powerplatform.com", - "test": "api.test.powerplatform.com", - "preprod": "api.preprod.powerplatform.com", + "dev": "api.powerplatform.com", # defaulting to prod + "test": "api.powerplatform.com", # defaulting to prod + "preprod": "api.powerplatform.com", # defaulting to prod "firstrelease": "api.powerplatform.com", "prod": "api.powerplatform.com", "gov": "api.gov.powerplatform.microsoft.us", diff --git a/tests/runtime/test_power_platform_api_discovery.py b/tests/runtime/test_power_platform_api_discovery.py index 148a5a69..2a16c66c 100644 --- a/tests/runtime/test_power_platform_api_discovery.py +++ b/tests/runtime/test_power_platform_api_discovery.py @@ -9,9 +9,9 @@ class TestPowerPlatformApiDiscovery(unittest.TestCase): def test_host_suffix_and_audience(self): expected_host_suffixes = { "local": "api.powerplatform.localhost", - "dev": "api.dev.powerplatform.com", - "test": "api.test.powerplatform.com", - "preprod": "api.preprod.powerplatform.com", + "dev": "api.powerplatform.com", + "test": "api.powerplatform.com", + "preprod": "api.powerplatform.com", "firstrelease": "api.powerplatform.com", "prod": "api.powerplatform.com", "gov": "api.gov.powerplatform.microsoft.us", @@ -46,7 +46,7 @@ def test_tenant_endpoint_generation_prod(self): def test_tenant_endpoint_generation_dev(self): disc = PowerPlatformApiDiscovery("dev") tenant_id = "A1B2" # normalized -> a1b2; suffix length 1 -> '2' - expected = "a1b.2.tenant.api.dev.powerplatform.com" + expected = "a1b.2.tenant.api.powerplatform.com" self.assertEqual(disc.get_tenant_endpoint(tenant_id), expected) def test_tenant_island_cluster_endpoint(self): @@ -69,16 +69,16 @@ def test_tenant_identifier_too_short_for_suffix(self): def test_normalization_of_tenant_id(self): disc = PowerPlatformApiDiscovery("dev") tenant_id = "Ab-Cd-Ef" # normalized -> abcdef; suffix 1 -> 'f', prefix 'abcde' - expected = "abcde.f.tenant.api.dev.powerplatform.com" + expected = "abcde.f.tenant.api.powerplatform.com" self.assertEqual(disc.get_tenant_endpoint(tenant_id), expected) def test_nodejs_tenant_examples(self): tenant_id = "e3064512-cc6d-4703-be71-a2ecaecaa98a" expected_map = { "local": "e3064512cc6d4703be71a2ecaecaa98.a.tenant.api.powerplatform.localhost", - "dev": "e3064512cc6d4703be71a2ecaecaa98.a.tenant.api.dev.powerplatform.com", - "test": "e3064512cc6d4703be71a2ecaecaa98.a.tenant.api.test.powerplatform.com", - "preprod": "e3064512cc6d4703be71a2ecaecaa98.a.tenant.api.preprod.powerplatform.com", + "dev": "e3064512cc6d4703be71a2ecaecaa98.a.tenant.api.powerplatform.com", + "test": "e3064512cc6d4703be71a2ecaecaa98.a.tenant.api.powerplatform.com", + "preprod": "e3064512cc6d4703be71a2ecaecaa98.a.tenant.api.powerplatform.com", "firstrelease": "e3064512cc6d4703be71a2ecaecaa9.8a.tenant.api.powerplatform.com", "prod": "e3064512cc6d4703be71a2ecaecaa9.8a.tenant.api.powerplatform.com", "gov": "e3064512cc6d4703be71a2ecaecaa98.a.tenant.api.gov.powerplatform.microsoft.us", @@ -98,9 +98,9 @@ def test_nodejs_tenant_island_examples(self): tenant_id = "e3064512-cc6d-4703-be71-a2ecaecaa98a" expected_map = { "local": "il-e3064512cc6d4703be71a2ecaecaa98.a.tenant.api.powerplatform.localhost", - "dev": "il-e3064512cc6d4703be71a2ecaecaa98.a.tenant.api.dev.powerplatform.com", - "test": "il-e3064512cc6d4703be71a2ecaecaa98.a.tenant.api.test.powerplatform.com", - "preprod": "il-e3064512cc6d4703be71a2ecaecaa98.a.tenant.api.preprod.powerplatform.com", + "dev": "il-e3064512cc6d4703be71a2ecaecaa98.a.tenant.api.powerplatform.com", + "test": "il-e3064512cc6d4703be71a2ecaecaa98.a.tenant.api.powerplatform.com", + "preprod": "il-e3064512cc6d4703be71a2ecaecaa98.a.tenant.api.powerplatform.com", "firstrelease": "il-e3064512cc6d4703be71a2ecaecaa9.8a.tenant.api.powerplatform.com", "prod": "il-e3064512cc6d4703be71a2ecaecaa9.8a.tenant.api.powerplatform.com", "gov": "il-e3064512cc6d4703be71a2ecaecaa98.a.tenant.api.gov.powerplatform.microsoft.us",