Build environment for your experiment when your Azure ML workspace is behind a Vnet
We see a common request from our customers to create a ML pipeline using an Azure ML workspace behind a VNet.
Creating and building environment in a workspace behind a VNet has some specifics and causes questions. The reason is that you cannot build the Docker Image directly on ACR, when the ACR is behind a virtual network
In this article you will find the steps that will help you to build your custom environment when you Azure ML workspace is behind a VNet.
# python installs
COPY requirements.txt .
RUN pip install -r requirements.txt
# set command
Configure an AzureML compute cluster to build environments
Create an Azure Machine Learning compute cluster (Only a CPU SKU is supported). This cluster will be used to build the docker images when ACR is behind a VNet. For more information, see Create a compute cluster.
Use the az ml workspace update command to set a build compute:
az ml workspace update --name myworkspace --resource-group myresourcegroup --image-build-compute mycomputecluster