AzureMLNotebookHandler Class

Represents a Papermill-based notebook execution handler.

Papermill is a tool for parameterizing and executing Jupyter notebooks.

Construct PapermillExecutionHandler object.

Inheritance
azureml.contrib.notebook._notebook_handler.NotebookExecutionHandler
AzureMLNotebookHandler

Constructor

AzureMLNotebookHandler(history=True, timeout=None, **kwargs)

Parameters

Name Description
history

Whether to enable metrics logs to run history. The default is True.

default value: True
timeout
int

The cell execution timeout in seconds.

default value: None
kwargs
Required

A dictionary of optional parameters. See supported_options.

Remarks


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

   # Create new experiment
   workspace = Workspace.from_config()
   exp = Experiment(workspace, "azureml_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

   # Instante AzureML notebook handler with cell execution timeout
   handler = AzureMLNotebookHandler(timeout=600, progress_bar=False)

   # Create notebook run configuration
   cfg = NotebookRunConfig(source_directory="./notebooks",
                           notebook="notebook-sample.ipynb",
                           handler=handler,
                           run_config=run_config_user_managed)

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

Attributes

supported_options

supported_options = ['progress_bar', 'log_output', 'kernel_name', 'cwd']