How to restrict and alert the user when they upload a file size of greater than xx MB's on ADLS Gen2 account

manigandan 0 Reputation points
2025-03-11T13:36:15.9166667+00:00

Hello Team

I'm working on couple of requests:

  • I wanted to restrict and alert the user when they are trying to upload a file of given threshold size. (Say > 50MB)
  • I wanted to restrict and alert the user when they are trying to upload a file of irrelevant extension types (which is not whitelisted from the team)

We are using MS Storage Explorer with the SAS token to upload the files to the ADLS containers.

I've searched multiple articles and forums for any workaround. I couldn't get any, could someone help here. Your help is much appreciated.

Azure Data Lake Storage
Azure Data Lake Storage
An Azure service that provides an enterprise-wide hyper-scale repository for big data analytic workloads and is integrated with Azure Blob Storage.
1,547 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Alex Burlachenko 1,755 Reputation points
    2025-03-11T14:04:37.61+00:00

    Hi,

    U can use Azure Event Grid and Azure Functions

    Set up an Event Grid subscription for the Blob Created event on your ADLS Gen2 account. This will trigger whenever a file is uploaded. Refer to the Event Grid documentation. Create an Azure Function to process the event. The function will check the file size using the Content-Length property.

    If the file exceeds the threshold (e.g., 50MB), send an alert (e.g., via email using Logic Apps or an alerting service) and optionally delete the file. Refer to the Azure Functions documentation.

    Best regards, Alex p.s. If you found the answer helpful, please click on Upvote and Accept Answer. This will help other community members.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.