Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
0ea45e0
wip test
satvu Oct 24, 2025
1d281fa
cosmosDB creation/item adding works
satvu Oct 27, 2025
74c4201
wip
satvu Oct 29, 2025
57c3359
cleanup
satvu Oct 29, 2025
3f9fa75
wip
satvu Nov 4, 2025
b7967d7
wip, node trigger test passes, others being debugged
satvu Dec 2, 2025
d5ea35b
working node e2e tests, remove legacy csharp script
satvu Dec 3, 2025
768e70c
add to yml file
satvu Dec 3, 2025
f7c7f6c
Merge branch 'dev' into satvu/update-cosmos-db-tests
satvu Dec 4, 2025
ddb5462
fix merge issues
satvu Dec 5, 2025
616c548
rm legacy csharp tests
satvu Dec 5, 2025
0d648ee
move cosmosdb emulator task
satvu Dec 5, 2025
ae2ca92
update start cosmsdb task
satvu Dec 5, 2025
d5b162b
fix space issue
satvu Dec 6, 2025
68f442a
fix yaml again
satvu Dec 6, 2025
19ae8e6
fix spacing
satvu Dec 6, 2025
5627b87
add script
satvu Dec 8, 2025
90a99c6
update pwshell task version
satvu Dec 8, 2025
810a125
fix typo
satvu Dec 8, 2025
2643d43
revert task back
satvu Dec 8, 2025
12e0885
add multiple items query test
satvu Dec 9, 2025
a0ff711
update number of node tests
satvu Dec 10, 2025
af0fbe6
test connection to emulator unit test added
satvu Dec 10, 2025
8f3e30d
test again
satvu Dec 10, 2025
5b4601f
test
satvu Dec 11, 2025
e67771a
flaky fix, cleanup
satvu Dec 12, 2025
8965a8b
testing separate db per func
satvu Dec 12, 2025
0606669
test again
satvu Dec 12, 2025
6454b2d
check for scripthost error
satvu Dec 13, 2025
373eda6
add another test
satvu Dec 13, 2025
58755de
move cosmsdb emulator start task
satvu Dec 17, 2025
c09f380
cleanup
satvu Dec 19, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion eng/ci/templates/official/jobs/run-non-e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,21 @@ jobs:
scriptType: bash
scriptLocation: inlineScript
inlineScript: |
echo "##vso[task.setvariable variable=ARM_CLIENT_ID]$servicePrincipalId"
echo "##vso[task.setvariable variable=ARM_CLIENT_ID]$servicePrincipalId"
echo "##vso[task.setvariable variable=ARM_ID_TOKEN]$idToken"
echo "##vso[task.setvariable variable=ARM_TENANT_ID]$tenantId"
- task: PowerShell@2
displayName: Start CosmosDB Emulator
inputs:
targetType: inline
script: |
Import-Module "$env:ProgramFiles\Azure Cosmos DB Emulator\PSModules\Microsoft.Azure.CosmosDB.Emulator"
Start-CosmosDbEmulator -NoFirewall -NoUI
# [SuppressMessage("Microsoft.Security", "CS002:SecretInNextLine", Justification="public emulator key, not confidential")]
Write-Host "##vso[task.setvariable variable=CosmosDB]AccountEndpoint=https://localhost:8081/;AccountKey=C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==;"
# This step ensures the azure context defined by the previous task is persisted
# and available to subsequent steps/tasks.
- bash: |
Expand Down
14 changes: 13 additions & 1 deletion src/WebJobs.Script/runtimeassemblies.json
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,18 @@
"name": "Microsoft.Azure.AppService.Proxy.Runtime",
"resolutionPolicy": "private"
},
{
"name": "Microsoft.Azure.Cosmos.Client",
"resolutionPolicy": "private"
},
{
"name": "Microsoft.Azure.Cosmos.Core",
"resolutionPolicy": "private"
},
{
"name": "Microsoft.Azure.Cosmos.Direct",
"resolutionPolicy": "private"
},
{
"name": "Microsoft.Azure.Functions.Platform.Metrics.LinuxConsumption",
"resolutionPolicy": "private"
Expand Down Expand Up @@ -946,7 +958,7 @@
{
"name": "OpenTelemetry.Api.ProviderBuilderExtensions",
"resolutionPolicy": "private"
},
},
{
"name": "OpenTelemetry.Exporter.OpenTelemetryProtocol",
"resolutionPolicy": "private"
Expand Down
2 changes: 1 addition & 1 deletion test/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<!-- Supporting Packages -->
<ItemGroup>
<PackageVersion Include="Microsoft.AspNet.WebApi.Core" Version="5.2.6" />
<PackageVersion Include="Microsoft.Azure.DocumentDB.Core" Version="2.11.2" />
<PackageVersion Include="Microsoft.Azure.Cosmos" Version="3.54.0" />
<PackageVersion Include="Microsoft.Azure.WebJobs.Extensions.Storage" Version="4.0.5-11874" />
<PackageVersion Include="Microsoft.Azure.Storage.Blob" Version="11.2.3" />
</ItemGroup>
Expand Down
26 changes: 0 additions & 26 deletions test/Resources/TestScripts/CSharp/CosmosDBIn/function.json

This file was deleted.

22 changes: 0 additions & 22 deletions test/Resources/TestScripts/CSharp/CosmosDBIn/run.csx

This file was deleted.

25 changes: 0 additions & 25 deletions test/Resources/TestScripts/CSharp/CosmosDBOut/function.json

This file was deleted.

14 changes: 0 additions & 14 deletions test/Resources/TestScripts/CSharp/CosmosDBOut/run.csx

This file was deleted.

18 changes: 0 additions & 18 deletions test/Resources/TestScripts/CSharp/CosmosDBTrigger/function.json

This file was deleted.

10 changes: 0 additions & 10 deletions test/Resources/TestScripts/CSharp/CosmosDBTrigger/run.csx

This file was deleted.

26 changes: 10 additions & 16 deletions test/Resources/TestScripts/Node/CosmosDBIn/function.json
Original file line number Diff line number Diff line change
@@ -1,34 +1,28 @@
{
{
"bindings": [
{
"type": "queueTrigger",
"name": "input",
"queueName": "documentdb-input-node",
"queueName": "cosmosdb-input-node",
"direction": "in"
},
{
"type": "cosmosDB",
"name": "itemIn",
"direction": "in",
"databaseName": "ItemDb",
"collectionName": "ItemCollection",
"id": "{documentId}"
},
{
"type": "cosmosDB",
"name": "relatedItems",
"direction": "in",
"databaseName": "ItemDb",
"collectionName": "ItemCollection",
"sqlQuery": "SELECT f.id, f.related FROM f WHERE f.related = {documentId}"
"databaseName": "InOutItemDb",
"containerName": "ItemCollection",
"partitionKey": "{id}",
"id": "{id}"
},
{
"type": "cosmosDB",
"name": "itemOut",
"direction": "out",
"databaseName": "ItemDb",
"collectionName": "ItemCollection",
"createIfNotExists": true
"databaseName": "InOutItemDb",
"containerName": "ItemCollection",
"createIfNotExists": true,
"partitionKey": "{id}"
Comment on lines 9 to +25
Copy link

Copilot AI Dec 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "connection" property is missing from all three CosmosDB bindings. While this may work with default connection string settings, it's inconsistent with the CosmosDBTrigger function.json which includes "connection": "CosmosDB". For consistency and clarity, all CosmosDB bindings should explicitly specify the connection property.

Copilot uses AI. Check for mistakes.
}
]
}
7 changes: 1 addition & 6 deletions test/Resources/TestScripts/Node/CosmosDBIn/index.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
module.exports = function (context, input) {
module.exports = function (context, input) {

context.log(context.bindings);

var relatedCount = context.bindings.relatedItems.length;
if (relatedCount !== 3) {
throw Error("Expected 3 documents. Found " + relatedCount);
}

context.bindings.itemOut = context.bindings.itemIn;
context.bindings.itemOut.text = "This was updated!";

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"bindings": [
{
"type": "queueTrigger",
"name": "input",
"queueName": "cosmosdb-input-multiple-node",
"direction": "in"
},
{
"name": "items",
"type": "cosmosDB",
"direction": "in",
"databaseName": "MultipleInOutItemDb",
"containerName": "ItemCollection",
"sqlQuery": "SELECT * from c where c.text = {id}"
},
{
"type": "cosmosDB",
"name": "itemOut",
"direction": "out",
"databaseName": "MultipleInOutItemDb",
"containerName": "ItemCollection",
"createIfNotExists": true
}
Comment on lines +9 to +24
Copy link

Copilot AI Dec 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "connection" property is missing from all three CosmosDB bindings. While this may work with default connection string settings, it's inconsistent with the CosmosDBTrigger function.json which includes "connection": "CosmosDB". For consistency and clarity, all CosmosDB bindings should explicitly specify the connection property.

Copilot uses AI. Check for mistakes.
]
}
15 changes: 15 additions & 0 deletions test/Resources/TestScripts/Node/CosmosDBInMultiple/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module.exports = function (context, input) {

context.log(context.bindings);

if (context.bindings.items.length !== 2) {
throw Error("Expected 2 documents. Found " + context.bindings.items.length);
}

context.bindings.itemOut = {
id: input.id,
text: "Hello from Node with multiple input bindings!"
};

context.done();
}
14 changes: 3 additions & 11 deletions test/Resources/TestScripts/Node/CosmosDBOut/function.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,16 @@
{
{
"bindings": [
{
"type": "manualTrigger",
"name": "input",
"direction": "in"
},
{
"type": "cosmosDB",
"name": "relatedItems",
"direction": "out",
"databaseName": "ItemDb",
"collectionName": "ItemCollection",
"createIfNotExists": true
},
{
"type": "cosmosDB",
"name": "item",
"direction": "out",
Copy link

Copilot AI Dec 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "connection" property is missing from the cosmosDB output binding. While this may work with default connection string settings, it's inconsistent with the CosmosDBTrigger function.json which includes "connection": "CosmosDB" on line 9. For consistency and clarity, all CosmosDB bindings should explicitly specify the connection property.

Suggested change
"direction": "out",
"direction": "out",
"connection": "CosmosDB",

Copilot uses AI. Check for mistakes.
"databaseName": "ItemDb",
"collectionName": "ItemCollection",
"databaseName": "InOutItemDb",
"containerName": "ItemCollection",
"createIfNotExists": true
}
]
Expand Down
8 changes: 1 addition & 7 deletions test/Resources/TestScripts/Node/CosmosDBOut/index.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
module.exports = function (context, input) {
module.exports = function (context, input) {
context.log('Node.js function triggered with input', input);

context.bindings.relatedItems = [
{ related: input },
{ related: input },
{ related: input }
];

context.bindings.item = {
id: input,
text: "Hello from Node!"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"bindings": [
{
"type": "manualTrigger",
"name": "input",
"direction": "in"
},
{
"type": "cosmosDB",
"name": "items",
"direction": "out",
"databaseName": "MultipleInOutItemDb",
"containerName": "ItemCollection",
"createIfNotExists": true
Copy link

Copilot AI Dec 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "connection" property is missing from the cosmosDB output binding. While this may work with default connection string settings, it's inconsistent with the CosmosDBTrigger function.json which includes "connection": "CosmosDB". For consistency and clarity, all CosmosDB bindings should explicitly specify the connection property.

Suggested change
"createIfNotExists": true
"createIfNotExists": true,
"connection": "CosmosDB"

Copilot uses AI. Check for mistakes.
}
]
}
15 changes: 15 additions & 0 deletions test/Resources/TestScripts/Node/CosmosDBOutMultiple/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module.exports = function (context, input) {
context.log('Node.js function triggered with input', input);

context.bindings.items = JSON.stringify([
{
"id": input + "-0",
"text": input
},
{
"id": input + "-1",
"text": input
}]);

context.done();
}
11 changes: 7 additions & 4 deletions test/Resources/TestScripts/Node/CosmosDBTrigger/function.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
{
{
"bindings": [
{
"type": "cosmosDBTrigger",
"name": "input",
"direction": "in",
"databaseName": "ItemDb",
"collectionName": "ItemCollection",
"createLeaseCollectionIfNotExists": true
"databaseName": "TriggerItemDb",
"containerName": "ItemCollection",
"connection": "CosmosDB",
"leaseContainerName": "leases",
"createLeaseContainerIfNotExists": true
},
{
"type": "blob",
"name": "blob",
"connection": "AzureWebJobsStorage",
"direction": "out",
"path": "test-output-node/cosmosdbtriggere2e-completed"
}
Expand Down
2 changes: 1 addition & 1 deletion test/Resources/TestScripts/Node/CosmosDBTrigger/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = function (context, input) {
module.exports = function (context, input) {
context.log('Document Id: ', input[0].id);

context.bindings.blob = input[0].id;
Expand Down
Loading
Loading