populate MicrosoftGraphUrl when ARM metadata omits trailing slash#453
Open
MaddyMicrosoft wants to merge 1 commit into
Open
populate MicrosoftGraphUrl when ARM metadata omits trailing slash#453MaddyMicrosoft wants to merge 1 commit into
MaddyMicrosoft wants to merge 1 commit into
Conversation
Call TrimEnd('/') unconditionally so MicrosoftGraphUrl is derived whenever
MicrosoftGraphResourceId is present. Behavior is unchanged for endpoints
that already include a trailing slash.
Added test fixtures and unit tests covering both shapes:
- ArmResponseMicrosoftGraphNoTrailingSlash.json
- ArmResponseMicrosoftGraphWithTrailingSlash.json
Fixes ICM 787125398
Related: Azure/CLIPS#179
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request updates ARM-metadata-to-AzureEnvironment mapping so MicrosoftGraphUrl is consistently populated whenever MicrosoftGraphResourceId is present, even when the ARM metadata omits a trailing /. This aligns discovered environment behavior with the built-in environment constants (resource ID commonly ends with /, URL commonly does not).
Changes:
- Always derive
ExtendedEndpoint.MicrosoftGraphUrlfromMicrosoftGraphResourceId.TrimEnd('/')(no longer gated onEndsWith("/")). - Add new ARM metadata JSON fixtures covering both trailing-slash and no-trailing-slash shapes.
- Add unit tests validating both shapes map to the expected
MicrosoftGraphEndpointResourceIdandMicrosoftGraphUrlproperties.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/Authentication.Abstractions/AzureEnvironment.cs |
Unconditionally derives MicrosoftGraphUrl from MicrosoftGraphResourceId by trimming trailing slashes. |
src/Authentication.Abstractions.Test/TestData/ArmResponseMicrosoftGraphWithTrailingSlash.json |
Adds ARM metadata fixture where microsoftGraphResourceId includes a trailing /. |
src/Authentication.Abstractions.Test/TestData/ArmResponseMicrosoftGraphNoTrailingSlash.json |
Adds ARM metadata fixture where microsoftGraphResourceId does not include a trailing /. |
src/Authentication.Abstractions.Test/AzureEnvironmentTests.cs |
Adds tests validating MicrosoftGraphUrl population for both ARM metadata shapes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Call TrimEnd('/') unconditionally so MicrosoftGraphUrl is derived whenever MicrosoftGraphResourceId is present. Behavior is unchanged for endpoints that already include a trailing slash.
Added test fixtures and unit tests covering both shapes:
Fixes ICM 787125398
Related: Azure/CLIPS#179