Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change arc mi's detection algorithm #731

Merged
merged 1 commit into from
Aug 15, 2024
Merged

Change arc mi's detection algorithm #731

merged 1 commit into from
Aug 15, 2024

Conversation

rayluo
Copy link
Collaborator

@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
Collaborator 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.

@rayluo rayluo merged commit fe8f758 into dev Aug 15, 2024
12 checks passed
@rayluo rayluo deleted the mi-arc-detection branch August 15, 2024 19:10
@rayluo rayluo mentioned this pull request Sep 5, 2024
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