Reputation: 1086
i am using azure blob triggers to identify when a container get updated. the trigger works fine. but it only returns the blob file as it is (like base 64 string). but how do i get the url for the blob file in this trigger.
function.js
{
"disabled": false,
"bindings": [
{
"name": "readText",
"type": "blobTrigger",
"direction": "in",
"path": "pngs/{name}",
"connection":"STORAGEConnectionString"
}
]
}
index.js
context.log('Node.js Blob trigger function processed', context.bindings);
Upvotes: 6
Views: 3210
Reputation: 578
You have to use context.bindingData:
context.bindingData.name;
context.bindingData.blobTrigger;
context.bindingData.uri;
Hope it helps.
Upvotes: 2
Reputation: 2513
you could actually use this format for the URIs for your blobs:
https://storagesample.blob.core.windows.net/mycontainer/blob1.txt https://storagesample.blob.core.windows.net/mycontainer/photos/myphoto.jpg
More information can be found here
Upvotes: 0