Skip to content

Commit ad22cf5

Browse files
author
Evan Roman
committed
add cosmos
1 parent 655abcd commit ad22cf5

File tree

24 files changed

+219
-150
lines changed

24 files changed

+219
-150
lines changed

app/v3-oldConfig/cosmosDBTrigger/function.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"name": "documents",
66
"direction": "in",
77
"leaseCollectionName": "leases",
8-
"connectionStringSetting": "e2eTest_cosmosDB",
8+
"connectionStringSetting": "CosmosDBConnection",
99
"databaseName": "e2eTestDB",
1010
"collectionName": "e2eTestContainerTrigger",
1111
"createLeaseCollectionIfNotExists": true,

app/v3-oldConfig/cosmosDBTriggerAndOutput/function.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"name": "documents",
66
"direction": "in",
77
"leaseCollectionName": "leases",
8-
"connectionStringSetting": "e2eTest_cosmosDB",
8+
"connectionStringSetting": "CosmosDBConnection",
99
"databaseName": "e2eTestDB",
1010
"collectionName": "e2eTestContainerTriggerAndOutput",
1111
"createLeaseCollectionIfNotExists": true,
@@ -15,7 +15,7 @@
1515
"type": "cosmosDB",
1616
"name": "$return",
1717
"direction": "out",
18-
"connectionStringSetting": "e2eTest_cosmosDB",
18+
"connectionStringSetting": "CosmosDBConnection",
1919
"databaseName": "e2eTestDB",
2020
"collectionName": "e2eTestContainerTrigger"
2121
}

app/v3-oldConfig/httpTriggerCosmosDBInput/function.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"type": "cosmosDB",
1717
"name": "inputDoc",
1818
"direction": "in",
19-
"connectionStringSetting": "e2eTest_cosmosDB",
19+
"connectionStringSetting": "CosmosDBConnection",
2020
"databaseName": "e2eTestDB",
2121
"collectionName": "e2eTestContainerTriggerAndOutput",
2222
"partitionKey": "testPartKey",

app/v3-oldConfig/httpTriggerCosmosDBOutput/function.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"type": "cosmosDB",
1717
"name": "outputDoc",
1818
"direction": "out",
19-
"connectionStringSetting": "e2eTest_cosmosDB",
19+
"connectionStringSetting": "CosmosDBConnection",
2020
"databaseName": "e2eTestDB",
2121
"collectionName": "e2eTestContainerTriggerAndOutput"
2222
}

app/v3/cosmosDBTrigger/function.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"name": "documents",
66
"direction": "in",
77
"leaseContainerName": "leases",
8-
"connection": "e2eTest_cosmosDB",
8+
"connection": "CosmosDBConnection",
99
"databaseName": "e2eTestDB",
1010
"containerName": "e2eTestContainerTrigger",
1111
"createLeaseContainerIfNotExists": true,

app/v3/cosmosDBTrigger/index.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
// // Copyright (c) .NET Foundation. All rights reserved.
2-
// // Licensed under the MIT License.
1+
// Copyright (c) .NET Foundation. All rights reserved.
2+
// Licensed under the MIT License.
33

4-
// import { AzureFunction, Context } from '@azure/functions';
4+
import { AzureFunction, Context } from '@azure/functions';
55

6-
// const cosmosDBTrigger: AzureFunction = async function (context: Context, documents: any[]): Promise<void> {
7-
// context.log(`cosmosDBTrigger processed ${documents.length} documents`);
8-
// for (const document of documents) {
9-
// context.log(`cosmosDBTrigger was triggered by "${document.testData}"`);
10-
// }
11-
// };
6+
const cosmosDBTrigger: AzureFunction = async function (context: Context, documents: any[]): Promise<void> {
7+
context.log(`cosmosDBTrigger processed ${documents.length} documents`);
8+
for (const document of documents) {
9+
context.log(`cosmosDBTrigger was triggered by "${document.testData}"`);
10+
}
11+
};
1212

13-
// export default cosmosDBTrigger;
13+
export default cosmosDBTrigger;

app/v3/cosmosDBTriggerAndOutput/function.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"name": "documents",
66
"direction": "in",
77
"leaseContainerName": "leases",
8-
"connection": "e2eTest_cosmosDB",
8+
"connection": "CosmosDBConnection",
99
"databaseName": "e2eTestDB",
1010
"containerName": "e2eTestContainerTriggerAndOutput",
1111
"createLeaseContainerIfNotExists": true,
@@ -15,7 +15,7 @@
1515
"type": "cosmosDB",
1616
"name": "$return",
1717
"direction": "out",
18-
"connection": "e2eTest_cosmosDB",
18+
"connection": "CosmosDBConnection",
1919
"databaseName": "e2eTestDB",
2020
"containerName": "e2eTestContainerTrigger"
2121
}
Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
// // Copyright (c) .NET Foundation. All rights reserved.
2-
// // Licensed under the MIT License.
1+
// Copyright (c) .NET Foundation. All rights reserved.
2+
// Licensed under the MIT License.
33

4-
// import { AzureFunction, Context } from '@azure/functions';
4+
import { AzureFunction, Context } from '@azure/functions';
55

6-
// const cosmosDBTrigger: AzureFunction = async function (context: Context, documents: any[]): Promise<any[]> {
7-
// context.log(`cosmosDBTriggerAndOutput processed ${documents.length} documents`);
8-
// for (const document of documents) {
9-
// context.log(`cosmosDBTriggerAndOutput was triggered by "${document.testData}"`);
10-
// }
11-
// return documents;
12-
// };
6+
const cosmosDBTrigger: AzureFunction = async function (context: Context, documents: any[]): Promise<any[]> {
7+
context.log(`cosmosDBTriggerAndOutput processed ${documents.length} documents`);
8+
for (const document of documents) {
9+
context.log(`cosmosDBTriggerAndOutput was triggered by "${document.testData}"`);
10+
}
11+
return documents;
12+
};
1313

14-
// export default cosmosDBTrigger;
14+
export default cosmosDBTrigger;

app/v3/httpTriggerCosmosDBInput/function.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"type": "cosmosDB",
1717
"name": "inputDoc",
1818
"direction": "in",
19-
"connection": "e2eTest_cosmosDB",
19+
"connection": "CosmosDBConnection",
2020
"databaseName": "e2eTestDB",
2121
"containerName": "e2eTestContainerTriggerAndOutput",
2222
"partitionKey": "testPartKey",
Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
// // Copyright (c) .NET Foundation. All rights reserved.
2-
// // Licensed under the MIT License.
1+
// Copyright (c) .NET Foundation. All rights reserved.
2+
// Licensed under the MIT License.
33

4-
// import { AzureFunction, Context, HttpRequest } from '@azure/functions';
4+
import { AzureFunction, Context, HttpRequest } from '@azure/functions';
55

6-
// const httpTriggerCosmosDBInput: AzureFunction = async function (
7-
// context: Context,
8-
// _request: HttpRequest
9-
// ): Promise<void> {
10-
// context.res = {
11-
// body: context.bindings.inputDoc.testData,
12-
// };
13-
// };
6+
const httpTriggerCosmosDBInput: AzureFunction = async function (
7+
context: Context,
8+
_request: HttpRequest
9+
): Promise<void> {
10+
context.res = {
11+
body: context.bindings.inputDoc.testData,
12+
};
13+
};
1414

15-
// export default httpTriggerCosmosDBInput;
15+
export default httpTriggerCosmosDBInput;

0 commit comments

Comments
 (0)