Workspace Class

Defines an Azure Machine Learning resource for managing training and deployment artifacts.

A Workspace is a fundamental resource for machine learning in Azure Machine Learning. You use a workspace to experiment, train, and deploy machine learning models. Each workspace is tied to an Azure subscription and resource group, and has an associated SKU.

For more information about workspaces, see:

Class Workspace constructor to load an existing Azure Machine Learning Workspace.

Inheritance
builtins.object
Workspace

Constructor

Workspace(subscription_id, resource_group, workspace_name, auth=None, _location=None, _disable_service_check=False, _workspace_id=None, sku='basic', tags=None, _cloud='AzureCloud')

Parameters

Name Description
subscription_id
Required
str

The Azure subscription ID containing the workspace.

resource_group
Required
str

The resource group containing the workspace.

workspace_name
Required
str

The existing workspace name.

auth

The authentication object. For more details, see https://aka.ms/aml-notebook-auth. If None, the default Azure CLI credentials will be used or the API will prompt for credentials.

default value: None
_location
str

Internal use only.

default value: None
_disable_service_check

Internal use only.

default value: False
_workspace_id
str

Internal use only.

default value: None
sku
str

The parameter is present for backwards compatibility and is ignored.

default value: basic
_cloud
str

Internal use only.

default value: AzureCloud
subscription_id
Required
str

The Azure subscription ID containing the workspace.

resource_group
Required
str

The resource group containing the workspace.

workspace_name
Required
str

The workspace name. The name must be between 2 and 32 characters long. The first character of the name must be alphanumeric (letter or number), but the rest of the name may contain alphanumerics, hyphens, and underscores. Whitespace is not allowed.

auth
Required

The authentication object. For more details, see https://aka.ms/aml-notebook-auth. If None, the default Azure CLI credentials will be used or the API will prompt for credentials.

_location
Required
str

Internal use only.

_disable_service_check
Required

Internal use only.

_workspace_id
Required
str

Internal use only.

sku
Required
str

The parameter is present for backwards compatibility and is ignored.

tags

Tags to associate with the workspace.

default value: None
_cloud
Required
str

Internal use only.

Remarks

The following sample shows how to create a workspace.


   from azureml.core import Workspace
   ws = Workspace.create(name='myworkspace',
               subscription_id='<azure-subscription-id>',
               resource_group='myresourcegroup',
               create_resource_group=True,
               location='eastus2'
               )

Set create_resource_group to False if you have an existing Azure resource group that you want to use for the workspace.

To use the same workspace in multiple environments, create a JSON configuration file. The configuration file saves your subscription, resource, and workspace name so that it can be easily loaded. To save the configuration use the write_config method.


   ws.write_config(path="./file-path", file_name="ws_config.json")

See Create a workspace configuration file for an example of the configuration file.

To load the workspace from the configuration file, use the from_config method.


   ws = Workspace.from_config()
   ws.get_details()

Alternatively, use the get method to load an existing workspace without using configuration files.


   ws = Workspace.get(name="myworkspace",
               subscription_id='<azure-subscription-id>',
               resource_group='myresourcegroup')

The samples above may prompt you for Azure authentication credentials using an interactive login dialog. For other use cases, including using the Azure CLI to authenticate and authentication in automated workflows, see Authentication in Azure Machine Learning.

Methods

add_private_endpoint

Add a private endpoint to the workspace.

create

Create a new Azure Machine Learning Workspace.

Throws an exception if the workspace already exists or any of the workspace requirements are not satisfied.

delete

Delete the Azure Machine Learning Workspace associated resources.

delete_connection

Delete a connection of the workspace.

delete_private_endpoint_connection

Delete the private endpoint connection to the workspace.

diagnose_workspace

Diagnose workspace setup issues.

from_config

Return a workspace object from an existing Azure Machine Learning Workspace.

Reads workspace configuration from a file. Throws an exception if the config file can't be found.

The method provides a simple way to reuse the same workspace across multiple Python notebooks or projects. Users can save the workspace Azure Resource Manager (ARM) properties using the write_config method, and use this method to load the same workspace in different Python notebooks or projects without retyping the workspace ARM properties.

get

Return a workspace object for an existing Azure Machine Learning Workspace.

Throws an exception if the workspace does not exist or the required fields do not uniquely identify a workspace.

get_connection

Get a connection of the workspace.

get_default_compute_target

Get the default compute target for the workspace.

get_default_datastore

Get the default datastore for the workspace.

get_default_keyvault

Get the default key vault object for the workspace.

get_details

Return the details of the workspace.

get_mlflow_tracking_uri

Get the MLflow tracking URI for the workspace.

MLflow (https://mlflow.org/) is an open-source platform for tracking machine learning experiments and managing models. You can use MLflow logging APIs with Azure Machine Learning so that metrics, models and artifacts are logged to your Azure Machine Learning workspace.

get_run

Return the run with the specified run_id in the workspace.

list

List all workspaces that the user has access to within the subscription.

The list of workspaces can be filtered based on the resource group.

list_connections

List connections under this workspace.

list_keys

List keys for the current workspace.

set_connection

Add or update a connection under the workspace.

set_default_datastore

Set the default datastore for the workspace.

setup

Create a new workspace or retrieve an existing workspace.

sync_keys

Triggers the workspace to immediately synchronize keys.

If keys for any resource in the workspace are changed, it can take around an hour for them to automatically be updated. This function enables keys to be updated upon request. An example scenario is needing immediate access to storage after regenerating storage keys.

update

Update friendly name, description, tags, image build compute and other settings associated with a workspace.

update_dependencies

Update existing the associated resources for workspace in the following cases.

a) When a user accidently deletes an existing associated resource and would like to update it with a new one without having to recreate the whole workspace. b) When a user has an existing associated resource and wants to replace the current one that is associated with the workspace. c) When an associated resource hasn't been created yet and they want to use an existing one that they already have (only applies to container registry).

write_config

Write the workspace Azure Resource Manager (ARM) properties to a config file.

Workspace ARM properties can be loaded later using the from_config method. The path defaults to '.azureml/' in the current working directory and file_name defaults to 'config.json'.

The method provides a simple way of reusing the same workspace across multiple Python notebooks or projects. Users can save the workspace ARM properties using this function, and use from_config to load the same workspace in different Python notebooks or projects without retyping the workspace ARM properties.

add_private_endpoint

Add a private endpoint to the workspace.

add_private_endpoint(private_endpoint_config, private_endpoint_auto_approval=True, location=None, show_output=True, tags=None)

Parameters

Name Description
private_endpoint_config
Required

The private endpoint configuration to create a private endpoint to workspace.

private_endpoint_auto_approval

A boolean flag that denotes if the private endpoint creation should be auto-approved or manually-approved from Azure Private Link Center. In case of manual approval, users can view the pending request in Private Link portal to approve/reject the request.

default value: True
location

Location of the private endpoint, default is the workspace location

default value: None
show_output

Flag for showing the progress of workspace creation

default value: True
tags

Tags to associate with the workspace.

default value: None

Returns

Type Description

The PrivateEndPoint object created.

create

Create a new Azure Machine Learning Workspace.

Throws an exception if the workspace already exists or any of the workspace requirements are not satisfied.

static create(name, auth=None, subscription_id=None, resource_group=None, location=None, create_resource_group=True, sku='basic', tags=None, friendly_name=None, storage_account=None, key_vault=None, app_insights=None, container_registry=None, adb_workspace=None, primary_user_assigned_identity=None, cmk_keyvault=None, resource_cmk_uri=None, hbi_workspace=False, default_cpu_compute_target=None, default_gpu_compute_target=None, private_endpoint_config=None, private_endpoint_auto_approval=True, exist_ok=False, show_output=True, user_assigned_identity_for_cmk_encryption=None, system_datastores_auth_mode='accessKey', v1_legacy_mode=None)

Parameters

Name Description
name
Required
str

The new workspace name. The name must be between 2 and 32 characters long. The first character of the name must be alphanumeric (letter or number), but the rest of the name may contain alphanumerics, hyphens, and underscores. Whitespace is not allowed.

auth

The authentication object. For more details, see https://aka.ms/aml-notebook-auth. If None, the default Azure CLI credentials will be used or the API will prompt for credentials.

default value: None
subscription_id
str

The subscription ID of the containing subscription for the new workspace. The parameter is required if the user has access to more than one subscription.

default value: None
resource_group
str

The Azure resource group that contains the workspace. The parameter defaults to a mutation of the workspace name.

default value: None
location
str

The location of the workspace. The parameter defaults to the resource group location. The location has to be a supported region for Azure Machine Learning.

default value: None
create_resource_group

Indicates whether to create the resource group if it doesn't exist.

default value: True
sku
str

The parameter is present for backwards compatibility and is ignored.

default value: basic
tags

Tags to associate with the workspace.

default value: None
friendly_name
str

An optional friendly name for the workspace that can be displayed in the UI.

default value: None
storage_account
str

An existing storage account in the Azure resource ID format. The storage will be used by the workspace to save run outputs, code, logs etc. If None, a new storage account will be created.

default value: None
key_vault
str

An existing key vault in the Azure resource ID format. See example code below for details of the Azure resource ID format. The key vault will be used by the workspace to store credentials added to the workspace by the users. If None, a new key vault will be created.

default value: None
app_insights
str

An existing Application Insights in the Azure resource ID format. See example code below for details of the Azure resource ID format. The Application Insights will be used by the workspace to log webservices events. If None, a new Application Insights will be created.

default value: None
container_registry
str

An existing container registry in the Azure resource ID format (see example code below for details of the Azure resource ID format). The container registry will be used by the workspace to pull and push both experimentation and webservices images. If None, a new container registry will be created only when needed and not along with workspace creation.

default value: None
adb_workspace
str

An existing Adb Workspace in the Azure resource ID format (see example code below for details of the Azure resource ID format). The Adb Workspace will be used to link with the workspace. If None, the workspace link won't happen.

default value: None
primary_user_assigned_identity
str

The resource id of the user assigned identity that used to represent the workspace

default value: None
cmk_keyvault
str

The key vault containing the customer managed key in the Azure resource ID format: /subscriptions/<azure-subscription-id>/resourcegroups/<azure-resource-group>/providers/microsoft.keyvault/vaults/<azure-keyvault-name> For example: '/subscriptions/d139f240-94e6-4175-87a7-954b9d27db16/resourcegroups/myresourcegroup/providers/microsoft.keyvault/vaults/mykeyvault' See the example code in the Remarks below for more details on the Azure resource ID format.

default value: None
resource_cmk_uri
str

The key URI of the customer managed key to encrypt the data at rest. The URI format is: https://<keyvault-dns-name>/keys/<key-name>/<key-version>. For example, 'https://mykeyvault.vault.azure.net/keys/mykey/bc5dce6d01df49w2na7ffb11a2ee008b'. Refer to https://docs.microsoft.com/azure-stack/user/azure-stack-key-vault-manage-portal for steps on how to create a key and get its URI.

default value: None
hbi_workspace

Specifies whether the workspace contains data of High Business Impact (HBI), i.e., contains sensitive business information. This flag can be set only during workspace creation. Its value cannot be changed after the workspace is created. The default value is False.

When set to True, further encryption steps are performed, and depending on the SDK component, results in redacted information in internally-collected telemetry. For more information, see Data encryption.

When this flag is set to True, one possible impact is increased difficulty troubleshooting issues. This could happen because some telemetry isn't sent to Microsoft and there is less visibility into success rates or problem types, and therefore may not be able to react as proactively when this flag is True. The recommendation is use the default of False for this flag unless strictly required to be True.

default value: False
default_cpu_compute_target

(DEPRECATED) A configuration that will be used to create a CPU compute. The parameter defaults to {min_nodes=0, max_nodes=2, vm_size="STANDARD_DS2_V2", vm_priority="dedicated"} If None, no compute will be created.

default value: None
default_gpu_compute_target

(DEPRECATED) A configuration that will be used to create a GPU compute. The parameter defaults to {min_nodes=0, max_nodes=2, vm_size="STANDARD_NC6", vm_priority="dedicated"} If None, no compute will be created.

default value: None
private_endpoint_config

The private endpoint configuration to create a private endpoint to Azure ML workspace.

default value: None
private_endpoint_auto_approval

A boolean flag that denotes if the private endpoint creation should be auto-approved or manually-approved from Azure Private Link Center. In case of manual approval, users can view the pending request in Private Link portal to approve/reject the request.

default value: True
exist_ok

Indicates whether this method succeeds if the workspace already exists. If False, this method fails if the workspace exists. If True, this method returns the existing workspace if it exists.

default value: False
show_output

Indicates whether this method will print out incremental progress.

default value: True
user_assigned_identity_for_cmk_encryption
str

The resource id of the user assigned identity that needs to be used to access the customer manage key

default value: None
system_datastores_auth_mode
str

Determines whether or not to use credentials for the system datastores of the workspace 'workspaceblobstore' and 'workspacefilestore'. The default value is 'accessKey', in which case, the workspace will create the system datastores with credentials. If set to 'identity', the workspace will create the system datastores with no credentials.

default value: accessKey
v1_legacy_mode

Prevent using v2 API service on public Azure Resource Manager

default value: None

Returns

Type Description

The workspace object.

Exceptions

Type Description

Raised for problems creating the workspace.

Remarks

This first example requires only minimal specification, and all dependent resources as well as the resource group will be created automatically.


   from azureml.core import Workspace
   ws = Workspace.create(name='myworkspace',
                         subscription_id='<azure-subscription-id>',
                         resource_group='myresourcegroup',
                         create_resource_group=True,
                         location='eastus2')

The following example shows how to reuse existing Azure resources utilizing the Azure resource ID format. The specific Azure resource IDs can be retrieved through the Azure Portal or SDK. This assumes that the resource group, storage account, key vault, App Insights and container registry already exist.


   import os
   from azureml.core import Workspace
   from azureml.core.authentication import ServicePrincipalAuthentication

   service_principal_password = os.environ.get("AZUREML_PASSWORD")

   service_principal_auth = ServicePrincipalAuthentication(
       tenant_id="<tenant-id>",
       username="<application-id>",
       password=service_principal_password)

   ws = Workspace.create(name='myworkspace',
                         auth=service_principal_auth,
                         subscription_id='<azure-subscription-id>',
                         resource_group='myresourcegroup',
                         create_resource_group=False,
                         location='eastus2',
                         friendly_name='My workspace',
                         storage_account='subscriptions/<azure-subscription-id>/resourcegroups/myresourcegroup/providers/microsoft.storage/storageaccounts/mystorageaccount',
                         key_vault='subscriptions/<azure-subscription-id>/resourcegroups/myresourcegroup/providers/microsoft.keyvault/vaults/mykeyvault',
                         app_insights='subscriptions/<azure-subscription-id>/resourcegroups/myresourcegroup/providers/microsoft.insights/components/myappinsights',
                         container_registry='subscriptions/<azure-subscription-id>/resourcegroups/myresourcegroup/providers/microsoft.containerregistry/registries/mycontainerregistry',
                         exist_ok=False)

delete

Delete the Azure Machine Learning Workspace associated resources.

delete(delete_dependent_resources=False, no_wait=False)

Parameters

Name Description
delete_dependent_resources

Whether to delete resources associated with the workspace, i.e., container registry, storage account, key vault, and application insights. The default is False. Set to True to delete these resources.

default value: False
no_wait

Whether to wait for the workspace deletion to complete.

default value: False

Returns

Type Description

None if successful; otherwise, throws an error.

delete_connection

Delete a connection of the workspace.

delete_connection(name)

Parameters

Name Description
name
Required
str

The unique name of connection under the workspace

delete_private_endpoint_connection

Delete the private endpoint connection to the workspace.

delete_private_endpoint_connection(private_endpoint_connection_name)

Parameters

Name Description
private_endpoint_connection_name
Required
str

The unique name of private endpoint connection under the workspace

diagnose_workspace

Diagnose workspace setup issues.

diagnose_workspace(diagnose_parameters)

Parameters

Name Description
diagnose_parameters
Required
<xref:_restclient.models.DiagnoseWorkspaceParameters>

The parameter of diagnosing workspace health

Returns

Type Description
<xref:msrestazure.azure_operation.AzureOperationPoller>[<xref:_restclient.models.DiagnoseResponseResult>]

An instance of AzureOperationPoller that returns DiagnoseResponseResult

from_config

Return a workspace object from an existing Azure Machine Learning Workspace.

Reads workspace configuration from a file. Throws an exception if the config file can't be found.

The method provides a simple way to reuse the same workspace across multiple Python notebooks or projects. Users can save the workspace Azure Resource Manager (ARM) properties using the write_config method, and use this method to load the same workspace in different Python notebooks or projects without retyping the workspace ARM properties.

static from_config(path=None, auth=None, _logger=None, _file_name=None)

Parameters

Name Description
path
str

The path to the config file or starting directory to search. The parameter defaults to starting the search in the current directory.

default value: None
auth

The authentication object. For more details, see https://aka.ms/aml-notebook-auth. If None, the default Azure CLI credentials will be used or the API will prompt for credentials.

default value: None
_logger

Allows overriding the default logger.

default value: None
_file_name
str

Allows overriding the config file name to search for when path is a directory path.

default value: None

Returns

Type Description

The workspace object for an existing Azure ML Workspace.

get

Return a workspace object for an existing Azure Machine Learning Workspace.

Throws an exception if the workspace does not exist or the required fields do not uniquely identify a workspace.

static get(name, auth=None, subscription_id=None, resource_group=None, location=None, cloud='AzureCloud', id=None)

Parameters

Name Description
name
Required
str

The name of the workspace to get.

auth

The authentication object. For more details refer to https://aka.ms/aml-notebook-auth. If None, the default Azure CLI credentials will be used or the API will prompt for credentials.

default value: None
subscription_id
str

The subscription ID to use. The parameter is required if the user has access to more than one subscription.

default value: None
resource_group
str

The resource group to use. If None, the method will search all resource groups in the subscription.

default value: None
location
str

The workspace location.

default value: None
cloud
str

The name of the target cloud. Can be one of "AzureCloud", "AzureChinaCloud", or "AzureUSGovernment". If no cloud is specified "AzureCloud" is used.

default value: AzureCloud
id
str

The id of the workspace.

default value: None

Returns

Type Description

The workspace object.

get_connection

Get a connection of the workspace.

get_connection(name)

Parameters

Name Description
name
Required
str

The unique name of connection under the workspace

get_default_compute_target

Get the default compute target for the workspace.

get_default_compute_target(type)

Parameters

Name Description
type
Required
str

The type of compute. Possible values are 'CPU' or 'GPU'.

Returns

Type Description

The default compute target for given compute type.

get_default_datastore

Get the default datastore for the workspace.

get_default_datastore()

Returns

Type Description

The default datastore.

get_default_keyvault

Get the default key vault object for the workspace.

get_default_keyvault()

Returns

Type Description

The KeyVault object associated with the workspace.

get_details

Return the details of the workspace.

get_details()

Returns

Type Description

Workspace details in dictionary format.

Remarks

The returned dictionary contains the following key-value pairs.

  • id: URI pointing to this workspace resource, containing subscription ID, resource group, and workspace name.

  • name: The name of this workspace.

  • location: The workspace region.

  • type: A URI of the format "{providerName}/workspaces".

  • tags: Not currently used.

  • workspaceid: The ID of this workspace.

  • description: Not currently used.

  • friendlyName: A friendly name for the workspace displayed in the UI.

  • creationTime: Time this workspace was created, in ISO8601 format.

  • containerRegistry: The workspace container registry used to pull and push both experimentation and webservices images.

  • keyVault: The workspace key vault used to store credentials added to the workspace by the users.

  • applicationInsights: The Application Insights will be used by the workspace to log webservices events.

  • identityPrincipalId:

  • identityTenantId

  • identityType

  • storageAccount: The storage will be used by the workspace to save run outputs, code, logs, etc.

  • sku: The workspace SKU (also referred as edition). The parameter is present for backwards compatibility and is ignored.

  • resourceCmkUri: The key URI of the customer managed key to encrypt the data at rest. Refer to https://docs.microsoft.com/en-us/azure-stack/user/azure-stack-key-vault-manage-portal?view=azs-1910 for steps on how to create a key and get its URI.

  • hbiWorkspace: Specifies if the customer data is of high business impact.

  • imageBuildCompute: The compute target for image build.

  • systemDatastoresAuthMode: Determines whether or not to use credentials for the system datastores of the workspace 'workspaceblobstore' and 'workspacefilestore'. The default value is 'accessKey', in which case, the workspace will create the system datastores with credentials. If set to 'identity', the workspace will create the system datastores with no credentials.

For more information on these key-value pairs, see create.

get_mlflow_tracking_uri

Get the MLflow tracking URI for the workspace.

MLflow (https://mlflow.org/) is an open-source platform for tracking machine learning experiments and managing models. You can use MLflow logging APIs with Azure Machine Learning so that metrics, models and artifacts are logged to your Azure Machine Learning workspace.

get_mlflow_tracking_uri(_with_auth=False)

Parameters

Name Description
_with_auth

(DEPRECATED) Add auth info to tracking URI.

default value: False

Returns

Type Description
str

The MLflow-compatible tracking URI.

Remarks

Use the following sample to configure MLflow tracking to send data to the Azure ML Workspace:


   import mlflow
   from azureml.core import Workspace
   workspace = Workspace.from_config()
   mlflow.set_tracking_uri(workspace.get_mlflow_tracking_uri())

get_run

Return the run with the specified run_id in the workspace.

get_run(run_id)

Parameters

Name Description
run_id
Required

The run ID.

Returns

Type Description
Run

The submitted run.

list

List all workspaces that the user has access to within the subscription.

The list of workspaces can be filtered based on the resource group.

static list(subscription_id, auth=None, resource_group=None)

Parameters

Name Description
subscription_id
Required
str

The subscription ID for which to list workspaces.

auth

The authentication object. For more details refer to https://aka.ms/aml-notebook-auth. If None, the default Azure CLI credentials will be used or the API will prompt for credentials.

default value: None
resource_group
str

A resource group to filter the returned workspaces. If None, the method will list all the workspaces within the specified subscription.

default value: None

Returns

Type Description

A dictionary where the key is workspace name and the value is a list of Workspace objects.

list_connections

List connections under this workspace.

list_connections(category=None, target=None)

Parameters

Name Description
type
Required
str

The type of this connection that will be filtered on

target
str

the target of this connection that will be filtered on

default value: None
category
default value: None

list_keys

List keys for the current workspace.

list_keys()

Returns

Type Description

set_connection

Add or update a connection under the workspace.

set_connection(name, category, target, authType, value)

Parameters

Name Description
name
Required
str

The unique name of connection under the workspace

category
Required
str

The category of this connection

target
Required
str

the target this connection connects to

authType
Required
str

the authorization type of this connection

value
Required
str

the json format serialization string of the connection details

set_default_datastore

Set the default datastore for the workspace.

set_default_datastore(name)

Parameters

Name Description
name
Required
str

The name of the Datastore to set as default.

setup

Create a new workspace or retrieve an existing workspace.

static setup()

Returns

Type Description

A Workspace object.

sync_keys

Triggers the workspace to immediately synchronize keys.

If keys for any resource in the workspace are changed, it can take around an hour for them to automatically be updated. This function enables keys to be updated upon request. An example scenario is needing immediate access to storage after regenerating storage keys.

sync_keys(no_wait=False)

Parameters

Name Description
no_wait

Whether to wait for the workspace sync keys to complete.

default value: False

Returns

Type Description

None if successful; otherwise, throws an error.

update

Update friendly name, description, tags, image build compute and other settings associated with a workspace.

update(friendly_name=None, description=None, tags=None, image_build_compute=None, service_managed_resources_settings=None, primary_user_assigned_identity=None, allow_public_access_when_behind_vnet=None, v1_legacy_mode=None)

Parameters

Name Description
friendly_name
str

A friendly name for the workspace that can be displayed in the UI.

default value: None
description
str

A description of the workspace.

default value: None
tags

Tags to associate with the workspace.

default value: None
image_build_compute
str

The compute name for the image build.

default value: None
service_managed_resources_settings
<xref:azureml._base_sdk_common.workspace.models.ServiceManagedResourcesSettings>

The service managed resources settings.

default value: None
primary_user_assigned_identity
str

The user assigned identity resource id that represents the workspace identity.

default value: None
allow_public_access_when_behind_vnet

Allow public access to private link workspace.

default value: None
v1_legacy_mode

Prevent using v2 API service on public Azure Resource Manager

default value: None

Returns

Type Description

A dictionary of updated information.

update_dependencies

Update existing the associated resources for workspace in the following cases.

a) When a user accidently deletes an existing associated resource and would like to update it with a new one without having to recreate the whole workspace. b) When a user has an existing associated resource and wants to replace the current one that is associated with the workspace. c) When an associated resource hasn't been created yet and they want to use an existing one that they already have (only applies to container registry).

update_dependencies(container_registry=None, force=False)

Parameters

Name Description
container_registry
str

ARM Id for the container registry.

default value: None
force

If force updating dependent resources without prompted confirmation.

default value: False

Returns

Type Description

write_config

Write the workspace Azure Resource Manager (ARM) properties to a config file.

Workspace ARM properties can be loaded later using the from_config method. The path defaults to '.azureml/' in the current working directory and file_name defaults to 'config.json'.

The method provides a simple way of reusing the same workspace across multiple Python notebooks or projects. Users can save the workspace ARM properties using this function, and use from_config to load the same workspace in different Python notebooks or projects without retyping the workspace ARM properties.

write_config(path=None, file_name=None)

Parameters

Name Description
path
str

User provided location to write the config.json file. The parameter defaults to '.azureml/' in the current working directory.

default value: None
file_name
str

Name to use for the config file. The parameter defaults to config.json.

default value: None

Attributes

compute_targets

List all compute targets in the workspace.

Returns

Type Description

A dictionary with key as compute target name and value as ComputeTarget object.

datasets

List all datasets in the workspace.

Returns

Type Description

A dictionary with key as dataset name and value as Dataset object.

datastores

List all datastores in the workspace. This operation does not return credentials of the datastores.

Returns

Type Description

A dictionary with key as datastore name and value as Datastore object.

discovery_url

Return the discovery URL of this workspace.

Returns

Type Description
str

The discovery URL of this workspace.

environments

List all environments in the workspace.

Returns

Type Description

A dictionary with key as environment name and value as Environment object.

experiments

List all experiments in the workspace.

Returns

Type Description

A dictionary with key as experiment name and value as Experiment object.

images

Return the list of images in the workspace.

Raises a WebserviceException if there was a problem interacting with model management service.

Returns

Type Description

A dictionary with key as image name and value as Image object.

Exceptions

Type Description

There was a problem interacting with the model management service.

linked_services

List all linked services in the workspace.

Returns

Type Description

A dictionary where key is a linked service name and value is a LinkedService object.

location

Return the location of this workspace.

Returns

Type Description
str

The location of this workspace.

models

Return a list of model in the workspace.

Raises a WebserviceException if there was a problem interacting with model management service.

Returns

Type Description

A dictionary of model with key as model name and value as Model object.

Exceptions

Type Description

There was a problem interacting with the model management service.

name

Return the workspace name.

Returns

Type Description
str

The workspace name.

private_endpoints

List all private endpoint of the workspace.

Returns

Type Description

A dict of PrivateEndPoint objects associated with the workspace. The key is private endpoint name.

resource_group

Return the resource group name for this workspace.

Returns

Type Description
str

The resource group name.

service_context

Return the service context for this workspace.

Returns

Type Description
<xref:azureml._restclient.service_context.ServiceContext>

Returns the ServiceContext object.

sku

Return the SKU of this workspace.

Returns

Type Description
str

The SKU of this workspace.

subscription_id

Return the subscription ID for this workspace.

Returns

Type Description
str

The subscription ID.

tags

Return the Tags of this workspace.

Returns

Type Description

The Tags of this workspace.

webservices

Return a list of webservices in the workspace.

Raises a WebserviceException if there was a problem returning the list.

Returns

Type Description

A list of webservices in the workspace.

Exceptions

Type Description

There was a problem returning the list.

DEFAULT_CPU_CLUSTER_CONFIGURATION

DEFAULT_CPU_CLUSTER_CONFIGURATION = <azureml.core.compute.amlcompute.AmlComputeProvisioningConfiguration object>

DEFAULT_CPU_CLUSTER_NAME

DEFAULT_CPU_CLUSTER_NAME = 'cpu-cluster'

DEFAULT_GPU_CLUSTER_CONFIGURATION

DEFAULT_GPU_CLUSTER_CONFIGURATION = <azureml.core.compute.amlcompute.AmlComputeProvisioningConfiguration object>

DEFAULT_GPU_CLUSTER_NAME

DEFAULT_GPU_CLUSTER_NAME = 'gpu-cluster'