
Answer-first summary for fast verification
Answer: No
The solution does NOT meet the goal because it fails to specify the subscription ID when instantiating the MLClient. The Workspace.get() method requires the subscription_id parameter to uniquely identify the workspace, especially when there are multiple workspaces with the same name across different subscriptions. In this scenario, there are two 'ml-project' workspaces - one in 'Azure subscription 1' (sub-id-1) and another in 'Azure subscription 2' (sub-id-2). Without specifying the subscription_id, the method cannot determine which 'ml-project' workspace to reference. The community discussion confirms this with 100% consensus on answer B (No), and the top comment explicitly states that the subscription ID must be specified when instantiating the MLClient.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.
You have the following Azure subscriptions and Azure Machine Learning service workspaces:
You need to obtain a reference to the 'ml-project' workspace in the 'Azure subscription 1' subscription.
Solution: Run the following Python code:
from azureml.core import Workspace
ws = Workspace.get(name='ml-project',
subscription_id='sub-id-1',
resource_group='rg1')
from azureml.core import Workspace
ws = Workspace.get(name='ml-project',
subscription_id='sub-id-1',
resource_group='rg1')
Does the solution meet the goal?

A
Yes
B
No