Skip to content

Commit cb5d517

Browse files
Peer review input.
1 parent 0437853 commit cb5d517

File tree

5 files changed

+24
-24
lines changed

5 files changed

+24
-24
lines changed

articles/cosmos-db/sql-api-dotnet-application.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ This tutorial covers:
3535
> * Performing create, read, update, and delete (CRUD) operations on the data
3636
3737
> [!TIP]
38-
> This tutorial assumes that you have prior experience using ASP.NET Core MVC and Azure App Service. If you are new to ASP.NET Core or the [prerequisite tools](#prerequisites), we recommend you to download the complete sample project from [GitHub][GitHub], add the required NuGet packages and run it. Once you build the project, you can review this article to gain insight on the code in the context of the project.
38+
> This tutorial assumes that you have prior experience using ASP.NET Core MVC and Azure App Service. If you are new to ASP.NET Core or the [prerequisite tools](#prerequisites), we recommend you to download the complete sample project from [GitHub][GitHub], add the required NuGet packages, and run it. Once you build the project, you can review this article to gain insight on the code in the context of the project.
3939
4040
## <a name="prerequisites"></a>Prerequisites
4141

42-
Before following the instructions in this article, ensure that you have the following resources:
42+
Before following the instructions in this article, make sure that you have the following resources:
4343

4444
* An active Azure account. If you don't have an Azure subscription, create a [free account](https://azure.microsoft.com/free/?WT.mc_id=A261C142F) before you begin.
4545

@@ -51,7 +51,7 @@ All the screenshots in this article are from Microsoft Visual Studio Community 2
5151

5252
## <a name="create-an-azure-cosmos-account"></a>Step 1: Create an Azure Cosmos account
5353

54-
Let's start by creating an Azure Cosmos account. If you already have an Azure Cosmos DB SQL API account or if you're using the Azure Cosmos DB emulator, skip this section. Start at [Create a new ASP.NET MVC application](#create-a-new-mvc-application).
54+
Let's start by creating an Azure Cosmos account. If you already have an Azure Cosmos DB SQL API account or if you're using the Azure Cosmos DB emulator, skip to [Step 2: Create a new ASP.NET MVC application](#create-a-new-mvc-application).
5555

5656
[!INCLUDE [create-dbaccount](../../includes/cosmos-db-create-dbaccount.md)]
5757

@@ -200,7 +200,7 @@ First, we'll add a class that contains the logic to connect to and use Azure Cos
200200

201201
[!code-csharp[Main](~/samples-cosmosdb-dotnet-core-web-app/src/Services/CosmosDbService.cs)]
202202

203-
1. Repeat the previous two steps, but this time, name the class *ICosmosDBService*, and use the following code:
203+
1. Repeat the previous two steps, but this time, use the name *ICosmosDBService*, and use the following code:
204204

205205
[!code-csharp[Main](~/samples-cosmosdb-dotnet-core-web-app/src/Services/ICosmosDbService.cs)]
206206

@@ -210,7 +210,7 @@ First, we'll add a class that contains the logic to connect to and use Azure Cos
210210
services.AddSingleton<ICosmosDbService>(InitializeCosmosClientInstanceAsync(Configuration.GetSection("CosmosDb")).GetAwaiter().GetResult());
211211
```
212212

213-
The code in the previous step receives a `CosmosClient` as part of the constructor. Following ASP.NET Core pipeline, we need to go to the project's *Startup.cs* file. The code in this step initializes the client based on the configuration as a Singleton instance to be injected through [Dependency injection in ASP.NET Core](https://docs.microsoft.com/aspnet/core/fundamentals/dependency-injection).
213+
The code in the previous step receives a `CosmosClient` as part of the constructor. Following ASP.NET Core pipeline, we need to go to the project's *Startup.cs* file. The code in this step initializes the client based on the configuration as a singleton instance to be injected through [Dependency injection in ASP.NET Core](https://docs.microsoft.com/aspnet/core/fundamentals/dependency-injection).
214214

215215
1. Within the same file, add the following method **InitializeCosmosClientInstanceAsync**, which reads the configuration and initializes the client.
216216

@@ -227,7 +227,7 @@ First, we'll add a class that contains the logic to connect to and use Azure Cos
227227
}
228228
```
229229

230-
If you run the application, ASP.NET Core's pipeline instantiates **CosmosDbService** and maintain a single instance as Singleton. When **ItemController** processes client-side requests, it receives this single instance and can use it for CRUD operations.
230+
If you run the application, ASP.NET Core's pipeline instantiates **CosmosDbService** and maintain a single instance as singleton. When **ItemController** processes client-side requests, it receives this single instance and can use it for CRUD operations.
231231

232232
If you build and run this project now, you should now see something that looks like this:
233233

@@ -237,23 +237,23 @@ If you build and run this project now, you should now see something that looks l
237237

238238
To test the application on your local computer, use the following steps:
239239

240-
1. Press F5 in Visual Studio to build the application in debug mode. It should build the application and launch a browser with the empty grid page we saw before:
240+
1. Select F5 in Visual Studio to build the application in debug mode. It should build the application and launch a browser with the empty grid page we saw before:
241241

242242
![Screenshot of the todo list web application created by this tutorial](./media/sql-api-dotnet-application/asp-net-mvc-tutorial-create-an-item-a.png)
243243

244244
1. Select the **Create New** link and add values to the **Name** and **Description** fields. Leave the **Completed** check box unselected. If you select it, the app adds the new item in a completed state. The item no longer appears on the initial list.
245245

246-
1. Select **Create**. The app sends you back to the **Index** view and your item appears in the list. You can add a few more items to your **To-Do** list.
246+
1. Select **Create**. The app sends you back to the **Index** view, and your item appears in the list. You can add a few more items to your **To-Do** list.
247247

248248
![Screenshot of the Index view](./media/sql-api-dotnet-application/asp-net-mvc-tutorial-create-an-item.png)
249249

250-
1. Select **Edit** next to an **Item** on the list. The app opens the **Edit** view where you can update any property of your object, including the **Completed** flag. If you select **Completed** flag and select **Save**, the app displays the **Item** as completed in the list.
250+
1. Select **Edit** next to an **Item** on the list. The app opens the **Edit** view where you can update any property of your object, including the **Completed** flag. If you select **Completed** and select **Save**, the app displays the **Item** as completed in the list.
251251

252252
![Screenshot of the Index view with the Completed box checked](./media/sql-api-dotnet-application/asp-net-mvc-tutorial-completed-item.png)
253253

254-
1. You can verify the state of the data in the Azure Cosmos DB service using [Cosmos Explorer](https://cosmos.azure.com) or the Azure Cosmos DB Emulator's Data Explorer.
254+
1. Verify the state of the data in the Azure Cosmos DB service using [Cosmos Explorer](https://cosmos.azure.com) or the Azure Cosmos DB Emulator's Data Explorer.
255255

256-
1. Once you've tested the app, press Ctrl+F5 to stop debugging the app. You're ready to deploy!
256+
1. Once you've tested the app, select Ctrl+F5 to stop debugging the app. You're ready to deploy!
257257

258258
## <a name="deploy-the-application-to-azure"></a>Step 7: Deploy the application
259259

articles/cosmos-db/sql-api-get-started.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ ms.author: kirankk
2121
2222
Welcome to the Azure Cosmos DB SQL API get started tutorial. After following this tutorial, you'll have a console application that creates and queries Azure Cosmos DB resources.
2323

24-
This tutorial uses [Version 3.0 or later](https://www.nuget.org/packages/Microsoft.Azure.Cosmos) of the Azure Cosmos DB .NET SDK. You can work with [.NET Framework](https://dotnet.microsoft.com/download) or [.NET Core](https://dotnet.microsoft.com/download).
24+
This tutorial uses version 3.0 or later of the [Azure Cosmos DB .NET SDK](https://www.nuget.org/packages/Microsoft.Azure.Cosmos). You can work with [.NET Framework or .NET Core](https://dotnet.microsoft.com/download).
2525

2626
This tutorial covers:
2727

@@ -49,7 +49,7 @@ Now let's get started!
4949

5050
## Step 1: Create an Azure Cosmos DB account
5151

52-
Let's create an Azure Cosmos DB account. If you already have an account you want to use, you can skip ahead to [Setup your Visual Studio Solution](#SetupVS). To use the Azure Cosmos DB Emulator, follow the steps at [Azure Cosmos DB Emulator](local-emulator.md) to set up the emulator. Then skip ahead to [Setup your Visual Studio project](#SetupVS).
52+
Let's create an Azure Cosmos DB account. If you already have an account you want to use, skip this section. To use the Azure Cosmos DB Emulator, follow the steps at [Azure Cosmos DB Emulator](local-emulator.md) to set up the emulator. Then skip ahead to [Step 2: Set up your Visual Studio project](#SetupVS).
5353

5454
[!INCLUDE [create-dbaccount-preview](../../includes/cosmos-db-create-dbaccount.md)]
5555

@@ -329,7 +329,7 @@ Congratulations! You've successfully created two Azure Cosmos items.
329329

330330
Azure Cosmos DB supports rich queries against JSON documents stored in each container. For more information, see [Getting started with SQL queries](sql-api-sql-query.md). The following sample code shows how to run a query against the items we inserted in the previous step.
331331

332-
1. Copy and paste the `QueryItemsAsync`** method after your `AddItemsToContainerAsync` method.
332+
1. Copy and paste the `QueryItemsAsync` method after your `AddItemsToContainerAsync` method.
333333

334334
[!code-csharp[](~/cosmos-dotnet-getting-started/CosmosGettingStartedTutorial/Program.cs?name=QueryItemsAsync&highlight=10-11,17-18)]
335335

@@ -471,7 +471,7 @@ To build the `GetStarted` solution, you need the following prerequisites:
471471
* An [Azure Cosmos DB account][cosmos-db-create-account].
472472
* The [GetStarted](https://github.com/Azure-Samples/cosmos-dotnet-getting-started) solution available on GitHub.
473473
474-
To restore the references to the Azure Cosmos DB .NET SDK in Visual Studio, right-click the solution in **Solution Explorer**, and then select **Restore NuGet Packages**. Next, in the *App.config* file, update the `EndPointUri` and `PrimaryKey` values as described in [Connect to an Azure Cosmos DB account](#Connect).
474+
To restore the references to the Azure Cosmos DB .NET SDK in Visual Studio, right-click the solution in **Solution Explorer**, and then select **Restore NuGet Packages**. Next, in the *App.config* file, update the `EndPointUri` and `PrimaryKey` values as described in [Step 3: Connect to an Azure Cosmos DB account](#Connect).
475475

476476
That's it, build it, and you're on your way!
477477

includes/cosmos-db-create-dbaccount.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,22 @@
1212

1313
1. Sign in to the [Azure portal](https://portal.azure.com/).
1414
1. Select **Create a resource** > **Databases** > **Azure Cosmos DB**.
15-
15+
1616
![The Azure portal Databases pane](./media/cosmos-db-create-dbaccount/create-nosql-db-databases-json-tutorial-1.png)
1717

1818
1. On the **Create Azure Cosmos DB Account** page, enter the basic settings for the new Azure Cosmos account.
19-
19+
2020
|Setting|Value|Description |
2121
|---|---|---|
2222
|Subscription|Subscription name|Select the Azure subscription that you want to use for this Azure Cosmos account. |
2323
|Resource Group|Resource group name|Select a resource group, or select **Create new**, then enter a unique name for the new resource group. |
24-
| Account Name|Enter a unique name|Enter a name to identify your Azure Cosmos account. Because *documents.azure.com* is appended to the ID that you provide to create your URI, use a unique ID.<br><br>The ID can only contain lowercase letters, numbers, and the hyphen (-) character. It must be between 3-31 characters in length.|
25-
| API|Core (SQL)|The API determines the type of account to create. Azure Cosmos DB provides five APIs: Core (SQL) and MongoDB for document data, Gremlin for graph data, Azure Table, and Cassandra. Currently, you must create a separate account for each API. <br><br>Select **Core (SQL)** to create a document database and query by using SQL syntax. <br><br>[Learn more about the SQL API](../articles/cosmos-db/documentdb-introduction.md).|
26-
| Location|Select the region closest to your users|Select a geographic location to host your Azure Cosmos DB account. Use the location that is closest to your users to give them the fastest access to the data.|
27-
28-
![The new account page for Azure Cosmos DB](./media/cosmos-db-create-dbaccount/azure-cosmos-db-create-new-account.png)
24+
|Account Name|A unique name|Enter a name to identify your Azure Cosmos account. Because *documents.azure.com* is appended to the ID that you provide to create your URI, use a unique ID.<br><br>The ID can only contain lowercase letters, numbers, and the hyphen (-) character. It must be between 3-31 characters in length.|
25+
|API|The type of account to create|Select **Core (SQL)** to create a document database and query by using SQL syntax. <br><br>The API determines the type of account to create. Azure Cosmos DB provides five APIs: Core (SQL) and MongoDB for document data, Gremlin for graph data, Azure Table, and Cassandra. Currently, you must create a separate account for each API. <br><br>[Learn more about the SQL API](../articles/cosmos-db/documentdb-introduction.md).|
26+
|Location|The region closest to your users|Select a geographic location to host your Azure Cosmos DB account. Use the location that is closest to your users to give them the fastest access to the data.|
27+
28+
![The new account page for Azure Cosmos DB](./media/cosmos-db-create-dbaccount/azure-cosmos-db-create-account.png)
2929

30-
1. Select **Review + create**. You can skip the **Network** and **Tags** sections.
30+
1. Select **Review + create**. You can skip the **Network** and **Tags** sections.
3131

3232
1. 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**.
3333

includes/cosmos-db-emulator-docdb-api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ ms.author: sngun
1919
ms.custom: "include file"
2020
---
2121

22-
You can [Try Azure Cosmos DB for free](https://azure.microsoft.com/try/cosmosdb/) without an Azure subscription, free of charge and commitments. Or, you can use the [Azure Cosmos DB Emulator](https://docs.microsoft.com/azure/cosmos-db/local-emulator) with a URI of `https://localhost:8081`. The Primary Key is provided in [Authenticating requests](../articles/cosmos-db/local-emulator.md#authenticating-requests).
22+
You can [Try Azure Cosmos DB for free](https://azure.microsoft.com/try/cosmosdb/) without an Azure subscription, free of charge and commitments. Or, you can use the [Azure Cosmos DB Emulator](https://docs.microsoft.com/azure/cosmos-db/local-emulator) with a URI of `https://localhost:8081`. For the key to use with the emulator, see [Authenticating requests](../articles/cosmos-db/local-emulator.md#authenticating-requests).
58.7 KB
Loading

0 commit comments

Comments
 (0)