Skip to content

Add file based Azure Arc detection #955

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

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from
Open

Add file based Azure Arc detection #955

wants to merge 3 commits into from

Conversation

Avery-Dunn
Copy link
Collaborator

Fixes the issue described in #846, and is similar to the fix in MSAL .NET: AzureAD/microsoft-authentication-library-for-dotnet#4856

This PR adds file-based detection of Azure Arc, in addition to the current detection based on environment variables. If the files are found but the identity endpoint variable is not set, we default to a known endpoint.

@Avery-Dunn Avery-Dunn requested a review from a team as a code owner May 14, 2025 21:47
Copy link
Collaborator

@neha-bhargava neha-bhargava left a comment

Choose a reason for hiding this comment

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

The changes looks good, were you able to test it?

Copy link
Member

@bgavrilMS bgavrilMS left a comment

Choose a reason for hiding this comment

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

Needs at least a test for whatever OS the CI is using.

@Avery-Dunn
Copy link
Collaborator Author

Needs at least a test for whatever OS the CI is using.

@bgavrilMS : I originally didn't add tests because it is very difficult to modify static/final variables in a test and our mocking framework doesn't allow mocks of low-level Java features like file manipulation, and the PR over in .NET didn't have them so I figured y'all ran into similar issues too.

However, in the latest commit I removed the 'final' modifier from the final paths and added some package-private setters, allowing the tests to create temp directories to test the new behavior. We have some similar used-for-tests-only setters for a few other fields that otherwise could be private, and this is basically the only way to have meaningful tests for this file detection.

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.

4 participants