KEMBAR78
Change arc mi's detection algorithm by rayluo · Pull Request #731 · AzureAD/microsoft-authentication-library-for-python · GitHub
Skip to content

Conversation

@rayluo
Copy link
Contributor

@rayluo rayluo commented Aug 9, 2024

This PR will close #727

@rayluo rayluo requested a review from a team as a code owner August 9, 2024 21:57
@rayluo rayluo force-pushed the mi-arc-detection branch from 0b8db7d to fe8f758 Compare August 9, 2024 22:06
Comment on lines +320 to +321
if "IDENTITY_ENDPOINT" in os.environ and "IMDS_ENDPOINT" in os.environ:
return os.environ["IDENTITY_ENDPOINT"]
Copy link
Contributor

Choose a reason for hiding this comment

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

If detecting /var/opt/azcmagent/bin/himds and %ProgramFiles%\AzureConnectedMachineAgent\himds.exe is a reliable method, why bother checking IDENTITY_ENDPOINT and IMDS_ENDPOINT?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Indeed, that is an open topic. @neha-bhargava asked the Arc team specifically on this but received no response.

The current implementation here aligns with the implementation in MSAL .Net. In any case, this subtlety shall be considered as an implementation detail, which might be adjusted in the future again.

Choose a reason for hiding this comment

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

Agree with @rayluo. Added this in addition to env variable detection since env variables detection have been a success in case of windows. Might remove the env variable detection in future.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request] Add file based detection for Azure Arc

3 participants