Question 5
Domain 1: Design and prepare a machine learning solutionYou need to create a reusable environment for multiple jobs in Azure Machine Learning SDK v2. What should you do?
Correct answer: B
Explanation
In Azure Machine Learning SDK v2, an environment is a reusable asset that can be shared across jobs. Creating it once and registering it in the workspace lets multiple jobs reference the same environment instead of redefining it each time.
Why each option is right or wrong
A. Define the environment inline inside each job YAML
B. Create the environment once and register it in the workspace
Azure Machine Learning SDK v2 treats an environment as a workspace asset, so it is created once and then registered for reuse by name and version across jobs. The relevant behavior is governed by the Azure ML v2 asset model: registered assets are stored in the workspace and can be referenced by multiple jobs without recreating the definition each time, which is the only approach that supports consistent reuse across runs.
C. Embed the environment in the compute cluster definition
D. Use mlflow.environment.create()