Python development environment for Azure Machine Learning

Rating & reviews (0 reviews)
Set up a Python development environment for Azure Machine Learning

Local and Data Science Virtual Machine (DSVM)
# Create Resource group and Workspace
from azureml.core import Workspace
ws = Workspace.create(name='vscodeml-ws',

# Write config.json file file (confg file for the environent)
# A folder .azureml will be created and the config.json file will be created into it
ws.write_config(path="./", file_name="config.json")

You can do it manually
Create folder

Create file
"subscription_id": "SUBSCRIPTION_ID",
"resource_group": "vscode-ml-rg",
"workspace_name": "vscode-ml-ws"

Or from Azure ML Studio
Download config file.
# Finally load the workspace (interactive login)
ws = Workspace.from_config()
# print details
# or just print short message
print('Ready to use Azure ML {} to work with {}'.format(azureml.core.VERSION,

You can load a specific config.json file

ws = Workspace.from_config(path="my/path/config.json")

You can load a workspace from current run context.
Applicable if you are on a compute cluster.
# did not used it in production yet

Set up Python development environment - Azure Machine Learning | Microsoft Learn class - Azure Machine Learning Python | Microsoft Learn