You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
module.exports=asyncfunction(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.
This has been de-prioritized in favor of a feature that uses @azure/storage-blob sdk types, where basically we would give you a BlobClient as the trigger input or extra input and you can use the client to get the content however you want. Daniel Castro (@castrodd) is working on a prototype now, related to #99 and #203
In the meantime, the only workaround for extra inputs is to use the sdk and create the blob client yourself. There is no workaround for trigger inputs. Actually, I already mentioned a workaround above using generics, that should still work for both.
Thanks for the details! I ended up using @azure/storage-blob but I like to try using any opportunity to reduce/simplify code 🙂 I'll have a look at generics, seems like a nice workaround.
Activity
vsantele commentedon May 29, 2023
Is there any news on this issue? Or a way to help fix it?
ejizba commentedon May 31, 2023
No updates, but this is still planned to be fixed before we GA. For a workaround, either use the v3 model or use generics:
sinedied commentedon Mar 27, 2024
Bumping into this, I have a storage extra input trying to load a PDF file, and I cannot get the blob content as a binary.
Eric Jizba (@ejizba) is there a workaround when using the v4
extraInputsfor setting the dataType?ejizba commentedon Mar 28, 2024
This has been de-prioritized in favor of a feature that uses
@azure/storage-blobsdk types, where basically we would give you aBlobClientas the trigger input or extra input and you can use the client to get the content however you want. Daniel Castro (@castrodd) is working on a prototype now, related to #99 and #203In the meantime, the only workaround for extra inputs is to use the sdk and create the blob client yourself. There is no workaround for trigger inputs. Actually, I already mentioned a workaround above using generics, that should still work for both.
sinedied commentedon Mar 29, 2024
Thanks for the details! I ended up using
@azure/storage-blobbut I like to try using any opportunity to reduce/simplify code 🙂 I'll have a look at generics, seems like a nice workaround.rohsyl commentedon Jul 18, 2024
As its still not fixed yet you can use this workaround :
add the
dataTypeand simply force castas anyand it works. it looks like it's just a typescript definition issue.