Skip to content

Change arc mi's detection algorithm - #731

Merged
Ray Luo (rayluo) merged 1 commit into
devfrom
mi-arc-detection
Aug 15, 2024
Merged

Change arc mi's detection algorithm#731
Ray Luo (rayluo) merged 1 commit into
devfrom
mi-arc-detection

Conversation

@rayluo

Copy link
Copy Markdown
Contributor

This PR will close #727

@rayluo
Ray Luo (rayluo) requested a review from a team as a code owner August 9, 2024 21:57
Comment thread msal/managed_identity.py
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
Copy Markdown
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
Copy Markdown
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 (@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 Ray Luo (@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