HowTo — Subscribe event ( blob-created/deleted) in logic app
LogicApp is all about the cost associated with every action, polling is one such thing.For example execute a logic app when the blob is added to blob storage every three minutes.
This polling will execute every three minutes throughout the year and even after that, there could be a potential three minutes delay in processing messages.
We should try to make an interface event-based. This is a real-time and more cost-effective way.
Following are high-level steps I will not go into details:
- Create storage account [ StAcc1 ]and blob container [ BlobC1 ]
2. Create UserAssigned Managed identity [ USMId_01 ]
3. Assign owner rights to a storage account for USMId_01
4. Create LogicApp- assign and assign USMId_01
5. Create Event Grid System Topic EGSTStAcc1
6. LogicApp add trigger When resource event occurs —
7. Connect LogicApp to Event using ManagedIndentity: USMId_01
SubscriptionName should be unique.
8. Once the logic app is enabled in step3 you will have an entry for the same in EGSTStAcc1.
Now, whenever you create a blob logic app will be triggered provided it matches prefix and suffix filter.