

- #Set default ipynb viewer how to#
- #Set default ipynb viewer install#
- #Set default ipynb viewer code#
You can use the %%upload magic command to upload data from a JSON file to a specified Azure Cosmos container. In a cell, put the variable you want to visualize in the last line, which will be automatically displayed when the cell is run. You can use the built-in dictionary viewer to view a variable. See the GettingStarted_Csharp.ipynb notebook for the entire sample. In a cell, put the variable you want to visualize in the last line, which is automatically displayed in nteract when you run the cell.įor example, in the GetingStarted_Csharp.ipynb example, we can print out the variable with our result, the telemetryEvents. You can use the built-in nteract data explorer to filter and visualize a collection of items. Use Display.AsMarkdown to print console output from your program. var key = Cosmos.Key Ĭonsole.WriteLine() syntax is not currently supported in C# notebooks. You can access the built-in endpoint and key of the Azure Cosmos account where your notebook exists. Var client = new CosmosClient(Cosmos.Endpoint, Cosmos.Key, cosmosClientOptions) Īccess the account endpoint and primary key variables MaxRetryAttemptsOnRateLimitedRequests = 9, // By default, this value is 9 Var cosmosClientOptions = new CosmosClientOptionsĪpplicationName = "ContosoNotebookAppName",ĪpplicationRegion = Regions.RegionName, // By default, this is the region you first created your account in
#Set default ipynb viewer how to#
The following is an example that shows how to set cosmosClientOptions property: using See the CosmosClientOptions API reference article for all the supported settings. Set a custom retry policy to handle rate-limited requests.Set the preferred region to be used when running operations against the service.Set an application name in the user-agent suffix to include it in every request.Set custom options using CosmosClientOptionsįor more flexibility, you can set the custom CosmosClientOptions property and pass it in your CosmosClient instance.
#Set default ipynb viewer install#
For other APIs, you will need to install the relevant.

NET SDK is only supported for SQL (Core) API accounts. Create a new database and container with 400 RU/sĭatabase database = await cosmosClient.CreateDatabaseIfNotExistsAsync("DatabaseName") Ĭontainer container = await database.CreateContainerIfNotExistsAsync("ContainerName", "/partitionKey", 400) Initialize a new instance of CosmosClient using the built-in account endpoint and key parametersĬosmosClient cosmosClient = new CosmosClient(Cosmos.Endpoint, Cosmos.Key) NET SDK for SQL API is installed and included in the notebook environment for the Azure Cosmos account.Ĭreate an instance of CosmosClient to run any SDK operation. It is also easy to re-install the packages if you reset the workspace, which removes all packages. This reduces the chance of conflicts with other packages that Azure Cosmos DB loads by default. If your notebook requires a custom package, we recommend that you add a cell to your notebook to install the package and make it the first cell. If a NuGet package has dependencies on other NuGet packages that are not currently installed, you have to explicitly reference them along with the parent package. Packages will be available to use from any notebook in the Azure Cosmos account workspace.Ĭurrently, the C# notebooks workspace does not support recursive resolution of NuGet packages. You can install multiple NuGet packages in the same cell. #r "nuget: PackageToBeInstalled, optionalVersion"
#Set default ipynb viewer code#
In a new code cell, insert and run the following code, replacing PackageToBeInstalled with the desired NuGet package, and optionalVersion with a specific version of the package if desired. Install a new NuGet packageĪfter you enable notebook support for your Azure Cosmos accounts, you can open a new notebook and install a package. This article describes how to use built-in notebook commands and features to do common operations in C# notebooks. Built-in Jupyter notebooks in Azure Cosmos DB enable you to analyze and visualize your data from the Azure portal.
