
Answer-first summary for fast verification
Answer: begin_create_or_update method of an instance of the azure.ai.ml.MLCIient class
The correct answer is C because the begin_create_or_update method of the azure.ai.ml.MLClient class is the appropriate method to asynchronously create and add a compute instance to an Azure Machine Learning workspace in Python SDK v2. This method handles the provisioning of the compute resource in the workspace. Option A is incorrect as ComputeSchedule is for scheduling compute operations, not creating instances. Option B is incorrect as ComputePowerAction is an enum for power operations like start/stop, not for creating compute instances. Option D is incorrect as set_resources of the Command class is for configuring compute resources for a command job, not for adding a compute instance to the workspace. The community discussion shows 100% consensus on C with upvoted comments confirming this is the correct method for adding compute instances.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
You are developing Python SDK v2 code to add a compute instance to an Azure Machine Learning workspace named workspace1. The code must import all required modules, call the constructor for the ComputeInstance class, and then add the instantiated compute instance to workspace1.
Which method should you use to add the compute instance to the workspace?
A
constructor of the azure.ai.ml.ComputeSchedule class
B
constructor of the azure.ai.ml.ComputePowerAction enum
C
begin_create_or_update method of an instance of the azure.ai.ml.MLCIient class
D
set_resources method of an instance of the azure.ai.ml.Command class
No comments yet.