Skip to content

Support changing dataType for a binding in v4 #72

@ejizba

Description

@ejizba

v3 function.json content:

{
    "name": "myQueueItem",
    "type": "queueTrigger",
    "direction": "in",
    "queueName": "helloworldqueue",
    "connection": "storage_APPSETTING",
    "dataType": "binary"
}

v3 index.js content:

module.exports = async function (context, myQueueItem) {
    context.log('JavaScript queue trigger function processed work item', myQueueItem);
};

In v3 the type of myQueueItem changes based on the value of dataType. If you set dataType to binary, myQueueItem will be a Buffer. Otherwise, myQueueItem will either be a string or possibly a parsed object if the string was JSON.

In v4, we don't allow users to change myQueueItem to a Buffer type, which we should. This does not apply to http triggers, but probably applies to several other triggers/bindings other than storage queue.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions