get_workspace

health_azure.get_workspace(aml_workspace, workspace_config_path)[source]
Retrieve an Azure ML Workspace from one of several places:
  1. If the function has been called during an AML run (i.e. on an Azure agent), returns the associated workspace

  2. If a Workspace object has been provided by the user, return that

  3. If a path to a Workspace config file has been provided, load the workspace according to that.

If not running inside AML and neither a workspace nor the config file are provided, the code will try to locate a config.json file in any of the parent folders of the current working directory. If that succeeds, that config.json file will be used to instantiate the workspace.

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.