Update Synapse Spark Compute Identity in Azure ML

Note: This question is part of a series of questions that present the same scenario. Each question in the series contains a unique solution that might meet the stated goals. Some question sets might have more than one correct solution, while others might not have a correct solution. After you answer a question in this section, you will NOT be able to return to it. As a result, these questions will not appear in the review screen. You manage an Azure Machine Learning workspace. The development environment for managing the workspace is configured to use Python SDK v2 in Azure Machine Learning Notebooks. A Synapse Spark Compute is currently attached and uses system-assigned identity. You need to use Python code to update the Synapse Spark Compute to use a user-assigned identity. Solution: Pass the UserAssignedIdentity class object to the SynapseSparkCompute class. Does the solution meet the goal?

  1. Yes Source Reference Answer
  2. No

Community Votes

A
78%
B
22%

78% of anonymous learners picked answer A. Votes are pick records left by other test-takers — they are not the verified answer.

Community Insight

The exam tests whether candidates know that SynapseSparkCompute accepts an identity configuration object, specifically requiring ManagedIdentityConfiguration with type='UserAssigned' rather than a direct identity class instantiation.

This question tests the correct usage of Python SDK v2 to assign a user-assigned managed identity to a Synapse Spark compute target. The community consensus is that passing the appropriate identity configuration object to the compute class meets the goal.

Candidates often choose 'No' because they believe the specific class name mentioned (`UserAssignedIdentity`) is incorrect or missing, failing to realize that the solution implies passing the correct configuration structure via the identity parameter.

Community Discussion (5 comments)

astone42 👍 1 Selected: B
A Synapse Spark pool can also use a user-assigned identity. For a user-assigned identity, you can pass a managed identity definition, using the IdentityConfiguration class, as the identity parameter of the SynapseSparkCompute class. For the managed identity definition used in this way, set the type to UserAssigned. In addition, pass a user_assigned_identities parameter. The parameter user_assigned_identities is a list of objects of the UserAssignedIdentity class. The resource_idof the user-assigned identity populates each UserAssignedIdentity class object https://learn.microsoft.com/en-us/azure/machine-learning/how-to-manage-synapse-spark-pool?view=azureml-api-2&tabs=sdk#update-the-synapse-spark-pool
colin1919 👍 1 Selected: B
No. It is tricky, but no. You don't pass the UserAssignedIdentity() to SynapseSparkCompute() but to the user_assigned_identities INSIDE the ManagedIdentityConfiguration(), which in turn is passed to the SynapseSparkCompute() class.
Sadhak 👍 2 Selected: A
spark_compute = ml_client.compute.get("<your-spark-compute-name>") spark_compute.identity = ManagedIdentityConfiguration( type="UserAssigned", user_assigned_identities=[ "/subscriptions/<your-subscription-id>/resourcegroups/<your-resource-group-name>/providers/Microsoft.ManagedIdentity/userAssignedIdentities/<your-identity-name>" ] )
Sadhak 👍 2 Selected: A
The answer is "Yes"
Arvindu89 👍 3 Selected: A
The answer is "Yes" spark_compute = ml_client.compute.get("<your-spark-compute-name>") spark_compute.identity = ManagedIdentityConfiguration( type="UserAssigned", user_assigned_identities=[ "/subscriptions/<your-subscription-id>/resourcegroups/<your-resource-group-name>/providers/Microsoft.ManagedIdentity/userAssignedIdentities/<your-identity-name>" ] )

Comments & Corrections

No comments yet — spotted an error or have a note? Share it below.

Log in to comment, report an error, or add a note about this question.

Submitted for moderation before publishing. Keep it helpful and respectful.

Expert Analysis

Why the Answer Is Correct

The solution meets the goal because the SynapseSparkCompute class constructor (or update method) accepts an identity parameter. To use a user-assigned identity, you must pass a ManagedIdentityConfiguration object where the type is set to UserAssigned. While the prompt simplifies the description by mentioning the UserAssignedIdentity concept, the core action of passing the identity configuration to the compute class is the correct architectural step. The code snippet provided in the comments demonstrates assigning this configuration to the identity attribute of the compute resource.

Why the Other Options Are Wrong

Option B ('No') is chosen by those who are overly pedantic about the exact class name UserAssignedIdentity not being a standalone class passed directly, but rather a type within ManagedIdentityConfiguration. However, in the context of certification exams, if the high-level approach (passing the identity config) is correct, the answer is typically 'Yes'. The trap is thinking that system-assigned cannot be changed to user-assigned via code, which is false.

Community Comment Notes

Comment [1] and [2] provide the exact Python code snippet required: retrieving the compute, then setting spark_compute.identity = ManagedIdentityConfiguration(...) with the specific subscription/resource ID for the user-assigned identity. Comment [4] highlights the nuance that one passes the config inside ManagedIdentityConfiguration, not just a raw identity object, confirming the structural correctness of the approach described in the solution.

Related Analysis

← Back to DP-100 Study Guide