Create an event subscription that forwards blob lifecycle event types to the Azure Storage queue.
In this step, you create an event subscription that forwards blob lifecycle event types to the Azure Storage queue. For more information about creating event subscriptions, see the Azure Event Grid Documentation: Subscribe to events through portal
- On the overview page for the Event Grid system topic that you created in the last step, select + Event Subscription.
- On the Basics tab, fill in the Event Subscription Details: Name and Event Schema (select Event Grid Schema).
- Review the Topic Details section and confirm that these values are correctly auto populated: Topic Type is set to Storage account, Source Resource is set to the name of your storage account, and Topic Name is set to the name of the Event Grid system topic you created in the previous step.
- Under Event Types, select the Filter to Event Types drop-down field and choose the Azure blob lifecycle events you want to subscribe to. At a minimum, select Blob Created and Blob Deleted.
- Under Event Details, set Endpoint Type to Storage Queue and ensure that Cross-tenant delivery is Disabled.
- Select Configure an endpoint.
- In the Queues panel, set Storage account to the name of your storage account and Queue to the name of the Azure storage queue you created in Create an Azure Storage queue. Choose Select.
- Restrict events to blobs that match the location of your dataset. Go to the Filters tab, select Enable subject filtering, and put a file path in Subject begins with that follows this pattern: /blobServices/default/containers/container-name/blobs/directory-prefix
For example, say you have a Microsoft Azure dataset in this location: https://myAzureAccount.blob.core.windows.net/myAzureContainer/warehouse/partitioned/raw-parquet/
In this case, put this file path in Subject begins with: /blobServices/default/containers/myAzureContainer/blobs/warehouse/partitioned/raw-parquet/
- Select Create.