Enable notebooks for Azure Cosmos DB accounts (preview)

APPLIES TO: SQL API

Important

Currently the notebook feature is temporarily disabled. Azure Cosmos DB team is working on a fix.

Built-in notebooks for Azure Cosmos DB are currently available in 29 regions. To use notebooks, create a new Cosmos account or enable notebooks on an existing account in one of these regions.

Built-in Jupyter notebooks in Azure Cosmos DB enable you to analyze and visualize your data from the Azure portal. This article describes how to enable this feature for your Azure Cosmos DB account.

Create a new Cosmos account

Starting February 10, 2021, new Azure Cosmos accounts created in one of the supported region will automatically have notebooks enabled. There is no additional configuration needed to enable notebooks. Use the following instructions to create a new account:

  1. Sign into the Azure portal.

  2. Select Create a resource > Databases > Azure Cosmos DB.

  3. Enter the basic settings for the account.

    The new account page for Azure Cosmos DB

  4. Select Review + create. You can skip the Network and Tags option.

  5. Review the account settings, and then select Create. It takes a few minutes to create the account. Wait for the portal page to display Your deployment is complete.

    The Azure portal Notifications pane

  6. Select Go to resource to go to the Azure Cosmos DB account page.

    The Azure Cosmos DB account page

  7. Navigate to the Data Explorer pane. You should now see your notebooks workspace.

    New Azure Cosmos DB notebooks workspace

Enable notebooks in an existing Cosmos account

You can also enable notebooks on existing accounts. This step needs to be done only once per account.

  1. Navigate to the Data Explorer pane in your Cosmos account.

  2. Select Enable Notebooks.

    Create a new notebooks workspace in Data Explorer

  3. This will prompt you to create a new notebooks workspace. Select Complete setup.

  4. Your account is now enabled to use notebooks!

Create and run your first notebook

To verify that you can use notebooks, select one of notebooks under Sample Notebooks. This will save a copy of the notebook to your workspace and open it.

In this example, we'll use GettingStarted.ipynb.

View GettingStarted.ipynb notebook

To run the notebook:

  1. Select the first code cell that contains Python code.

  2. Select Run to run the cell. You can also use Shift + Enter to run the cell.

  3. Refresh the resource pane to see the database and container that has been created.

    Run getting started notebook

You can also select New Notebook to create a new notebook or upload an existing notebook (.ipynb) file by selecting Upload File from the My Notebooks menu.

Create or upload a new notebook

Supported regions

Built-in notebooks for Azure Cosmos DB are currently available in 29 Azure regions. New Azure Cosmos accounts created in these regions will have notebooks automatically enabled. Notebooks are free with your account.

  • Australia Central
  • Australia Central 2
  • Australia East
  • Australia Southeast
  • Brazil South
  • Canada Central
  • Canada East
  • Central India
  • Central US
  • East US
  • East US 2
  • France Central
  • France South
  • Germany North
  • Germany West Central
  • Japan West
  • Korea South
  • North Central US
  • North Europe
  • South Central US
  • Southeast Asia
  • Switzerland North
  • UAE Central
  • UK South
  • UK West
  • West Central US
  • West Europe
  • West India
  • West US 2

Next steps