Home
%3CLINGO-SUB%20id%3D%22lingo-sub-1350982%22%20slang%3D%22en-US%22%3EDo%20You%20Know%20Azure%20Cosmos%20Db%20Built-In%20Notebooks%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1350982%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fwww.gotcosmos.com%2Fabout%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3EAzure%20Cosmos%20DB%3C%2FA%3E%20is%20Microsoft's%20globally%20distributed%20multi-model%20database%20service.%20It%20was%20built%20from%20the%20ground%20up%20with%20global%20distribution%20and%20horizontal%20scaling%20across%20all%20Azure%20regions.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fjupyter.org%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3EJupyter%20Notebooks%3C%2FA%3E%20are%20open-source%20web%20applications%20that%20allow%20you%20to%20create%20and%20share%20documents%20that%20contain%20live%20code%2C%20equations%2C%20visualizations%2C%20and%20narrative%20text.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIn%20this%20blog%20post%20you%20will%20know%20more%20about%20%3CA%20href%3D%22https%3A%2F%2Fazure.microsoft.com%2Fen-us%2Fblog%2Fanalyze-and-visualize-your-data-with-azure-cosmos-db-notebooks%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EAzure%20Cosmos%20DB%20built-in%20Jupyter%20Notebooks%3C%2FA%3E%2C%20that%20support%20all%20APIs%20and%20run%20within%20the%20Azure%20Cosmos%20DB%20accounts.%3C%2FP%3E%0A%3CH1%20id%3D%22toc-hId-442390674%22%20id%3D%22toc-hId-442390674%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22sample.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F188045iB5FCADAA55C83FDA%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22sample.png%22%20alt%3D%22sample.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FH1%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EHere%20are%20some%20important%20features%20that%20will%20improve%20your%20productivity%20while%20using%20the%20notebooks%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FAzure%2Fazure-sdk-for-python%2Ftree%2Fmaster%2Fsdk%2Fcosmos%2Fazure-cosmos%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EAzure%20Cosmos%20DB%20Python%20SDK%20V4%3C%2FA%3E%3A%20It%20is%20pre-installed%20and%20included%20in%20all%20notebooks.%20Your%20%3CSTRONG%3E%3CEM%3Ecosmos_client%3C%2FEM%3E%3C%2FSTRONG%3E%20object%20will%20be%20pre-loaded%20with%20environment%20information%20about%20your%20Azure%20Cosmos%20account%2C%20saving%20you%20the%20work%20to%20inform%20database%2C%20key%2C%20and%20endpoint.%20But%20you%20can%20also%20create%20a%20custom%20version%20of%20the%20client%2C%20with%20information%20from%20another%20Azure%20Cosmos%20account.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EPre-Installed%20packages%3A%20%3CA%20href%3D%22https%3A%2F%2Fpandas.pydata.org%2Fpandas-docs%2Fstable%2Freference%2Fapi%2Fpandas.DataFrame.update.html%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3EPandas%3C%2FA%3E%2C%20%3CA%20href%3D%22https%3A%2F%2Fmatplotlib.org%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3EMatplotlib%3C%2FA%3E%2C%20among%20others.%20It%20means%20that%20you%20don%E2%80%99t%20need%20any%20installation%20to%20write%2C%20read%2C%20and%20analyze%20Cosmos%20DB%20data.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EPackages%20Installation%3A%20You%20can%20install%20packages%20using%20pip%20install%2C%20making%20it%20available%20for%20all%20notebooks%20in%20the%20Azure%20Cosmos%20DB%20account.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EMagic%20Commands%3A%20You%20can%20use%20the%26nbsp%3B%3CSTRONG%3E%3CEM%3E%25%25sql%3C%2FEM%3E%3C%2FSTRONG%3E%26nbsp%3Bmagic%20command%20to%20run%20a%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fcosmos-db%2Fsql-query-getting-started%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3ESQL%20query%3C%2FA%3E%26nbsp%3Bagainst%20any%20container%20in%20your%20account%20and%20load%20the%20results%20into%20a%20%3CA%20href%3D%22https%3A%2F%2Fpandas.pydata.org%2Fpandas-docs%2Fstable%2Freference%2Fapi%2Fpandas.DataFrame.update.html%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3EPandas%20DataFrame%3C%2FA%3E.%26nbsp%3BOr%20you%20can%20use%20%3CSTRONG%3E%3CEM%3E%25%25upload%3C%2FEM%3E%3C%2FSTRONG%3E%20to%20upload%20data%20from%20a%20JSON%20file%20to%20a%20specified%20Azure%20Cosmos%20container.%26nbsp%3BYou%20can%20also%20use%20%3CSTRONG%3E%3CEM%3E%25database%3C%2FEM%3E%3C%2FSTRONG%3E%20and%20%3CSTRONG%3E%3CEM%3E%25container%3C%2FEM%3E%3C%2FSTRONG%3E%20to%20set%20default%20parameters%20for%20your%20queries.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EMemory%20management%3A%20You%20have%20up%20to%203.9%20GB%20or%20memory%2C%20and%20you%20can%20release%20some%20of%20it%20cleaning%20outputs%20or%20resetting%20the%20workspace.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3ESpark%20Integration%3A%20You%20can%20select%20any%20of%20the%20existing%20Azure%20Synapse%20Spark%20Pools%20in%20your%20subscription.%20And%20for%20them%20you%20have%203%20Kernel%20Twinkles%20available%3A%20Python%2C%20DotNet%2C%20and%20Scala.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3ETerminal%2C%20that%20gives%20you%20console%20access%20to%20the%20Linux%20compute%20node%20that%20runs%20your%20Jupyter%20Notebooks.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EDirect%20Access%3A%20Your%20Azure%20Cosmos%20DB%20Data%20Explorer%2C%20including%20the%20Notebooks%2C%20are%20also%20available%20at%20Cosmos%20DB%20User%20Interface%3A%20%3CA%20href%3D%22https%3A%2F%2Fcosmos.azure.com%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fcosmos.azure.com%2F%3C%2FA%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EBuilt-in%20nteract%20data%20explorer%3A%20You%20can%20use%20the%20built-in%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fblog.nteract.io%2Fdesigning-the-nteract-data-explorer-f4476d53f897%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Enteract%20data%20explorer%3C%2FA%3E%26nbsp%3Bto%20filter%20and%20visualize%20a%20Pandas%20DataFrame.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CDIV%20id%3D%22tinyMceEditorRodrigo%20Souza_2%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CDIV%20id%3D%22tinyMceEditorRodrigo%20Souza_3%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22nteract.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F188039i1D7664271D496868%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22nteract.png%22%20alt%3D%22nteract.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20Azure%20Cosmos%20Portal%20comes%20with%20an%20array%20of%20samples%20for%20you%20to%20use%20and%20get%20started%20from.%20These%20notebooks%20can%20be%20used%20for%20demos%2C%20trainings%2C%20and%20source%20for%20tests%20and%20projects.%20When%20you%20open%20one%20of%20them%2C%20it%20is%20automatically%20copied%20to%20your%20%3CSTRONG%3E%3CEM%3EMy%20Notebooks%3C%2FEM%3E%3C%2FSTRONG%3E%20folder%2C%20where%20you%20can%20not%20only%20use%20it%2C%20but%20also%20customize%20it%2C%20as%20necessary.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ECollaboration%20is%20appreciated.%20If%20you%E2%80%99d%20like%20to%20contribute%20a%20Notebook%20and%20potentially%20have%20it%20appear%20as%20one%20of%20our%20Sample%20Notebooks%2C%20you%20can%20submit%20a%20PR%20on%20our%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FAzure-Samples%2Fcosmos-notebooks%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EGitHub%20page%3C%2FA%3E.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWith%20Sample%20Notebooks%20you%20can%20learn%20by%20doing%2C%20and%20today%20we%20have%20options%20for%20visualization%2C%20Request%20Units%2C%20Indexing%2C%20Global%20Distribution%2C%20Stored%20Procedures%2C%20and%20IoT%20-%20AI%20integration.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ECosmic%20notebooks%20are%20available%20for%20all%20data%20models%20and%20APIs%20including%20Cassandra%2C%20MongoDB%2C%20SQL%20(Core)%2C%20Gremlin%2C%20and%20Spark%20to%20enhance%20the%20developer%20experience%20in%20Azure%20Cosmos%20DB.%20Developers%2C%20data%20scientists%2C%20engineers%20and%20analysts%20can%20use%20the%20familiar%20Jupyter%20Notebooks%20experience%20to%20run%20interactive%20queries%2C%20explore%20and%20analyze%20data%2C%20and%20work%20with%20machine%20learning%20models.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-1350982%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSPAN%3ECosmic%20notebooks%20are%20available%20for%20all%26nbsp%3B%3C%2FSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure%2Fcosmos-db%2Fintroduction%23develop-applications-on-cosmos-db-using-popular-open-source-software-oss-apis%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%20data-event%3D%22page-clicked-link%22%20data-bi-id%3D%22page-clicked-link%22%20data-bi-area%3D%22undefined%22%20data-bi-view%3D%22undefined%22%3Edata%20models%20and%20APIs%3C%2FA%3E%3CSPAN%3E%26nbsp%3Bincluding%20Cassandra%2C%20MongoDB%2C%20SQL%20(Core)%2C%20Gremlin%2C%20and%20Spark%20to%20enhance%20the%20developer%20experience%20in%20Azure%20Cosmos%20DB.%20These%26nbsp%3B%3C%2FSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fazure.microsoft.com%2Fblog%2Fplanet-scale-operational-analytics-and-ai-with-azure-cosmos-db%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%20data-event%3D%22page-clicked-link%22%20data-bi-id%3D%22page-clicked-link%22%20data-bi-area%3D%22undefined%22%20data-bi-view%3D%22undefined%22%3Ebuilt-in%20Jupyter%20notebooks%3C%2FA%3E%3CSPAN%3E%26nbsp%3Brun%20inside%20Azure%20Cosmos%20DB%20service%20and%20offer%20an%20integrated%20experience%20for%20data%20professionals.%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-TEASER%3E
Microsoft

Azure Cosmos DB is Microsoft's globally distributed multi-model database service. It was built from the ground up with global distribution and horizontal scaling across all Azure regions.

 

Jupyter Notebooks are open-source web applications that allow you to create and share documents that contain live code, equations, visualizations, and narrative text.

 

In this blog post you will know more about Azure Cosmos DB built-in Jupyter Notebooks, that support all APIs and run within the Azure Cosmos DB accounts.

sample.png

 

 

Here are some important features that will improve your productivity while using the notebooks:

 

 

  • Azure Cosmos DB Python SDK V4: It is pre-installed and included in all notebooks. Your cosmos_client object will be pre-loaded with environment information about your Azure Cosmos account, saving you the work to inform database, key, and endpoint. But you can also create a custom version of the client, with information from another Azure Cosmos account.

 

  • Pre-Installed packages: Pandas, Matplotlib, among others. It means that you don’t need any installation to write, read, and analyze Cosmos DB data.

 

  • Packages Installation: You can install packages using pip install, making it available for all notebooks in the Azure Cosmos DB account.

 

  • Magic Commands: You can use the %%sql magic command to run a SQL query against any container in your account and load the results into a Pandas DataFrame. Or you can use %%upload to upload data from a JSON file to a specified Azure Cosmos container. You can also use %database and %container to set default parameters for your queries.

 

  • Memory management: You have up to 3.9 GB or memory, and you can release some of it cleaning outputs or resetting the workspace.

 

  • Spark Integration: You can select any of the existing Azure Synapse Spark Pools in your subscription. And for them you have 3 Kernel Twinkles available: Python, DotNet, and Scala.

 

  • Terminal, that gives you console access to the Linux compute node that runs your Jupyter Notebooks.

 

  • Direct Access: Your Azure Cosmos DB Data Explorer, including the Notebooks, are also available at Cosmos DB User Interface: https://cosmos.azure.com/

 

  • Built-in nteract data explorer: You can use the built-in nteract data explorer to filter and visualize a Pandas DataFrame.
 
 

nteract.png

 

The Azure Cosmos Portal comes with an array of samples for you to use and get started from. These notebooks can be used for demos, trainings, and source for tests and projects. When you open one of them, it is automatically copied to your My Notebooks folder, where you can not only use it, but also customize it, as necessary.

 

Collaboration is appreciated. If you’d like to contribute a Notebook and potentially have it appear as one of our Sample Notebooks, you can submit a PR on our GitHub page.

 

With Sample Notebooks you can learn by doing, and today we have options for visualization, Request Units, Indexing, Global Distribution, Stored Procedures, and IoT - AI integration.

 

Cosmic notebooks are available for all data models and APIs including Cassandra, MongoDB, SQL (Core), Gremlin, and Spark to enhance the developer experience in Azure Cosmos DB. Developers, data scientists, engineers and analysts can use the familiar Jupyter Notebooks experience to run interactive queries, explore and analyze data, and work with machine learning models.