2
votes

I wired up an Http Trigger C# function to my DocumentDB data. There I added a IEnumerable<dynamic> docDBData as a parameter on the Run method.

How do/can I pass that to a PowerShell Trigger function?

Couldn't find a an example in azure-webjobs-sdk-script repo. Not sure if I'm searching for the right thing.

1

1 Answers

2
votes

There are no examples for DocumentDB/CosmosDB and powershell - however, it should be relatively straightforward. The results of your query will be stored in the file $docDBData (assuming you named the binding docDBData) in json format, just like other trigger/input parameters.

$in = Get-Content $triggerInput | ConvertFrom-Json;
$docDBResults = Get-Content $docDBData | ConvertFrom-Json;
...

Here's a good resource on the DocumentDB binding in general: https://docs.microsoft.com/en-us/azure/azure-functions/functions-bindings-documentdb