Binary Large Object, popularly known as Blob, is more than just a storage platform for a large amount of unstructured data. It has an enthralling feature of triggering an event or service every time a logic equals true.
In this blog, I will cover how seamlessly the Blob Storage and Logic Apps can integrate to trigger a custom action on Azure Blob storage events.
So, what we need for this?
- Azure Blob Storage – having data files in the form of excel sheets.
- Azure Blob Storage Events – an event that gets triggered when any file (in our case excel) gets uploaded or modified in blob storage.
- Azure Logic Apps – will execute the web-service whenever an Azure Blob storage event gets pushed, by its workflow automation.
- Custom action – which should perform when the Azure Blob Storage event triggers. Here let us take the execution of a service hosted on azure to perform specific tasks.
The Azure Blob storage events are essential while managing the events, such as creation, modification, and deletion of records or files in blob storage.
The Azure Logic Apps provides immense methods to automate workflows that integrate data across Azure Services.
Now, let’s proceed with the steps to achieve the entire process of Azure blob storage event using Logic Apps.
Note – Before starting, we assume that you are aware of the steps to create “Resource Group” and “Storage Account” and have already created on your Azure portal.
Step 1: Enable resource provider for the Event Grid
If you have not used “Event Grid" in your Azure subscription before, you may need to register the Event Grid resource provider.
In the Azure portal:
- Select ‘Subscriptions’on the left menu.
- Select the Event Grid subscription you 'd be using.
- In the left-hand menu under Settings, Select Network Providers.
- Now, look for EventGrid
- Select Register if it is not registered.
Registration can take a moment to complete.
Click Refresh for status change. When status gets updated to Registered, you are ready to continue.
Step 2: Subscribe to the Blob Storage
Subscribe to a topic to let the Event Grid know which events you want to track, and where to send them.
- Navigate on the portal to your Azure Storage account that you created earlier. On the left menu, select All resources and select your storage account.
- On the Storage account page, select Events on the left menu.
- Select More Options, and Logic Apps
Step 3: Now create a Logic App
1. In the first step, select the subscription you have, Resource Type and Resource Name
2. In the Event Type Item, choose Microsoft.Storage.BlobCreated. You can add other parameters also.
3. In the next step, perform the action you want when a blog gets created. We took the custom action to call the web service.
One can choose any other action from the available actions in the Logic App.
Now upload the excel in the blob storage, and the event will get triggered, which will run the logic app.
If you are planning to create such customizations, connect with Advaiya to get a consultation from experts.