Azure Machine Learning Service — What is the Target Environment? | by Pankaj Jainani | Dec, 2020


The code runs in the digital surroundings that defines the runtime and the programs which might be put in in the surroundings the usage of Conda or pip.

Environments are generally created in docker packing containers which are moveable and can also be hosted in goal compute, i.e., dev pc, digital machines, container services and products in the quite a lot of public cloud.

Creating the Environment

The code under defines such an atmosphere by instantiating from the CondadepenDependencies object after which passing conda_packagesand pip_packages required by experiment to run.

Additional Info: There are many alternative ways to create and arrange bundle in AzureML see this link

from azureml.core import Environment
from azureml.core.conda_dependencies import CondaDependencies
iris_env = Environment("iris_trn_environment")
iris_env.python.user_managed_dependencies = False
#iris_env.docker.enabled = True ## If docker ned to be enabled
iris_env.docker.enabled = False
iris_deps = CondaDependencies.create(conda_packages=["scikit-learn","pandas","numpy"], pip_packages=["azureml-defaults",'azureml-dataprep[pandas]'])iris_env.python.conda_dependencies = iris_deps

Register the Environment

iris_env.sign in(workspace=ws)
# in moderation understand the json returned
Environment registered reaction as JSON. Image from my Kaggle Notebook, refer [1]

To fetch the registered surroundings —

Following is the listing of all registered environments together with the ‘Default’ environments already to be had with AMS provider workspace.

## Get the listing of already registered and customized environments by the usage of -for env_name in Environment.listing(workspace=ws):
print("Environment Name",env_name)
List of registered environments in the workspace. Image from my Kaggle Notebook, refer [1]


Please enter your comment!
Please enter your name here