Email notification about new files on Azure File share - azure

What are possible ways to implement such scenario?
I can think of some Azure function which will periodically check the share for new files. Are there any other possibilities.
I have been thinking also about duplicating the files to Blob storage and generate the notifications from there.

Storage content trigger is by default available for blobs. If you look for migrating to blob storage, then you can utilise BlobTrigger Azure function. In case of file trigger in File Share, the below are my suggestions as requested:
A TimerTrigger Azure function that acts as a poll to check for new file in that time frame the previous trigger occured.
Recurrence trigger in logic app to poll and check for new contents.
A continuous WebJob to continuously poll the File Share checking for new contents.
In my opinion, duplicating the files to Blob storage and making your notification work may not be a great option, because such operation once again requires a polling mechanism which can be achieved with options like a few mentioned above, but is still unnecessary.

Related

Azure Event Grid: Find out if a blob is being overwritten

I have wired an EventGridTrigger to Azure Functions and listen on Microsoft.Storage.BlobCreated changes. So far, it seems to be working fine. However, I have observed that multiple events will be triggered for the same blob if the client overwrites it. I need to do some server-side processing only once per blob creation. Is there any metadata available to us to see how many times a blob has been overwritten?
As a workaround, I'm thinking of saving blob URI to a Cosmos container as a primary key to see if it's ever been processed before, but this sounds like overkill for something this trivial.
Here are 3 possible solutions:
Store the blob uri to an Azure Table (same as your sugestion with Cosmos but cheaper)
Turn on blob versioning an check that it is the first version of the blob before processing. Turning on versioning has a cost.
Check the code that updates the blob. Is it possible to us the BlockBlobClient and only update the affected block? Will this avoid BlobCreated being triggered on updated.
I would start with checking if option 3 was possible. If not do option 1.

Azure trigger function for file share

Like we have blob trigger or event trigger for the blob created or deleted in Azure blob storage, I need to have a function which is triggered when a file is uploaded or created in file share.
Blob storage trigger, event grid trigger doesn't work on Azure file share. Can you please suggest on any custom trigger function or any other way to use the trigger functions on file share?
I am making use of timertrigger to check if the files are created in fileshare. So basically, considering the time difference between 2 timer trigger run, I am checking the new files created and performing further operations.
No, your requirement is not possiable.
Azure function don't support file share as the condition of the trigger, you can have a look of this:
https://learn.microsoft.com/en-us/azure/azure-functions/functions-triggers-bindings?tabs=csharp#supported-bindings
Can you please suggest on any custom trigger function or any other way
to use the trigger functions on file share?
As far as I know, it seems didn't have a service to do this. You can do something like this: After you send the data to the file share, hit other api or hit the something like httptrigger to do something.

Using a new azure webjobs storage for the azure function

we have a set of blob trigger functions and we are planning to use a new azure webjobs storage for these azure functions. My question is: since the new storage account doesn't have any track of the already processed file, will the blobs be reprocessed? If yes, can we avoid this reprocessing and in which?
I think you're talking about Blob Receipt feature.
When you're using a new azure webjobs storage for the azure function, it definitely re-process the already processed file. This is by design.
The only way I can think of is that, when using a new azure webjobs storage, you can add a list which contains all the processed files in your function code, and when the code detects the file is already processed, then do nothing with it.

Sending excel file from a Blob Storage to a REST Endpoint in Azure Functions with Node

Working on a small personal project where I can drop an .xlsx file on Azure Blob and it'll trigger( Node.js Blob Storage Trigger fn ) and send to a REST endpoint to be parsed and worked with etc.
I've been able to set it up and have the file be moved to another blob( intend to set up logic on the HTTP response to REST endpoint to then archive said file);
I'm not exactly sure how to set up the correct code and bindings to take the ingested .xlsx file and send the whole thing to an endpoint.
Bonus Question: is it better practice to zip the file or convert to binary or anything before sending? Performance isn't too big of a concern currently.
Thanks for any information or any pointers.
The recommended approach is to use event grid trigger of blob storage to trigger an event grid trigger based Azure function. Please refer these which seems to meet your requirement
Blob Event and Event Grid Trigger For Azure Function.
Note: Using blob trigger of Azure function may not be as reliable as Event Grid trigger for high volume scenario.
To answer to your bonus question, I think it won't be much beneficial to zip your .xlsx files since those are already compressed behind the scene.

How to make code on an Azure VM trigger from storage blob change (like Functions do)

I've got some image processing code that I need to run in Azure. It's perfect for an Azure Function, but unfortunately requires a component with a complex installation procedure and therefore will need to run in a VM.
However, I'd like to make it behave much like an Azure Function, and trigger whenever new items arrive in blob storage.
My question is: Does Azure provide me with any handy way of doing this, or do I have to write code that polls the blob storage looking for new items?
Have a look at Azure WebJobs SDK. It shares API model with Functions, but you can host it in any .NET application. Blob Trigger.

Resources