Repository navigation
[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
Open
[ARO] Fix #34529: az aro: Use the active cloud's Resource Manager endpoint in sovereign clouds#34528Chris Wallen (wallenc) wants to merge 1 commit into
az aro: Use the active cloud's Resource Manager endpoint in sovereign clouds#34528Chris Wallen (wallenc) wants to merge 1 commit into
Conversation
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>
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
|
Thank you for your contribution Chris Wallen (@wallenc)! We will review the pull request and get back to you soon. |
Contributor
There was a problem hiding this comment.
🟢 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
az aro: Use the active cloud's Resource Manager endpoint in sovereign clouds
Collaborator
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 PR Validation — ️✔️ All clear
Related command
az aro
Description
In sovereign clouds (e.g. AzureUSGovernment),
az arosends requests tohttps://management.azure.cominstead of the active cloud's Resource Managerendpoint. 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_aroin_client_factory.pypassesbase_url_bound=Falsetoget_mgmt_service_client, socli_ctx.cloud.endpoints.resource_managerisnever applied and the SDK default base URL is used.
Fix: remove
base_url_bound=Falseso the client is bound to the active cloud'sresource 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/.../openShiftClustersand returns
(SubscriptionNotFound) The subscription '...' could not be found.After: Request URL is
https://management.usgovcloudapi.net/...and the clusters in thesubscription are returned.
Verified by overriding the client factory at runtime; commands other than
az aro listwere not tested.History Notes
[ARO]
az aro: Fix requests being sent to the public cloud endpoint in sovereign cloudsThis checklist is used to make sure that common guidelines for a pull request are followed.
The PR title and description has followed the guideline in Submitting Pull Requests.
I adhere to the Command Guidelines.
I adhere to the Error Handling Guidelines.