get_workspace
- health_azure.get_workspace(aml_workspace=None, workspace_config_path=None)[source]
Retrieve an Azure ML Workspace by going through the following steps:
If the function has been called from inside a run in AzureML, it returns the current AzureML workspace.
If a Workspace object has been provided in the aml_workspace argument, return that.
If a path to a Workspace config file has been provided, load the workspace according to that config file.
If a Workspace config file is present in the current working directory or one of its parents, load the
workspace according to that config file.
If 3 environment variables are found, use them to identify the workspace (HIML_RESOURCE_GROUP,
HIML_SUBSCRIPTION_ID, HIML_WORKSPACE_NAME)
If none of the above succeeds, an exception is raised.
- Parameters
aml_workspace (
Optional
[Workspace
]) – If provided this is returned as the AzureML Workspace.workspace_config_path (
Optional
[Path
]) – If not provided with an AzureML Workspace, then load one given the information in this config
- Return type
Workspace
- Returns
An AzureML workspace.
- Raises
ValueError – If none of the available options for accessing the workspace succeeds.
FileNotFoundError – If the workspace config file is given in workspace_config_path, but is not present.