Azure ML Workspace Authentication with MLClient.from_config
Short answer
B No
Question
- 
Key Takeaways
The exam tests knowledge of the azure-ai-ml library's initialization methods, specifically trapping candidates who assume default authentication works without explicit configuration or credentials in code.
This question tests the correct syntax for authenticating Azure Machine Learning workspaces using the Python SDK. The community consensus indicates that the provided solution fails because it omits a required credential parameter.
Common mistake: Many candidates select 'Yes' (Option A) assuming that if they are logged into Azure CLI, the SDK will automatically pick up their identity without needing to pass a credential object explicitly in this specific method call context.
Expert Analysis
Why the Answer Is Correct
The suggested answer is B (No) because the MLClient.from_config() method in the modern azure-ai-ml package typically requires an identity or credential argument depending on the specific version and environment setup, especially when not relying on implicit environment variables. While from_config() reads configuration from a file, secure practices and many exam scenarios require explicit credential handling for production-grade references.
Why the Other Options Are Wrong
Selecting Option A implies the code is sufficient. This is incorrect because the code snippet shown (implied by the context of comments) likely lacks the necessary credential instantiation or passes an incomplete object. In strict certification contexts, omitting explicit security parameters is considered a failure to meet best practices for workspace access.
Community Comment Notes
Comment [1] argues for 'Yes' based on Azure CLI default auth, which is valid in local dev but often considered insufficient in exam logic requiring explicit code correctness. Comments [2], [3], and [6] correctly identify that the credential parameter is mandatory or missing, leading to the correct conclusion that the solution does not meet the goal of obtaining a secure reference.
Official Reference
This link opens the official vendor documentation in a new tab.
Exam Strategy
Always verify if the SDK method requires explicit credential objects versus relying on environment defaults. In DP-100, prefer solutions that explicitly handle authentication rather than those assuming implicit context, unless the scenario specifically highlights a local development environment.
Community Votes
57% of anonymous learners picked answer B. Votes are pick records left by other test-takers — they are not the verified answer.
Discussion 6 contributions
Compiled from public community threads and reader submissions, lightly edited for clarity. Handles and vote tallies are shown as recorded, and comments reflect the views of individual contributors.
From public community threads 6
-
jl420 👍 2 Answered AMLClient.from_config() can be used without explicitly providing credentials, as long as your authentication requirements are met in one of the following ways: Default Authentication with Azure CLI Login: If you’ve already authenticated using the Azure CLI (e.g., az login), MLClient.from_config() will use your active Azure CLI session for authentication. This is often convenient for development environments and local testing. Managed Identity (for Azure Compute Resources): If you’re running your code on an Azure resource with a managed identity (like an Azure Virtual Machine, Azure Kubernetes Service, or Azure Machine Learning Compute Instance), the SDK can authenticate using the managed identity associated with that resource. No additional credentials are needed, as long as the managed identity has access to the Azure ML workspace. Environment-Based Authentication: If environment variables for Azure credentials are set (e.g., AZURE_CLIENT_ID, AZURE_TENANT_ID, and AZURE_CLIENT_SECRET for a service principal), MLClient.from_config() will pick up these credentials automatically.
-
zishankamal 👍 2Unsure. The credential parameter is not specified which is mandatory. Otherwise class and method is correct.
-
Plb2 👍 2 Answered Bcredential-parameter is required
-
sl_mslconsulting 👍 1 Answered Bcredential is a required parameter in the from_config method . Link: https://learn.microsoft.com/en-us/python/api/azure-ai-ml/azure.ai.ml.mlclient?view=azure-python#azure-ai-ml-mlclient-from-config
-
Murzfam 👍 1 Answered BThe questions is reference to ml-project workspace. The solutions is only about auth, so the answer is B.
Show 1 more comment
-
evangelist 👍 1 Answered AAnswer should be Yes, it appeared previously in the exam questions
Reader comments & corrections
No reader corrections yet — spotted an error or have a note? Share it below.