This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can trysigning in orchanging directories.
Access to this page requires authorization. You can trychanging directories.
Event Grid is a fully managed service that enables you to easily manage events across many different Azure services and applications. It simplifies building event-driven and serverless applications. For an overview of the service, seeEvent Grid overview.
If you don't have an Azure account, create afree account before you begin.
When you're finished, you see that the event data is sent to the web app.

Sign in toAzure portal.
To create a Blob storage, selectCreate a resource.
In theSearch, enterStorage account, and selectStorage account from the result list.

On theStorage account page, selectCreate to start creating the storage account. To subscribe to events, create either a general-purpose v2 storage account or a Blob storage account.
On theCreate storage account page, do the following steps:
Select your Azure subscription.
ForResource group, create a new resource group or select an existing one.
Enter thename for your storage account.
Select theRegion in which you want the storage account to be created.
ForPrimary service, selectAzure Blob Storage or Azure Data Lake Storage Gen 2.
ForRedundancy, selectLocally-redundant storage (LRS) from the drop-down list.
SelectReview + create at the bottom of the page.

On theReview + create tab, review the settings, and selectCreate.
Note
Only storage accounts of kindStorageV2 (general purpose v2) andBlobStorage support event integration.Storage (general purpose v1) doesnot support integration with Event Grid.
The deployment takes a few minutes to complete. On theDeployment page, selectGo to resource.

On theStorage account page, selectEvents on the left menu.
Keep this page in the web browser open.
Before subscribing to the events for the Blob storage, let's create the endpoint for the event message. Typically, the endpoint takes actions based on the event data. To simplify this quickstart, you deploy aprebuilt web app that displays the event messages. The deployed solution includes an App Service plan, an App Service web app, and source code from GitHub.
SelectDeploy to Azure to deploy the solution to your subscription.
On theCustom deployment page, do the following steps:
ForResource group, select the resource group that you created when creating the storage account. It will be easier for you to clean up after you're done with the tutorial by deleting the resource group.
ForSite Name, enter a name for the web app.
ForHosting plan name, enter a name for the App Service plan to use for hosting the web app.
SelectReview + create.

On theReview + create page, selectCreate.
The deployment takes a few minutes to complete. On theDeployment page, selectGo to resource group.

On theResource group page, in the list of resources, select the web app that you created. You also see the App Service plan and the storage account in this list.
On theApp Service page for your web app, select the URL to navigate to the web site. The URL should be in this format:https://<your-site-name>.azurewebsites.net.

Confirm that you see the site but no events are posted to it yet.

Important
Keep the Azure Event Grid Viewer window open so that you can see events as they are posted.
You subscribe to a topic to tell Event Grid which events you want to track, and where to send the events.
If you closed theStorage account page, navigate to your Azure Storage account that you created earlier. On the left menu, selectAll resources and select your storage account.
On theStorage account page, selectEvents on the left menu.
SelectMore Options, andWeb Hook. You're sending events to your viewer app using a web hook for the endpoint.
On theCreate Event Subscription page, do the following steps:
Enter aname for the event subscription.
Enter aname for thesystem topic. To learn about system topics, seeOverview of system topics.
Confirm thatEndpoint type is set toWeb Hook.

ForEndpoint, selectConfigure an endpoint, and enter the URL of your web app and addapi/updates to the home page URL (for example:https://spegridsite.azurewebsites.net/api/updates), and then selectConfirm Selection.
Now, on theCreate Event Subscription page, selectCreate to create the event subscription.

View your web app again, and notice that a subscription validation event is sent to it. Select the eye icon to expand the event data. Event Grid sends the validation event so the endpoint can verify that it wants to receive event data. The web app includes code to validate the subscription.

Now, let's trigger an event to see how Event Grid distributes the message to your endpoint.
You trigger an event for the Blob storage by uploading a file. The file doesn't need any specific content.
In the Azure portal, navigate to your Blob storage account, and selectContainers on the let menu.
Select+ Container. Give your container a name, and use any access level, and selectCreate.
Select your new container.
To upload a file, selectUpload. On theUpload blob page, browse and select a file that you want to upload for testing, and then selectUpload on that page.
Browse to your test file and upload it.
You triggered the event, and Event Grid sent the message to the endpoint you configured when subscribing. The message is in the JSON format and it contains an array with one or more events. In the following example, the JSON message contains an array with one event. View your web app and notice that ablob created event was received.

If you plan to continue working with this event, don't clean up the resources created in this article. Otherwise, delete the resources you created in this article.
Select the resource group, and selectDelete resource group.
Now that you know how to create custom topics and event subscriptions, learn more about what Event Grid can help you do:
Was this page helpful?
Need help with this topic?
Want to try using Ask Learn to clarify or guide you through this topic?
Was this page helpful?
Want to try using Ask Learn to clarify or guide you through this topic?