Skip to content

Commit e885ec8

Browse files
Merge pull request #100235 from mike-urnun-msft/update-functions-create-cosmos-db-triggered-function
resolves: #42184, #37457, #32754
2 parents 3da220a + bae86da commit e885ec8

File tree

7 files changed

+18
-19
lines changed

7 files changed

+18
-19
lines changed

articles/azure-functions/functions-create-cosmos-db-triggered-function.md

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -59,20 +59,20 @@ Next, you create a function in the new function app.
5959
| Setting | Suggested value | Description |
6060
| ------------ | ---------------- | ------------------------------------------ |
6161
| **Name** | Default | Use the default function name suggested by the template.|
62-
| **Azure Cosmos DB account connection** | New setting | Select **New**, then choose your **Subscription**, the **Database account** you created earlier, and **Select**. This creates an application setting for your account connection. This setting is used by the binding to connect to the database. |
63-
| **Collection name** | Items | Name of collection to be monitored. |
64-
| **Create lease collection if it doesn't exist** | Checked | The collection doesn't already exist, so create it. |
65-
| **Database name** | Tasks | Name of database with the collection to be monitored. |
62+
| **Azure Cosmos DB account connection** | New setting | Select **New**, then choose your **Subscription**, the **Database account** you created earlier, and **Select**. This creates an application setting for your account connection. This setting is used by the binding to connection to the database. |
63+
| **Container name** | Items | Name of container to be monitored. |
64+
| **Create lease container if it doesn't exist** | Checked | The container doesn't already exist, so create it. |
65+
| **Database name** | Tasks | Name of database with the container to be monitored. |
6666

6767
1. Click **Create** to create your Azure Cosmos DB triggered function. After the function is created, the template-based function code is displayed.
6868

6969
![Cosmos DB function template in C#](./media/functions-create-cosmos-db-triggered-function/function-cosmosdb-template.png)
7070

7171
This function template writes the number of documents and the first document ID to the logs.
7272

73-
Next, you connect to your Azure Cosmos DB account and create the `Items` collection in the `Tasks` database.
73+
Next, you connect to your Azure Cosmos DB account and create the `Items` container in the `Tasks` database.
7474

75-
## Create the Items collection
75+
## Create the Items container
7676

7777
1. Open a second instance of the [Azure portal](https://portal.azure.com) in a new tab in the browser.
7878

@@ -82,33 +82,32 @@ Next, you connect to your Azure Cosmos DB account and create the `Items` collect
8282

8383
1. Choose your Azure Cosmos DB account, then select the **Data Explorer**.
8484

85-
1. In **Collections**, choose **taskDatabase** and select **New Collection**.
85+
1. Under **SQL API**, choose **Tasks** database and select **New Container**.
8686

87-
![Create a collection](./media/functions-create-cosmos-db-triggered-function/cosmosdb-create-collection.png)
87+
![Create a container](./media/functions-create-cosmos-db-triggered-function/cosmosdb-create-container.png)
8888

89-
1. In **Add Collection**, use the settings shown in the table below the image.
89+
1. In **Add Container**, use the settings shown in the table below the image.
9090

91-
![Define the taskCollection](./media/functions-create-cosmos-db-triggered-function/cosmosdb-create-collection2.png)
91+
![Define the Tasks container](./media/functions-create-cosmos-db-triggered-function/cosmosdb-create-container2.png)
9292

9393
| Setting|Suggested value|Description |
9494
| ---|---|--- |
9595
| **Database ID** | Tasks |The name for your new database. This must match the name defined in your function binding. |
96-
| **Collection ID** | Items | The name for the new collection. This must match the name defined in your function binding. |
97-
| **Storage capacity** | Fixed (10 GB)|Use the default value. This value is the storage capacity of the database. |
98-
| **Throughput** |400 RU| Use the default value. If you want to reduce latency, you can scale up the throughput later. |
99-
| **[Partition key](../cosmos-db/partition-data.md)** | /category|A partition key that distributes data evenly to each partition. Selecting the correct partition key is important in creating a performant collection. |
96+
| **Container ID** | Items | The name for the new container. This must match the name defined in your function binding. |
97+
| **[Partition key](../cosmos-db/partition-data.md)** | /category|A partition key that distributes data evenly to each partition. Selecting the correct partition key is important in creating a performant container. |
98+
| **Throughput** |400 RU| Use the default value. If you want to reduce latency, you can scale up the throughput later. |
10099

101-
1. Click **OK** to create the Items collection. It may take a short time for the collection to get created.
100+
1. Click **OK** to create the Items container. It may take a short time for the container to get created.
102101

103-
After the collection specified in the function binding exists, you can test the function by adding documents to this new collection.
102+
After the container specified in the function binding exists, you can test the function by adding items to this new container.
104103

105104
## Test the function
106105

107-
1. Expand the new **taskCollection** collection in Data Explorer, choose **Documents**, then select **New Document**.
106+
1. Expand the new **Items** container in Data Explorer, choose **Items**, then select **New Item**.
108107

109-
![Create a document in taskCollection](./media/functions-create-cosmos-db-triggered-function/create-document-in-collection.png)
108+
![Create an item in Items container](./media/functions-create-cosmos-db-triggered-function/create-item-in-container.png)
110109

111-
1. Replace the contents of the new document with the following content, then choose **Save**.
110+
1. Replace the contents of the new item with the following content, then choose **Save**.
112111

113112
{
114113
"id": "task1",
12.9 KB
Loading
12 KB
Loading
21 KB
Loading

0 commit comments

Comments
 (0)