Update Synapse Spark Compute Identity in Azure ML
Short answer
A Yes
Question
Key Takeaways
The exam tests whether candidates know that
SynapseSparkComputeaccepts an identity configuration object, specifically requiringManagedIdentityConfigurationwithtype='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.
Common mistake: 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.
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.
Community Votes
78% of anonymous learners picked answer A. Votes are pick records left by other test-takers — they are not the verified answer.
Discussion 5 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 5
-
Arvindu89 👍 3 Answered AThe 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>" ] )
-
Sadhak 👍 2 Answered Aspark_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>" ] )
-
astone42 👍 1 Answered BA 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 Answered BNo. 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 Answered AThe answer is "Yes"
Reader comments & corrections
No reader corrections yet — spotted an error or have a note? Share it below.