This article is a solution idea. If you'd like us to expand the content with more information, such as potential use cases, alternative services, implementation considerations, or pricing guidance, let us know by providing GitHub feedback.
This article describes how to use Azure Event Grid to connect data sources and event handlers. The solution triggers a serverless function to run image analysis when a new photo enters an Azure Blob Storage container.
Download an SVG of this architecture.
- A user uploads a photo to a Blob storage container.
- Blob Storage publishes storage object events to Event Grid.
- Event Grid triggers an Azure Function, based on the event criteria that the Function subscribed.
- The function retrieves the photo and runs the image process on it (such as to shrink an image). Then it saves the new image to another Blob storage container.
The core design concept uses Event Grid to connect data sources and event handlers. Event Grid decouples event publishers from event subscribers by using a pub/sub model and a simple HTTP-based event delivery. This process allows the system to build scalable serverless applications.
Potential use cases
This solution idea publishes Blob Storage events by using Azure Event Grid. Then Azure Functions receives the event with built-in Event Grid support and processes the data in Blob Storage. Developers only need to focus on implementing the business logic in Azure Functions using this solution. Event Grid provides a reliable near-real-time notifications system for the event-driven integration between Blob Storage and Azure Functions. For example, Event Grid instantly triggers a serverless function to run an image process (such as to shrink an image), whenever someone adds a new photo to a Blob Storage container.
This article is maintained by Microsoft. It was originally written by the following contributors.
- Herman Wu | Senior Software Engineer
To see non-public LinkedIn profiles, sign in to LinkedIn.
Learn more about the component technologies:
Explore related architectures: