Skip to content

Conversation

@emmanuel-karanja
Copy link
Contributor

@emmanuel-karanja emmanuel-karanja commented Apr 2, 2025

This is a fix to the error we are getting whenever the environment is any other than 'Global'. e.g. 'USGov'

CAUSE: Different environments have different root graph-endpoints as shown below:
image

SOLUTION: The idea is to set the right root graph-endpoint by getting the current Environment and setting the right root URL.

It turns out Invoke-GraphRequest detects the context and sets the right root URL so $baseURL will have to be set as a relative URL as in the Get-EntraUser and Get-EntraBetaUser in this PR whenever Invoke-GraphRequest is used within a cmdlet.

FYI: Environment is set when you invoke Connect-Entra(e.g. Connect-Entra -Environment 'USGov') and assumed to be 'Global' if not explicitly set

@learn-build-service-prod
Copy link

Learn Build status updates of commit 9b9f8b1:

✅ Validation status: passed

File Status Preview URL Details
module/Entra/Microsoft.Entra/Users/Get-EntraUser.ps1 ✅Succeeded
module/EntraBeta/Microsoft.Entra.Beta/Users/Get-EntraBetaUser.ps1 ✅Succeeded

For more details, please refer to the build report.

For any questions, please:

@emmanuel-karanja emmanuel-karanja added Ready For Review The PR Ready for Review P0 Highest priority labels Apr 2, 2025
Copy link
Contributor

@SteveMutungi254 SteveMutungi254 left a comment

Choose a reason for hiding this comment

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

LGTM.

@emmanuel-karanja emmanuel-karanja merged commit ac3ecdb into main Apr 3, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P0 Highest priority Ready For Review The PR Ready for Review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Not able to work with GCC High after connecting "Location Header is not set in response"

3 participants