AI-300 · Domain 1: Design and implement an MLOps infrastructure · 19% of the exam
Task 1.3: Implement IaC for Machine Learning
Secure GitHub integration, Bicep and Azure CLI deployments of workspaces and resources, GitHub Actions provisioning workflows, network restrictions on workspaces, and Git source control for machine learning projects.
Study it
GitHub Actions with OpenID Connect and the Azure Machine Learning CLI
Lesson coming
Bicep templates for workspaces and resources
Lesson coming
Managed virtual networks, private endpoints and outbound rules
Try each one before opening the answer. Every option is explained, with the Microsoft documentation page that proves it.
Question 1 · choose 1
A research team's workspace uses a managed virtual network in Allow only approved outbound mode. Its jobs now need many public hosts that change every week and can't be listed in advance. Security accepts internet outbound for this team as long as the work keeps a managed virtual network. What should you do?
ARun az ml workspace update with --managed-network allow_internet_outbound on the current workspace
BDisable the managed virtual network, then enable it again in Allow internet outbound mode
CKeep the current mode and add an FQDN outbound rule for each new host as the jobs need it
DCreate a new workspace whose managed network allows internet outbound, then move the work over
Show the answer and why
ARun az ml workspace update with --managed-network allow_internet_outbound on the current workspace
Incorrect
A workspace set to allow only approved outbound can't be reconfigured to allow internet outbound.
BDisable the managed virtual network, then enable it again in Allow internet outbound mode
Incorrect
Once managed virtual network isolation is enabled, in either mode, it can't be disabled.
CKeep the current mode and add an FQDN outbound rule for each new host as the jobs need it
Incorrect
FQDN rules work in this mode, but hosts that change weekly and can't be listed in advance can't be kept up as rules.
DCreate a new workspace whose managed network allows internet outbound, then move the work over
Correct
The existing workspace can't move from approved outbound back to internet outbound, so the open mode needs a new workspace.
After you configure a managed virtual network workspace to allow only approved outbound, you can't reconfigure it to allow internet outbound, and after you configure one to allow internet outbound, you can't reconfigure it to disabled. Once managed virtual network isolation is enabled in either mode, it can't be disabled. A team that needs open outbound internet access while keeping a managed virtual network therefore needs a new workspace created in Allow internet outbound mode, with its compute re-created there.
A GitHub Actions workflow creates a workspace with a managed virtual network and then immediately creates a managed online deployment. The deployment fails with WorkspaceManagedNetworkNotReady. The workflow creates no compute. What should the workflow do?
ARetry the deployment in a loop until the managed network finishes provisioning on its own in the background
BSet egress_public_network_access to disabled on the deployment so it doesn't depend on the managed network
CProvision the managed network, for example with az ml workspace provision-network, before the deployment
DCreate the deployment first with public outbound access and enable the managed network on the workspace afterwards
Show the answer and why
ARetry the deployment in a loop until the managed network finishes provisioning on its own in the background
Incorrect
The network is provisioned automatically only when compute is created or provisioning is forced.
BSet egress_public_network_access to disabled on the deployment so it doesn't depend on the managed network
Incorrect
That flag no longer applies once the workspace uses a managed virtual network.
CProvision the managed network, for example with az ml workspace provision-network, before the deployment
Correct
Online deployments need the managed network provisioned first.
DCreate the deployment first with public outbound access and enable the managed network on the workspace afterwards
Incorrect
Existing managed online endpoints must be recreated after enabling the managed network.
Creation of the managed virtual network is deferred until a compute resource is created or provisioning is started manually. To create an online deployment, provision the managed network manually (or create a compute instance first); otherwise the deployment fails with WorkspaceManagedNetworkNotReady.
A CI pipeline redeploys an ARM template that creates a workspace with its storage, key vault and container registry on every merge. After the second run, compute instances fail to start and stop. Redeployments must stay idempotent. What should you change?
APass the existing key vault's resource ID to the template and remove the key vault resource from it
BAdd the workspace identity's access policy to the key vault by hand after each deployment
CDeploy the template in Complete mode so that every resource matches the template exactly
DDelete and re-create the container registry on each run so that the workspace re-registers
Show the answer and why
APass the existing key vault's resource ID to the template and remove the key vault resource from it
Correct
Reusing the existing vault keeps its access policies, which re-creating the vault clears.
BAdd the workspace identity's access policy to the key vault by hand after each deployment
Incorrect
It repairs the symptom each time, and the template still clears the policies on the next run.
CDeploy the template in Complete mode so that every resource matches the template exactly
Incorrect
The vault is still re-created from the template, which clears the access policies.
DDelete and re-create the container registry on each run so that the workspace re-registers
Incorrect
The registry isn't what breaks: the template clears the key vault's access policies, and touching the registry doesn't restore them.
Most template operations are idempotent, but Key Vault clears its access policies each time the template is used, which breaks access for workspaces that use the vault (for example, stopping and creating compute instances). Check whether the key vault exists and, if so, pass its ID as a parameter, remove the key vault resource and its dependsOn entry, and set the workspace's keyVault property to that ID.
A cleanup script plans to delete the container registry that a workspace created. What happens if it does?
AThe workspace becomes inoperative and stops working
BThe workspace re-creates the registry on the next image build
COnly cached images are lost, and builds slow down
DNothing, as the registry is optional
Show the answer and why
AThe workspace becomes inoperative and stops working
Correct
Once a registry is created for a workspace, deleting it breaks the workspace.
BThe workspace re-creates the registry on the next image build
Incorrect
The registry isn't re-created automatically.
COnly cached images are lost, and builds slow down
Incorrect
The workspace itself stops working.
DNothing, as the registry is optional
Incorrect
It's optional at creation, not after the workspace uses it.
The template article warns that after a container registry is created for a workspace, you shouldn't delete it, because doing so makes the Azure Machine Learning workspace inoperative.
Before deploying workspaces with a managed VNet from templates, which resource provider must be registered in the subscription?
AMicrosoft.Compute
BMicrosoft.Batch
CMicrosoft.Network
DMicrosoft.EventGrid
Show the answer and why
AMicrosoft.Compute
Incorrect
It isn't the provider the managed network's private endpoints need.
BMicrosoft.Batch
Incorrect
Batch isn't required for the managed network.
CMicrosoft.Network
Correct
The workspace uses it to create private endpoints for the managed network.
DMicrosoft.EventGrid
Incorrect
Event Grid is for events, not networking.
If you want to use a managed virtual network with Azure Machine Learning, the Microsoft.Network resource provider must be registered, because the workspace uses it when it creates private endpoints for the managed virtual network.
A training job's properties show azureml.git.dirty as True. What does that mean?
AThe job's code snapshot failed to upload to the workspace's default storage
BThe repository's remote URL couldn't be found
CThe commit was pushed after the job finished
DThe repository had uncommitted changes when the job was submitted
Show the answer and why
AThe job's code snapshot failed to upload to the workspace's default storage
Incorrect
Upload failures aren't recorded in that property.
BThe repository's remote URL couldn't be found
Incorrect
The remote URL is in azureml.git.repository_uri.
CThe commit was pushed after the job finished
Incorrect
The property describes the state at submission.
DThe repository had uncommitted changes when the job was submitted
Correct
The property is True when the branch or commit is dirty.
When a job is submitted from a local Git repository, Azure Machine Learning records Git properties: azureml.git.repository_uri, azureml.git.branch, azureml.git.commit, and azureml.git.dirty, which is True if the branch or commit is dirty (from git status --porcelain).
A data scientist generates an SSH key in a compute instance terminal to clone from GitHub. Who can use that key file?
AEvery user of the workspace through the shared file system
BOnly the compute instance's owner, on that instance
CAnyone with Contributor on the workspace
DAny job that runs on the compute instance
Show the answer and why
AEvery user of the workspace through the shared file system
Incorrect
The key isn't stored on the shared file share.
BOnly the compute instance's owner, on that instance
Correct
The key file saves on the instance and is accessible only to its owner.
CAnyone with Contributor on the workspace
Incorrect
Workspace roles don't expose the instance owner's key.
DAny job that runs on the compute instance
Incorrect
The key file is accessible only to the instance owner, not to jobs.
When you run ssh-keygen in the terminal, the key file saves on the compute instance and is accessible only to the compute instance owner. You then add the public key to your Git account and clone over SSH.