1

I have developed a Blob Trigger Azure function. This will trigger when a file uploads to blob folder. This function will get this uploaded file, Encrypts it and copy the encrypted file into another blob folder.

I can see my function is getting triggered when a new file is added to blob. But I can also see that my function is getting triggered when I am removing the file from blob.

How can I restrict this. My Azure Function has to run only when new BLOB is UPLOADED. It should not run when I delete any file from the blob.

Please suggest me an approach. Thank you.

1
  • Are you using Azure Function Event Grid Blob Trigger? Also can please help us with your code Commented Mar 22, 2022 at 14:41

2 Answers 2

0

I see you added the Event Grid tag so I would assume you are using Event Grid here and if not, then you can consider it as an option since it will allow you to filter in/out events based on event type or payload.

When you create the event grid topic subscription there is a filter section called "event type" on this you can select which events are to be filtered out from Event Grid and you can find the available event types here docs In your case make sure to only select BlobCreated events, just so those are the only ones sent to the destination Function App.

Sign up to request clarification or add additional context in comments.

1 Comment

Hi Thank you. This helps a bit. But Can you please help me out with some sample code or links. All I need is how to get the blobs names in Event Gird Trigger Azure Function. Example. you have added Sampletext.doc file into a Storage Container. If it is Blob trigger Azure function, we will get this file details at Run() function. But what if it is a EventGrid Trigger Function. How to access the event triggered file in the code.
0

Instead of Blob Trigger Azure Function, I have used EventGrid Azure Function. Event Grid Azure Function is invoking faster than blob trigger. Also in Event Grid Trigger, we have an option to set the blob events and retry counts.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.