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?
Community Votes
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
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.
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)
Comments & Corrections
No comments yet — spotted an error or have a note? Share it below.
Expert Analysis
Why the Answer Is Correct
The solution meets the goal because theSynapseSparkCompute 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 nameUserAssignedIdentity 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 settingspark_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.