You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/cosmos-db/create-sql-api-dotnet.md
+14-15Lines changed: 14 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ ms.service: cosmos-db
7
7
ms.subservice: cosmosdb-sql
8
8
ms.devlang: dotnet
9
9
ms.topic: quickstart
10
-
ms.date: 05/20/2019
10
+
ms.date: 06/06/2019
11
11
---
12
12
# Quickstart: Build a .NET web app using SQL API account in Azure Cosmos DB
13
13
@@ -46,33 +46,32 @@ An Azure subscription or free Azure Cosmos DB trial account
46
46
47
47
You can use the Data Explorer in the Azure portal to create a database and collection.
48
48
49
-
1. Select **Data Explorer** from the left navigation on your Azure Cosmos DB account page, and then select **New Collection**.
49
+
1. Select **Data Explorer** from the left navigation on your Azure Cosmos DB account page, and then select **New Container**.
50
50
51
-
You may need to scroll right to see the **Add Collection**area.
51
+
You may need to scroll right to see the **Add Container**window.
52
52
53
53

54
54
55
-
1. In the **Add collection**page, enter the settings for the new collection.
55
+
1. In the **Add container**pane, enter the settings for the new collection.
56
56
57
57
|Setting|Suggested value|Description
58
58
|---|---|---|
59
-
|**Database ID**|ToDoList|Enter *ToDoList* as the name for the new database. Database names must contain from 1 through 255 characters, and they cannot contain `/, \\, #, ?`, or a trailing space.|
60
-
|**Collection ID**|Items|Enter *Items* as the name for your new collection. Collection IDs have the same character requirements as database names.|
61
-
|**Partition key**| /category| The sample described in this article uses */category* as the partition key.|
59
+
|**Database ID**|ToDoList|Enter *ToDoList* as the name for the new database. Database names must contain from 1 through 255 characters, and they cannot contain `/, \\, #, ?`, or a trailing space. Check the **Provision database throughput** option, it allows you to share the throughput provisioned to the database across all the containers within the database. This option also helps with cost savings. |
62
60
|**Throughput**|400|Leave the throughput at 400 request units per second (RU/s). If you want to reduce latency, you can scale up the throughput later.|
61
+
|**Container ID**|Items|Enter *Items* as the name for your new collection. Collection IDs have the same character requirements as database names.|
62
+
|**Partition key**| /category| The sample described in this article uses */category* as the partition key.|
63
+
63
64
64
65
Don't add **Unique keys** for this example. Unique keys let you add a layer of data integrity to the database by ensuring the uniqueness of one or more values per partition key. For more information, see [Unique keys in Azure Cosmos DB](unique-keys.md).
65
66
66
-
1. Select **OK**.
67
-
Data Explorer displays the new database and collection.
67
+
1. Select **OK**. The Data Explorer displays the new database and the container that you created.
68
68
69
-

70
69
71
70
## Add data to your database
72
71
73
72
Add data to your new database using Data Explorer.
74
73
75
-
1. In **Data Explorer**, the new database appears in the **Collections** pane. Expand the **ToDoList** database, expand the **Items**collection, select **Documents**, and then select **New Document**.
74
+
1. In **Data Explorer**, expand the **ToDoList** database, and expand the **Items**container. Next, select **Items**, and then select **New Item**.
76
75
77
76

78
77
@@ -102,7 +101,7 @@ Add data to your new database using Data Explorer.
102
101
103
102
To see how easy it is to work with your Azure Cosmos DB data programmatically, clone the sample SQL API .NET web app from GitHub, update the connection string, and run the app to update your data.
104
103
105
-
You could also create the database and collection by using the .NET sample code. To learn more, see [Review the .NET code](#review-the-net-code).
104
+
You could also create the database and the container by using the .NET sample code. To learn more, see [Review the .NET code](#review-the-net-code).
106
105
107
106
### Clone the sample app
108
107
@@ -142,7 +141,7 @@ First, clone a C# [SQL API app](https://github.com/Azure-Samples/documentdb-dotn
1. Make sure the database and collection values in the *web.config* match the names you created earlier.
144
+
1. Make sure the database and collection (also called container) values in the *web.config* match the names you created earlier.
146
145
147
146
```csharp
148
147
<addkey="database"value="ToDoList"/>
@@ -171,7 +170,7 @@ You can go back to Data Explorer in the Azure portal to see, query, modify, and
171
170
172
171
## Review the .NET code
173
172
174
-
Thisstepisoptional. Inthisquickstart, youcreatedadatabaseandacollectionintheAzureportalandaddedsampledatabyusingthe .NETsample. However, youcanalsocreatethedatabaseandthecollectionbyusingthe .NETsample. Reviewthefollowingsnippetsifyou're interested in how database resources are created in the code. The snippets are all taken from the *DocumentDBRepository.cs* file in the **todo** project.
173
+
Thisstepisoptional. Inthisquickstart, youcreatedadatabaseandacontainerintheAzureportalandaddedsampledatabyusingthe .NETsample. However, youcanalsocreatethedatabaseandthecontainerbyusingthe .NETsample. Reviewthefollowingsnippetsifyou're interested in how database resources are created in the code. The snippets are all taken from the *DocumentDBRepository.cs* file in the **todo** project.
175
174
176
175
*Thiscodeinitializesthe `DocumentClient`:
177
176
@@ -224,7 +223,7 @@ This step is optional. In this quickstart, you created a database and a collecti
Copy file name to clipboardExpand all lines: articles/cosmos-db/create-sql-api-java.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,7 +21,7 @@ ms.author: sngun
21
21
> *[Python](create-sql-api-python.md)
22
22
> *[Xamarin](create-sql-api-xamarin-dotnet.md)
23
23
24
-
This quickstart shows how to create and manage resources of an Azure Cosmos DB [SQL API](sql-api-introduction.md) account by using a Java application. First, you create an Azure Cosmos DB SQL API account using the Azure portal, create a Java app using the [SQL Java SDK](sql-api-sdk-async-java.md), add resources to your Cosmos DB account by using the Java application. The instructions in this quickstart can be followed on any operating system that is capable of running Java. After completing this quickstart you'll be familiar with creating and modifying Cosmos DB databases, collections in either the UI or programmatically, whichever is your preference.
24
+
This quickstart shows how to create and manage resources of an Azure Cosmos DB [SQL API](sql-api-introduction.md) account by using a Java application. First, you create an Azure Cosmos DB SQL API account using the Azure portal, create a Java app using the [SQL Java SDK](sql-api-sdk-async-java.md), add resources to your Cosmos DB account by using the Java application. The instructions in this quickstart can be followed on any operating system that is capable of running Java. After completing this quickstart you'll be familiar with creating and modifying Cosmos DB databases, containers in either the UI or programmatically, whichever is your preference.
25
25
26
26
## Prerequisites
27
27
@@ -43,7 +43,7 @@ Before you can create a document database, you need to create a SQL API account
@@ -71,7 +71,7 @@ Now let's switch to working with code. Let's clone a SQL API app from GitHub, se
71
71
This step is optional. If you're interested in learning how the database resources are created in the code, you can review the following snippets. Otherwise, you can skip ahead to [Run the app
72
72
](#run-the-app).
73
73
74
-
* `AsyncDocumentClient` initialization. The [AsyncDocumentClient](https://docs.microsoft.com/java/api/com.microsoft.azure.cosmosdb.rx.asyncdocumentclient) provides client-side logical representation for the Azure Cosmos DB database service. This client is used to configure and execute requests against the service.
74
+
* `AsyncDocumentClient` initialization. The [AsyncDocumentClient](https://docs.microsoft.com/java/api/com.microsoft.azure.cosmosdb.rx.asyncdocumentclient) provides client-side logical representation for the Azure Cosmos database service. This client is used to configure and execute requests against the service.
75
75
76
76
```java
77
77
client = new AsyncDocumentClient.Builder()
@@ -200,7 +200,7 @@ Now go back to the Azure portal to get your connection string information and la
200
200
201
201
## Next steps
202
202
203
-
In this quickstart, you've learned how to create an Azure Cosmos DB account, document database, and collection using the Data Explorer, and run an app to do the same thing programmatically. You can now import additional data into your Azure Cosmos DB collection.
203
+
In this quickstart, you've learned how to create an Azure Cosmos account, document database, and container using the Data Explorer, and run an app to do the same thing programmatically. You can now import additional data into your Azure Cosmos container.
204
204
205
205
> [!div class="nextstepaction"]
206
206
> [Import data into Azure Cosmos DB](import-data.md)
@@ -128,7 +128,7 @@ The following snippets are all taken from the **app.js** file.
128
128
129
129
Now go back to the Azure portal to get your connection string information and copy it into the app.
130
130
131
-
1. In the [Azure portal](https://portal.azure.com/), in your Azure Cosmos DB account, in the left navigation click **Keys**, and then click **Read-write Keys**. You'll use the copy buttons on the right side of the screen to copy the URI and Primary Key into the `config.js` file in the next step.
131
+
1. In the [Azure portal](https://portal.azure.com/), in your Azure Cosmos account, in the left navigation click **Keys**, and then click **Read-write Keys**. You'll use the copy buttons on the right side of the screen to copy the URI and Primary Key into the `config.js` file in the next step.
132
132
133
133

134
134
@@ -159,7 +159,7 @@ You can now go back to Data Explorer and see query, modify, and work with this n
159
159
160
160
## Next steps
161
161
162
-
In this quickstart, you've learned how to create an Azure Cosmos DB account, create a collection using the Data Explorer, and run an app. You can now import additional data to your Cosmos DB account.
162
+
In this quickstart, you've learned how to create an Azure Cosmos account, create a container using the Data Explorer, and run an app. You can now import additional data to your Cosmos DB account.
163
163
164
164
> [!div class="nextstepaction"]
165
165
> [Import data into Azure Cosmos DB](import-data.md)
@@ -80,7 +80,7 @@ Now let's clone a SQL API app from GitHub, set the connection string, and run it
80
80
81
81
Now go back to the Azure portal to get your connection string information and copy it into the app.
82
82
83
-
1. In the [Azure portal](https://portal.azure.com/), in your Azure Cosmos DB account, in the left navigation click **Keys**. You'll use the copy buttons on the right side of the screen to copy the **URI** and **Primary Key** into the `CosmosGetStarted.py` file in the next step.
83
+
1. In the [Azure portal](https://portal.azure.com/), in your Azure Cosmos account, in the left navigation click **Keys**. You'll use the copy buttons on the right side of the screen to copy the **URI** and **Primary Key** into the `CosmosGetStarted.py` file in the next step.
84
84
85
85

86
86
@@ -211,7 +211,7 @@ The following snippets are all taken from the `CosmosGetStarted.py` file.
211
211
212
212
## Next steps
213
213
214
-
In this quickstart, you've learned how to create an Azure Cosmos DB account, create a collection using the Data Explorer, and run an app. You can now import additional data to your Cosmos DB account.
214
+
In this quickstart, you've learned how to create an Azure Cosmos account, create a container using the Data Explorer, and run an app. You can now import additional data to your Cosmos DB account.
215
215
216
216
> [!div class="nextstepaction"]
217
217
> [Import data into Azure Cosmos DB for the SQL API](import-data.md)
@@ -179,7 +179,7 @@ Now let's take a quick review of how the app communicates with Azure Cosmos DB.
179
179
}
180
180
```
181
181
182
-
Here a new URI is needed to uniquely identify the document to replace and is obtained by using `UriFactory.CreateDocumentUri` and passing it the database and collection names and the id of the document.
182
+
Here a new URI is needed to uniquely identify the document to replace and is obtained by using `UriFactory.CreateDocumentUri` and passing it the database and collection names and the ID of the document.
183
183
184
184
The `DocumentClient.ReplaceDocumentAsync` replaces the document identified by the URI with the one specified as a parameter.
185
185
@@ -240,7 +240,7 @@ The following steps will demonstrate how to run the app using the Visual Studio
240
240
241
241
## Next steps
242
242
243
-
In this quickstart, you've learned how to create an Azure Cosmos DB account, create a collection using the Data Explorer, and build and deploy a Xamarin app. You can now import additional data to your Azure Cosmos DB account.
243
+
In this quickstart, you've learned how to create an Azure Cosmos account, create a container using the Data Explorer, and build and deploy a Xamarin app. You can now import additional data to your Azure Cosmos account.
244
244
245
245
> [!div class="nextstepaction"]
246
246
> [Import data into Azure Cosmos DB](import-data.md)
0 commit comments