Spec: Region discovery via IMDS /compute endpoint (#6039)#6044
Merged
Conversation
Spec for issue #6039: migrate RegionManager from /compute/location (text, api-version 2020-06-01) to /compute (JSON, api-version 2021-02-01). No public API change; env-var precedence, caching, retry, timeouts, telemetry, and fallback are all preserved. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a specification document describing how MSAL.NET should migrate region auto-discovery from the legacy IMDS text endpoint (/metadata/instance/compute/location) to the newer JSON IMDS /metadata/instance/compute endpoint and parse the location field, without introducing public API changes.
Changes:
- Introduces a new spec covering motivation, discovery order, request/response contract, and API-version fallback behavior.
- Documents caching/retry/timeout/telemetry expectations (intended to remain unchanged).
- Provides a concrete test plan and non-normative implementation notes for the follow-up implementation PR.
…th claims - Drop incorrect claim that IMDS body is normalized; only REGION_NAME env var is normalized today and this spec does not change that. - Drop incorrect claim that RegionDiscoveryFailureReason includes the IMDS URL via imdsUri.AbsoluteUri; clarify the URL is not in the failure reason today and is intentionally out of scope (protects public TestConstants). - Remove test row 11 (mixed-case/spaces normalization) since IMDS body is not normalized; renumber. - Use full path for ClientCredentialWithRegionTests.cs. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
neha-bhargava
approved these changes
May 29, 2026
gladjohn
reviewed
May 30, 2026
Captures the unified ImdsComputeSnapshot follow-up discussed with @gladjohn and @neha-bhargava on PR #6044, with explicit out-of-scope note for MI source detection. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
gladjohn
approved these changes
Jun 1, 2026
neha-bhargava
approved these changes
Jun 1, 2026
Member
|
@neha-bhargava - how should we consolidate all this logic? Like some helper MSAL API that has all this logic to avoid duplication? |
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.
Spec for #6039: migrate MSAL.NET region auto-discovery from the legacy IMDS text endpoint
/metadata/instance/compute/location(api-version2020-06-01,format=text) to the newer JSON endpoint/metadata/instance/compute(api-version2021-02-01), parsing thelocationfield.What's in the spec
REGION_NAMEenv var -> IMDS/computeJSON -> api-version probe on 400 -> failDesign decisions
format=text. New endpoint is JSON-native./compute/location. Same host, same failure modes; clean cutover.location->FailedAutoDiscovery(matches today's empty-body behavior).ValidateRegion. No new validation rules.imdsUri.AbsoluteUri.Scope
This PR is the spec only. Implementation will be a follow-up PR.