NotebookRunConfig Class

Sets up configuration for notebooks runs.

Class NotebookRunConfig constructor.

Inheritance
NotebookRunConfig

Constructor

NotebookRunConfig(source_directory, notebook, output_notebook=None, parameters=None, handler=None, run_config=None, _telemetry_values=None)

Parameters

source_directory
str
Required

Source directory.

notebook
str
Required

Notebook file name.

output_notebook
str
default value: None

Output notebook file name.

parameters
dict
default value: None

A dictionary of notebook parameters.

handler
NotebookExecutionHandler
default value: None

The instance of the NotebookExecutionHandler.

run_config
RunConfiguration
default value: None
_telemetry_values
dict
default value: None

Internal use only.

source_directory
str
Required

Source directory.

notebook
str
Required

Notebook file name.

output_notebook
str
Required

Output notebook file name.

parameters
dict
Required

A dictionary of notebook parameters.

handler
<xref:.NotebookExecutionHandler>
Required

The instance of the NotebookExecutionHandler.

run_config
RunConfiguration
Required
_telemetry_values
dict
Required

Internal use only.

Remarks


   # Import dependencies
   from azureml.core import Workspace, Experiment, RunConfiguration
   from azureml.contrib.notebook import NotebookRunConfig

   # Create new experiment
   workspace = Workspace.from_config()
   exp = Experiment(workspace, "simple_notebook_experiment")

   # Customize run configuration to execute in user managed environment
   run_config_user_managed = RunConfiguration()
   run_config_user_managed.environment.python.user_managed_dependencies = True

   # Create notebook run configuration and set parameters values
   cfg = NotebookRunConfig(source_directory="./notebooks",
                           notebook="notebook-sample.ipynb",
                           parameters={"arg1": "Machine Learning"},
                           run_config=run_config_user_managed)

   # Submit experiment and wait for completion
   run = exp.submit(cfg)
   run.wait_for_completion(show_output=True)