
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 standard approach in Azure ML Python SDK v2 to asynchronously create or update compute resources, including compute instances. This method handles the provisioning of the compute instance in the workspace. Option A is incorrect as ComputeSchedule is for scheduling compute operations, not creating instances. Option B is invalid since ComputePowerAction is an enum for power operations, not a constructor. Option D is incorrect because set_resources method of the Command class is used for configuring compute resources for a command job, not for adding a compute instance to the workspace. The community discussion confirms this with 100% consensus on C and upvoted comments explaining that begin_create_or_update is the appropriate method for asynchronous instance creation.
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 necessary 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.