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

Added Support for Azure Machine Learning in Managed Identity #7512

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

Conversation

Robbie-Microsoft
Copy link
Collaborator

Fixes #7489

Added Machine Learning Managed Identity Source

Tested with unit tests.

@github-actions github-actions bot added documentation Related to documentation. msal-node Related to msal-node package labels Jan 15, 2025
@Robbie-Microsoft Robbie-Microsoft marked this pull request as ready for review January 15, 2025 22:20
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 5 out of 9 changed files in this pull request and generated 1 comment.

Files not reviewed (4)
  • change/@azure-msal-node-ca262c56-49c0-4e6c-b402-b296b4a10d52.json: Language not supported
  • lib/msal-node/src/client/ManagedIdentitySources/ServiceFabric.ts: Evaluated as low risk
  • lib/msal-node/test/test_kit/StringConstants.ts: Evaluated as low risk
  • lib/msal-node/docs/managed-identity.md: Evaluated as low risk
Comments suppressed due to low confidence (1)

lib/msal-node/src/utils/Constants.ts:12

  • [nitpick] The constant name 'MACHINE_LEARNING_AND_SERVICE_FABRIC_SECRET_HEADER_NAME' is too long and unclear. Consider renaming it to 'ML_AND_SF_SECRET_HEADER_NAME'.
export const MACHINE_LEARNING_AND_SERVICE_FABRIC_SECRET_HEADER_NAME: string = "secret";

Copy link

@gladjohn gladjohn left a comment

Choose a reason for hiding this comment

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

The environment variables we need to check are MSI_ENDPOINT and MSI_SECRET

Please also add a test where App Service 2019 and App Service 2017 (aka ML Source) are present. If so, App Service 2019 must be the detected source.

Choose a reason for hiding this comment

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

Copilot reviewed 5 out of 9 changed files in this pull request and generated no comments.

Files not reviewed (4)
  • change/@azure-msal-node-ca262c56-49c0-4e6c-b402-b296b4a10d52.json: Language not supported
  • lib/msal-node/src/client/ManagedIdentitySources/ServiceFabric.ts: Evaluated as low risk
  • lib/msal-node/src/utils/Constants.ts: Evaluated as low risk
  • lib/msal-node/test/client/ManagedIdentitySources/MachineLearning.spec.ts: Evaluated as low risk
Comments suppressed due to low confidence (1)

lib/msal-node/src/client/ManagedIdentitySources/MachineLearning.ts:16

  • [nitpick] The constant name ML_AND_SF_SECRET_HEADER_NAME is ambiguous. It should be renamed to MACHINE_LEARNING_SECRET_HEADER_NAME to be more specific.
ML_AND_SF_SECRET_HEADER_NAME
jest.restoreAllMocks();
});

test("ensures that App Service is selected as the Managed Identity source when all of its and Machine Learning's environment variables are present", async () => {
Copy link

@gladjohn gladjohn Jan 17, 2025

Choose a reason for hiding this comment

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

sorry I am not very familiar with spec.ts, but where do you set MSI_ENDPOINT and MSI_SECRET along with App Service Env Variables but MSAL still picks App Service as MI Source

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

search the file for "process.env[".

for example: process.env[ManagedIdentityEnvironmentVariableNames.MSI_ENDPOINT] = "fake_MSI_ENDPOINT";

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Related to documentation. msal-node Related to msal-node package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] Azure ML MSI support is missing
2 participants