Skip to content

Commit b52570e

Browse files
committed
chore: remove hardcoded canary ARM endpoint
1 parent 5386966 commit b52570e

2 files changed

Lines changed: 3 additions & 7 deletions

File tree

azext_iot/_factory.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,7 @@ def _get_credential_scopes(cli_ctx):
5757

5858

5959
def _get_arm_endpoint(cli_ctx):
60-
"""TODO: Revert to cli_ctx.cloud.endpoints.resource_manager once 2026-03-01-preview
61-
is registered globally in ARM for all regions."""
62-
return "https://eastus2euap.management.azure.com"
60+
return cli_ctx.cloud.endpoints.resource_manager
6361

6462

6563
def iot_hub_service_factory(cli_ctx, *_):

azext_iot/tests/test_factory_unit.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,7 @@ def test_iot_hub_factory(self, mocker, cloud_config):
4848
mock_client_cls.assert_called_once()
4949
call_kwargs = mock_client_cls.call_args.kwargs
5050
assert call_kwargs["credential_scopes"] == cloud_config["expected_scopes"]
51-
# TODO: Revert to cloud_config["resource_manager"] once 2026-03-01-preview is global
52-
assert call_kwargs["endpoint"] == "https://eastus2euap.management.azure.com"
51+
assert call_kwargs["endpoint"] == cloud_config["resource_manager"]
5352

5453
def test_dps_factory(self, mocker, cloud_config):
5554
mocker.patch("azext_iot._factory.AZURE_CLI_CREDENTIAL")
@@ -64,8 +63,7 @@ def test_dps_factory(self, mocker, cloud_config):
6463
mock_client_cls.assert_called_once()
6564
call_kwargs = mock_client_cls.call_args.kwargs
6665
assert call_kwargs["credential_scopes"] == cloud_config["expected_scopes"]
67-
# TODO: Revert to cloud_config["resource_manager"] once 2026-03-01-preview is global
68-
assert call_kwargs["endpoint"] == "https://eastus2euap.management.azure.com"
66+
assert call_kwargs["endpoint"] == cloud_config["resource_manager"]
6967

7068
def test_adr_factory(self, mocker, cloud_config):
7169
mocker.patch("azext_iot._factory.AZURE_CLI_CREDENTIAL")

0 commit comments

Comments
 (0)