How to access the blob name in function.json output bindings path key of a particular blob which triggered event grid
See original GitHub issueI was referred to this repo by a official member.
{
"bindings": [
{
"type": "eventGridTrigger",
"name": "eventGridEvent",
"direction": "in"
},
{
"name": "inputBlob",
"type": "blob",
"path": "{data.url}",
"connection": "projectimagestore_STORAGE",
"direction": "in",
"datatype": "binary"
},
{
"name": "outputBlob",
"direction": "out",
"type": "blob",
"path": "compressedprojectimages/{filename}",
"connection": "projectimagestore_STORAGE"
]
}
I want to access the current filename (blob name on which function is being processed) on key “path”: “container/{filename}” suppose the file name is test.jpg so the container container should also store test.jpg.
Note: I have two different container. I am getting input from one container and want to store the processed blob with same filename in another container.
As of now if I try to run function it gives an error like no value for filename
I don’t know what to put in path
.
How my function looks like
const fetch = require("node-fetch");
module.exports = async function (context, eventGridEvent, inputBlob) {
try{
context.log(typeof eventGridEvent);
context.log(eventGridEvent);
context.log(context);
context.log(typeof inputBlob);
context.log({inputBlob})
// context.bindings.outputBlob = inputBlob
}
};
azure func v2 core tools
node v 12 LTS
Using Blob storage
Found this error which blob was created in container
Thanks
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
Azure Blob storage trigger for Azure Functions | Microsoft Learn
Learn how to run an Azure Function as Azure Blob storage data changes. ... to work with Event Grid triggers and bindings in...
Read more >Python Azure function triggered by Blob storage printing file ...
I'm triggering an Azure function with a blob trigger event. A container sample-workitems has a file base.csv and receives a new file new.csv....
Read more >How to Create and Deploy a Simple Blob Trigger In Azure ...
Blob triggers are a very powerful tool in Azure for triggering Azure Functions from events in Azure Storage. In this video, we're going...
Read more >Chapter 4. Getting Started with Microsoft Azure Functions
We call various functions in response to different events and return a result. ... An Azure Blob Storage trigger to process storage blobs...
Read more >AZ-204 exam questions for FREE | Azure Developing solutions
The application is used to work with blobs in an Azure storage account. ... You have to define the correct bindings in the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hey @DVGY
Thanks for the clarification and your patience
This repository is for the JavaScript libraries for different Azure services. Your question is more on the side of working with bindings in Azure functions. Based on this pointer for reporting issues, it looks like the right place for you to log this issue would be https://github.com/Azure/azure-webjobs-sdk-script
Can you share who referred this repo to you? We would like to make sure we clarify the purpose of this repo to them as well.
According to JSON payloads and binding expressions, since the event data payload is a JSON object, you are able to refer to anything inside it in the bindings
Unfortunately, the event data payload only has the blob url and not the blob name, otherwise you could have used it. The folks at https://github.com/Azure/azure-webjobs-sdk-script should be able to help you better.
Thanks @DVGY
@jiacfan fyi, please see https://github.com/Azure/azure-sdk-for-js/issues/13024#issuecomment-751905247