nerdexam
Microsoft

DP-100 · Question #405

Drag and Drop Question You create an Azure Machine Learning workspace and an Azure Synapse Analytics workspace with a Spark pool. The workspaces are contained within the same Azure subscription. You m

The correct answer is Create an instance of the azure.ai.MLClient class.; Define the Spark pool configuration with the SparkResourceConfiguration class.; Attach the Synapse Spark pool with the azure.ai.mlClient.begin_create_or_update() function.. The correct sequence for attaching an Azure Synapse Spark pool to an Azure Machine Learning workspace using the Python SDK v2 involves initializing the MLClient, defining the Spark pool configuration, and then executing the attachment command.

Design and prepare a machine learning solution

Question

Drag and Drop Question You create an Azure Machine Learning workspace and an Azure Synapse Analytics workspace with a Spark pool. The workspaces are contained within the same Azure subscription. You must manage the Synapse Spark pool from the Azure Machine Learning workspace. You need to attach the Synapse Spark pool in Azure Machine Learning by using the Python SDK v2. Which three actions should you perform in sequence? To answer, move the appropriate actions from the list of actions to the answer area and arrange them in the correct order. Answer:

Exhibit

DP-100 question #405 exhibit

Answer Area

Drag items

Attach the Synapse Spark pool with the azure.ai.mlClient.begin_create_or_update() function.Define the Spark pool configuration with the SparkResourceConfiguration class.Create an instance of the azure.ai.MLClient class.Link the Synapse workspace to the Azure Machine Learning workspace.Attach the Synapse Spark pool with the SparkComponent class.Define Spark pool configuration with the SynapseSparkCompute class.

Correct arrangement

  • Create an instance of the azure.ai.MLClient class.
  • Define the Spark pool configuration with the SparkResourceConfiguration class.
  • Attach the Synapse Spark pool with the azure.ai.mlClient.begin_create_or_update() function.

Explanation

The correct sequence for attaching an Azure Synapse Spark pool to an Azure Machine Learning workspace using the Python SDK v2 involves initializing the MLClient, defining the Spark pool configuration, and then executing the attachment command.

Approach. To attach an Azure Synapse Spark pool to an Azure Machine Learning workspace using the Python SDK v2, the following three actions should be performed in sequence:

  1. Create an instance of the azure.ai.ml.MLClient class.

    • This is the fundamental first step for almost any interaction with the Azure Machine Learning service using the Python SDK v2. The MLClient class provides the interface to manage resources within your AML workspace, including compute targets. You must initialize it with your subscription, resource group, and workspace details, along with credentials.
  2. Define the Spark pool configuration with the SparkResourceConfiguration class.

    • Before attaching the Synapse Spark pool, you need to define its configuration. While the azure.ai.ml.entities.SynapseSparkCompute class is typically used to represent the Synapse Spark compute target entity itself, the exam question's option for 'SparkResourceConfiguration' implies the step of preparing the resource-specific parameters for the compute. This configuration object will specify details like the Synapse workspace ID and the Spark pool name, which are crucial for the attachment process.
  3. Attach the Synapse Spark pool with the azure.ai.ml.MLClient.begin_create_or_update() function.

    • Once the MLClient is ready and the compute configuration object (which encapsulates the details for the Synapse Spark pool) has been defined, the begin_create_or_update() method (specifically ml_client.compute.begin_create_or_update()) is called. This function takes the defined compute object as an argument and submits the request to Azure to either create a new compute target or update an existing one, effectively attaching the Synapse Spark pool to the Azure Machine Learning workspace.

Common mistakes.

  • common_mistake. 1. 'Link the Synapse workspace to the Azure Machine Learning workspace.' This option describes a conceptual integration or an administrative step, potentially performed via the Azure portal or Azure CLI, but it is not a direct programmatic action using the azure.ai.ml Python SDK v2 specifically for attaching a Spark pool. The question asks for SDK v2 actions to attach the pool, not the entire workspace.
  1. 'Attach the Synapse Spark pool with the SparkComponent class.' The SparkComponent class in Azure ML SDK v2 is used to define reusable components for Spark jobs within pipelines, not for attaching external compute resources like a Synapse Spark pool itself. This would be used within a job definition, not for the compute attachment process.
  2. 'Define Spark pool configuration with the SynapseSparkCompute class.' Although azure.ai.ml.entities.SynapseSparkCompute is the dedicated entity class for defining a Synapse Spark compute target within AML SDK v2, the provided correct answer sequence (as shown in the second exhibit image) explicitly lists 'Define the Spark pool configuration with the SparkResourceConfiguration class.' as the second step. In the context of this specific exam question, the latter is presented as the intended configuration step, possibly implying a more abstract 'configuration' stage before instantiating the final compute object for attachment. Choosing SynapseSparkCompute would be technically more precise for creating the compute entity, but the question's solution implies SparkResourceConfiguration for the 'configuration' step.

Concept tested. Azure Machine Learning SDK v2 for Python - Attaching external compute targets (specifically Azure Synapse Spark pools), client initialization, and programmatic resource configuration and management.

Topics

#Azure Machine Learning#Azure Synapse Analytics#Spark Pools#Python SDK v2

Community Discussion

No community discussion yet for this question.

Full DP-100 Practice