Skip to content

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

    Partly covered by: VPC: Subnets, NAT & Firewalls

  • Git source control for machine learning projects

    Lesson coming

Sample questions

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?

  1. ARun az ml workspace update with --managed-network allow_internet_outbound on the current workspace
  2. BDisable the managed virtual network, then enable it again in Allow internet outbound mode
  3. CKeep the current mode and add an FQDN outbound rule for each new host as the jobs need it
  4. 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.

Question 2 · choose 1

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?

  1. ARetry the deployment in a loop until the managed network finishes provisioning on its own in the background
  2. BSet egress_public_network_access to disabled on the deployment so it doesn't depend on the managed network
  3. CProvision the managed network, for example with az ml workspace provision-network, before the deployment
  4. 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.

Question 3 · choose 1

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?

  1. APass the existing key vault's resource ID to the template and remove the key vault resource from it
  2. BAdd the workspace identity's access policy to the key vault by hand after each deployment
  3. CDeploy the template in Complete mode so that every resource matches the template exactly
  4. 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.

Question 4 · choose 1

A cleanup script plans to delete the container registry that a workspace created. What happens if it does?

  1. AThe workspace becomes inoperative and stops working
  2. BThe workspace re-creates the registry on the next image build
  3. COnly cached images are lost, and builds slow down
  4. 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.

Question 5 · choose 1

Before deploying workspaces with a managed VNet from templates, which resource provider must be registered in the subscription?

  1. AMicrosoft.Compute
  2. BMicrosoft.Batch
  3. CMicrosoft.Network
  4. 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.

Question 6 · choose 1

A training job's properties show azureml.git.dirty as True. What does that mean?

  1. AThe job's code snapshot failed to upload to the workspace's default storage
  2. BThe repository's remote URL couldn't be found
  3. CThe commit was pushed after the job finished
  4. 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).

Question 7 · choose 1

A data scientist generates an SSH key in a compute instance terminal to clone from GitHub. Who can use that key file?

  1. AEvery user of the workspace through the shared file system
  2. BOnly the compute instance's owner, on that instance
  3. CAnyone with Contributor on the workspace
  4. 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.

Practice domain 1 →Practice all domains →