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

subscription_id
str
Required

The Azure subscription ID containing the workspace.

resource_group
str
Required

The resource group containing the workspace.

workspace_name
str
Required

The existing workspace name.

auth
ServicePrincipalAuthentication or InteractiveLoginAuthentication or MsiAuthentication
default value: None

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
str
default value: None

Internal use only.

_disable_service_check
bool
default value: False

Internal use only.

_workspace_id
str
default value: None

Internal use only.

sku
str
default value: basic

The parameter is present for backwards compatibility and is ignored.

_cloud
str
default value: AzureCloud

Internal use only.

subscription_id
str
Required

The Azure subscription ID containing the workspace.

resource_group
str
Required

The resource group containing the workspace.

workspace_name
str
Required

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
ServicePrincipalAuthentication or InteractiveLoginAuthentication or MsiAuthentication
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
str
Required

Internal use only.

_disable_service_check
bool
Required

Internal use only.

_workspace_id
str
Required

Internal use only.

sku
str
Required

The parameter is present for backwards compatibility and is ignored.

tags
dict
default value: None

Tags to associate with the workspace.

_cloud
str
Required

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

private_endpoint_config
PrivateEndPointConfig
Required

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

private_endpoint_auto_approval
bool
default value: True

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.

location
string
default value: None

Location of the private endpoint, default is the workspace location

show_output
bool
default value: True

Flag for showing the progress of workspace creation

tags
dict
default value: None

Tags to associate with the workspace.

Returns

The PrivateEndPoint object created.

Return type

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
str
Required

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
ServicePrincipalAuthentication or InteractiveLoginAuthentication
default value: None

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.

subscription_id
str
default value: None

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.

resource_group
str
default value: None

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

location
str
default value: None

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.

create_resource_group
bool
default value: True

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

sku
str
default value: basic

The parameter is present for backwards compatibility and is ignored.

tags
dict
default value: None

Tags to associate with the workspace.

friendly_name
str
default value: None

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

storage_account
str
default value: None

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.

key_vault
str
default value: None

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.

app_insights
str
default value: None

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.

container_registry
str
default value: None

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.

adb_workspace
str
default value: None

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.

primary_user_assigned_identity
str
default value: None

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

cmk_keyvault
str
default value: None

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.

resource_cmk_uri
str
default value: None

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.

hbi_workspace
bool
default value: False

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_cpu_compute_target
AmlComputeProvisioningConfiguration
default value: None

(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_gpu_compute_target
AmlComputeProvisioningConfiguration
default value: None

(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.

private_endpoint_config
PrivateEndPointConfig
default value: None

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

private_endpoint_auto_approval
bool
default value: True

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.

exist_ok
bool
default value: False

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.

show_output
bool
default value: True

Indicates whether this method will print out incremental progress.

user_assigned_identity_for_cmk_encryption
str
default value: None

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

system_datastores_auth_mode
str
default value: accessKey

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.

v1_legacy_mode
bool
default value: None

Prevent using v2 API service on public Azure Resource Manager

Returns

The workspace object.

Return type

Exceptions

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

delete_dependent_resources
bool
default value: False

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.

no_wait
bool
default value: False

Whether to wait for the workspace deletion to complete.

Returns

None if successful; otherwise, throws an error.

Return type

delete_connection

Delete a connection of the workspace.

delete_connection(name)

Parameters

name
str
Required

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

private_endpoint_connection_name
str
Required

The unique name of private endpoint connection under the workspace

diagnose_workspace

Diagnose workspace setup issues.

diagnose_workspace(diagnose_parameters)

Parameters

diagnose_parameters
<xref:_restclient.models.DiagnoseWorkspaceParameters>
Required

The parameter of diagnosing workspace health

Returns

An instance of AzureOperationPoller that returns DiagnoseResponseResult

Return type

<xref:msrestazure.azure_operation.AzureOperationPoller>[<xref:_restclient.models.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

path
str
default value: None

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

auth
ServicePrincipalAuthentication or InteractiveLoginAuthentication
default value: None

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.

_logger
Logger
default value: None

Allows overriding the default logger.

_file_name
str
default value: None

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

Returns

The workspace object for an existing Azure ML Workspace.

Return type

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
str
Required

The name of the workspace to get.

auth
ServicePrincipalAuthentication or InteractiveLoginAuthentication
default value: None

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.

subscription_id
str
default value: None

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

resource_group
str
default value: None

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

location
str
default value: None

The workspace location.

cloud
str
default value: AzureCloud

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

id
str
default value: None

The id of the workspace.

Returns

The workspace object.

Return type

get_connection

Get a connection of the workspace.

get_connection(name)

Parameters

name
str
Required

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

type
str
Required

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

Returns

The default compute target for given compute type.

Return type

get_default_datastore

Get the default datastore for the workspace.

get_default_datastore()

Returns

The default datastore.

Return type

get_default_keyvault

Get the default key vault object for the workspace.

get_default_keyvault()

Returns

The KeyVault object associated with the workspace.

Return type

get_details

Return the details of the workspace.

get_details()

Returns

Workspace details in dictionary format.

Return type

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

_with_auth
bool
default value: False

(DEPRECATED) Add auth info to tracking URI.

Returns

The MLflow-compatible tracking URI.

Return type

str

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

run_id
string
Required

The run ID.

Returns

The submitted run.

Return type

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

subscription_id
str
Required

The subscription ID for which to list workspaces.

auth
ServicePrincipalAuthentication or InteractiveLoginAuthentication
default value: None

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.

resource_group
str
default value: None

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

Returns

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

Return type

list_connections

List connections under this workspace.

list_connections(category=None, target=None)

Parameters

type
str
Required

The type of this connection that will be filtered on

target
str
default value: None

the target of this connection that will be filtered on

category
default value: None

list_keys

List keys for the current workspace.

list_keys()

Return type

set_connection

Add or update a connection under the workspace.

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

Parameters

name
str
Required

The unique name of connection under the workspace

category
str
Required

The category of this connection

target
str
Required

the target this connection connects to

authType
str
Required

the authorization type of this connection

value
str
Required

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
str
Required

The name of the Datastore to set as default.

setup

Create a new workspace or retrieve an existing workspace.

static setup()

Returns

A Workspace object.

Return type

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

no_wait
bool
default value: False

Whether to wait for the workspace sync keys to complete.

Returns

None if successful; otherwise, throws an error.

Return type

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

friendly_name
str
default value: None

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

description
str
default value: None

A description of the workspace.

tags
dict
default value: None

Tags to associate with the workspace.

image_build_compute
str
default value: None

The compute name for the image build.

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

The service managed resources settings.

primary_user_assigned_identity
str
default value: None

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

allow_public_access_when_behind_vnet
bool
default value: None

Allow public access to private link workspace.

v1_legacy_mode
bool
default value: None

Prevent using v2 API service on public Azure Resource Manager

Returns

A dictionary of updated information.

Return type

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

container_registry
str
default value: None

ARM Id for the container registry.

force
bool
default value: False

If force updating dependent resources without prompted confirmation.

Return type

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

path
str
default value: None

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

file_name
str
default value: None

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

Attributes

compute_targets

List all compute targets in the workspace.

Returns

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

Return type

datasets

List all datasets in the workspace.

Returns

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

Return type

datastores

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

Returns

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

Return type

discovery_url

Return the discovery URL of this workspace.

Returns

The discovery URL of this workspace.

Return type

str

environments

List all environments in the workspace.

Returns

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

Return type

experiments

List all experiments in the workspace.

Returns

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

Return type

images

Return the list of images in the workspace.

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

Returns

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

Return type

Exceptions

There was a problem interacting with the model management service.

linked_services

List all linked services in the workspace.

Returns

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

Return type

location

Return the location of this workspace.

Returns

The location of this workspace.

Return type

str

models

Return a list of model in the workspace.

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

Returns

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

Return type

Exceptions

There was a problem interacting with the model management service.

name

Return the workspace name.

Returns

The workspace name.

Return type

str

private_endpoints

List all private endpoint of the workspace.

Returns

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

Return type

resource_group

Return the resource group name for this workspace.

Returns

The resource group name.

Return type

str

service_context

Return the service context for this workspace.

Returns

Returns the ServiceContext object.

Return type

<xref:azureml._restclient.service_context.ServiceContext>

sku

Return the SKU of this workspace.

Returns

The SKU of this workspace.

Return type

str

subscription_id

Return the subscription ID for this workspace.

Returns

The subscription ID.

Return type

str

tags

Return the Tags of this workspace.

Returns

The Tags of this workspace.

Return type

webservices

Return a list of webservices in the workspace.

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

Returns

A list of webservices in the workspace.

Return type

Exceptions

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'