Azure / azure-functions-host

The host/runtime that powers Azure Functions
https://functions.azure.com
MIT License
1.92k stars 442 forks source link

Node.js Azure function input binding for Table storage ignores rowKey #10356

Open yohny opened 1 month ago

yohny commented 1 month ago

I have a simple Node.js Azure function (runtime v4) with input binding for Azure Table storage as follows:

import { app, HttpRequest, HttpResponseInit, InvocationContext, input } from "@azure/functions";

const tableInput = input.table({
    tableName: 'Person',
    partitionKey: 'Test',
    rowKey: '{key}',
    connection: 'AzureWebJobsStorage',
});

export async function readTable(request: HttpRequest, context: InvocationContext): Promise<HttpResponseInit> {
    context.log(`Http function processed request for url "${request.url}"`);

    const tableData = context.extraInputs.get(tableInput)

    return { jsonBody: tableData };
};

app.http('readTable', {
    methods: ['GET'],
    route: 'read/{key}',
    extraInputs: [tableInput],
    authLevel: 'anonymous',
    handler: readTable
});

The result of this function is however all the rows in Person table with Test partition key, instead of just one (or none) with given rowKey.

The behaviour is the same localy (with Azurite as storage emulator) and when deployed to Azure.

Node.js v20, @azure/functions v4.5.0

tojo6797 commented 3 days ago

Same issue here

Node.js v18.20.4 @azure/functions v4.5.1