Azure / azure-functions-durable-extension

Durable Task Framework extension for Azure Functions
MIT License
713 stars 267 forks source link

PowerShell Durable Function Activity Bindings with Table Bindings #2906

Open cgillum opened 2 weeks ago

cgillum commented 2 weeks ago

Discussed in https://github.com/Azure/azure-functions-durable-extension/discussions/2904

Originally posted by **Bionic711** August 28, 2024 I am currently working on a Durable Function written in PowerShell and having issues passing the input of the activityTrigger to the rowKey of a Table input in the same activity. ```{input}``` from the name of the activity trigger allows it to run, and logs show it was passed ```["stringvalue"]```, but using the type as described in MSFT docs with the queue trigger does not. ```{activityTrigger}``` results in a 'not recognized as a named parameter' error. The interesting part is that when it reaches out to the table to pull the value when using ```{input}```, it says that the rowKey or partitionKey cannot be ''. https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-storage-table-input?tabs=isolated-process%2Ctable-api%2Cnodejs-v4&pivots=programming-language-powershell Thus far I have only tested locally with Azurite as the emulator. Any ideas how to get this to work?
cgillum commented 2 weeks ago

@andystaples would you happen to know the answer to this?

Bionic711 commented 2 weeks ago

Here is the bindings:

{
    "bindings": [
        {
            "name": "input",
            "type": "activityTrigger",
            "direction": "in"
        },
        {
            "name": "mailbox",
            "type": "table",
            "tableName": "mailboxes",
            "partitionKey": "mailboxes",
            "rowKey": "{input}",
            "connection": "AzureWebJobsStorage",
            "direction": "in"
        },
        {
            "name": "results",
            "type": "table",
            "tableName": "results",
            "connection": "AzureWebJobsStorage",
            "direction": "out"
        }
    ],
    "disabled": false
}
davidmrdavid commented 1 week ago

Thanks for reaching out @Bionic711. This is the first time I hear of symptoms like this so we'll need to reproduce this in our end to dive deeper. Do you have a minimal reproducer you could share with us?

Bionic711 commented 3 days ago

I spoke with @davidmrdavid and will be uploading a reproducer by mid next week.