Skip to content

Commit 9957477

Browse files
committed
removing accidental duplicate article
1 parent ab3c5f3 commit 9957477

File tree

2 files changed

+17
-177
lines changed

2 files changed

+17
-177
lines changed

articles/cosmos-db/use-csharp-notebook-features-and commands.md

Lines changed: 0 additions & 163 deletions
This file was deleted.

articles/cosmos-db/use-csharp-notebook-features-and-commands.md

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,14 @@ In a new code cell, insert and run the following code, replacing ``PackageToBeIn
2121
```csharp
2222
#r "nuget: PackageToBeInstalled, optionalVersion"
2323
```
24+
2425
You can install multiple NuGet packages in the same cell. Packages will be available to use from any notebook in the Azure Cosmos account workspace.
2526

26-
Currently, the C# notebooks workspace does not support recursive resolution of NuGet packages. If a NuGet package has dependencies on other NuGet packages not currently installed, you may have to explicitly reference them along with the parent package.
27+
Currently, the C# notebooks workspace does not support recursive resolution of NuGet packages. 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.
28+
29+
> [!TIP]
30+
> 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. This reduces the chance of conflicts with other packages that Azure Cosmos DB loads by default. It is also easy to re-install the packages if you [reset the workspace](#reset-notebooks-workspace), which removes all packages.
2731
28-
> [!TIP]''
29-
> 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. This reduces the chance of conflicts with any packages Azure Cosmos DB loads by default. It also makes it easy to re-install them if you [reset the workspace](#reset-notebooks-workspace), which removes all packages.
3032
## Use the built-in Azure Cosmos DB .NET SDK
3133
Version 3 of the [Azure Cosmos DB .NET SDK for SQL API](https://github.com/Azure/azure-cosmos-dotnet-v3) is installed and included in the notebook environment for the Azure Cosmos account.
3234

@@ -47,19 +49,19 @@ CosmosClient cosmosClient = new CosmosClient(Cosmos.Endpoint, Cosmos.Key);
4749
Database database = await cosmosClient.CreateDatabaseIfNotExistsAsync("DatabaseName");
4850
Container container = await database.CreateContainerIfNotExistsAsync("ContainerName", "/partitionKey", 400);
4951
```
50-
See [.NET SDK samples](https://github.com/Azure/azure-cosmos-dotnet-v3/tree/master/Microsoft.Azure.Cosmos.Samples/Usage).
52+
To learn more, see the [.NET V3 SDK samples](https://github.com/Azure/azure-cosmos-dotnet-v3/tree/master/Microsoft.Azure.Cosmos.Samples/Usage).
5153

5254
> [!IMPORTANT]
5355
> The built-in Azure Cosmos DB .NET SDK is only supported for SQL (Core) API accounts. For other APIs, you will need to [install the relevant .NET driver](#install-a-new-nuget-package) that corresponds to the API.
5456
55-
## Set custom options using ```CosmosClientOptions```
56-
For more flexibility, you can set custom ``CosmosClientOptions`` to pass in your ``CosmosClient`` instance. You can use this to:
57+
## Set custom options using ``CosmosClientOptions``
58+
For more flexibility, you can set the custom ``CosmosClientOptions`` property and pass it in your ``CosmosClient`` instance. You can use this property to:
5759

58-
- Set an application name in the user-agent suffix to include in every request
59-
- Set the preferred region to be used to operations against the service
60-
- Set a custom retry policy on rate-limited requests
60+
- Set an application name in the user-agent suffix to include it in every request.
61+
- Set the preferred region to be used when running operations against the service.
62+
- Set a custom retry policy to handle rate-limited requests.
6163

62-
See the [documentation](/dotnet/api/microsoft.azure.cosmos.cosmosclientoptions) for all ``CosmosClientOptions`` settings.
64+
See the [CosmosClientOptions API reference](/dotnet/api/microsoft.azure.cosmos.cosmosclientoptions) article for all the supported settings. The following is an example that shows how to set `cosmosClientOptions` property:
6365

6466
```csharp
6567
using Microsoft.Azure.Cosmos;
@@ -76,7 +78,7 @@ var client = new CosmosClient(Cosmos.Endpoint, Cosmos.Key, cosmosClientOptions);
7678
```
7779

7880
## Access the account endpoint and primary key variables
79-
You can access the built-in endpoint and key of the account your notebook is in.
81+
You can access the built-in endpoint and key of the Azure Cosmos account where your notebook exists.
8082

8183
```csharp
8284
var key = Cosmos.Key;
@@ -104,9 +106,9 @@ for (int i = 0; i < 5; i++) {
104106
> Console.WriteLine() syntax is not currently supported in C# notebooks. Use Display.AsMarkdown to print console output from your program.
105107
106108
## Use built-in nteract data explorer
107-
You can use the built-in [nteract data explorer](https://blog.nteract.io/designing-the-nteract-data-explorer-f4476d53f897) to filter and visualize a collection of items. In a cell, put the variable you want to visualize in the last line, which will automatically be displayed in nteract when the cell is run.
109+
You can use the built-in [nteract data explorer](https://blog.nteract.io/designing-the-nteract-data-explorer-f4476d53f897) to filter and visualize a collection of items. 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.
108110

109-
For example, in the GetingStarted_Csharp.ipynb example, we can print out the variable with our result, the ``telemetryEvents``. See the [GettingStarted_Csharp.ipynb notebook](https://github.com/Azure-Samples/cosmos-notebooks/blob/master/CSharp_quickstarts/GettingStarted_CSharp.ipynb) for the entire sample.
111+
For example, in the *GetingStarted_Csharp.ipynb* example, we can print out the variable with our result, the ``telemetryEvents``. See the [GettingStarted_Csharp.ipynb notebook](https://github.com/Azure-Samples/cosmos-notebooks/blob/master/CSharp_quickstarts/GettingStarted_CSharp.ipynb) for the entire sample.
110112

111113
![Csharp query cell](media/use-notebook-features-and-commands/csharp-query-cell.png)
112114

@@ -133,12 +135,13 @@ For example:
133135
%%upload --database databaseName --container containerName --url
134136
https://contoso.com/path/to/data.json
135137
```
136-
```
138+
```markdown
137139
Documents successfully uploaded to ContainerName
138140
Total number of documents imported : 2654
139141
Total time taken : 00:00:38.1228087 hours
140142
Total RUs consumed : 25022.58
141143
```
144+
142145
With the output statistics, you can calculate the effective RU/s used to upload the items. For example, if 25,000 RUs were consumed over 38 seconds, the effective RU/s is 25,000 RUs / 38 seconds = 658 RU/s.
143146

144147
## Run another notebook in current notebook

0 commit comments

Comments
 (0)