Skip to content

[ARO] Fix #34529: az aro: Use the active cloud's Resource Manager endpoint in sovereign clouds - #34528

Open
Chris Wallen (wallenc) wants to merge 1 commit into
Azure:devfrom
wallenc:aro-fix-sovereign-cloud-base-url
Open

Chris Wallen (wallenc) wants to merge 1 commit into
Azure:devfrom
wallenc:aro-fix-sovereign-cloud-base-url

Conversation

@wallenc

@wallenc Chris Wallen (wallenc) commented Dec 4, 2026 •

Copy link
Copy Markdown

🤖 PR Validation — ️✔️ All clear

Breaking Changes Tests Suppressions
️✔️ None ️✔️ 130/130 ️✔️ None

Related command
az aro

Description
In sovereign clouds (e.g. AzureUSGovernment), az aro sends requests to
https://management.azure.com instead of the active cloud's Resource Manager
endpoint. Auth is requested for the active cloud's scope, so the request fails
with 404 SubscriptionNotFound, because commercial ARM does not know the Gov
subscription.

Cause: cf_aro in _client_factory.py passes base_url_bound=False to
get_mgmt_service_client, so cli_ctx.cloud.endpoints.resource_manager is
never applied and the SDK default base URL is used.

Fix: remove base_url_bound=False so the client is bound to the active cloud's
resource manager endpoint, like other management clients.

Fixes #34529

Testing Guide
az cloud set -n AzureUSGovernment
az login
az aro list --debug

Before: Request URL is https://management.azure.com/subscriptions/.../openShiftClusters
and returns (SubscriptionNotFound) The subscription '...' could not be found.
After: Request URL is https://management.usgovcloudapi.net/... and the clusters in the
subscription are returned.

Verified by overriding the client factory at runtime; commands other than
az aro list were not tested.

History Notes
[ARO] az aro: Fix requests being sent to the public cloud endpoint in sovereign clouds


This checklist is used to make sure that common guidelines for a pull request are followed.

Remove base_url_bound=False so the client uses the active cloud's resource manager endpoint instead of the SDK default (management.azure.com).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings December 4, 2026 18:31
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@microsoft-github-policy-service microsoft-github-policy-service Bot added the customer-reported Issues that are reported by GitHub users external to the Azure organization. label Dec 4, 2026
@microsoft-github-policy-service

Copy link
Copy Markdown
Contributor

Thank you for your contribution Chris Wallen (@wallenc)! We will review the pull request and get back to you soon.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues remain for the change allowing az aro to use the active cloud’s Resource Manager endpoint.

No open issues 🎉

What changed in this PR

Fixes az aro endpoint selection in sovereign clouds by allowing the client to use the active cloud’s Resource Manager endpoint.

Changes:

  • Removes base_url_bound=False, which caused the client to use the SDK’s commercial-cloud default.
File Description
src/​azure-cli/​azure/​cli/​command_modules/​aro/​_client_factory.py Lets the ARO client inherit the active cloud’s endpoint.

Review effort: Balanced

@x-engineering-agent
x-engineering-agent Bot requested a review from a team December 4, 2026 18:41
@wallenc Chris Wallen (wallenc) changed the title [ARO] Fix az aro using commercial ARM endpoint in sovereign clouds [ARO] Fix #34529: az aro: Use the active cloud's Resource Manager endpoint in sovereign clouds Dec 4, 2026
@yonzhan

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

act-codegen-extensibility-squad ARO az aro (Azure Redhat OpenShift) customer-reported Issues that are reported by GitHub users external to the Azure organization.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

az aro: Commands call management.azure.com instead of the active cloud's endpoint, failing with SubscriptionNotFound in AzureUSGovernment

5 participants