After creating a resource group in Azure (to target), you can head on over to "Event Subscriptions" in the menu bar.
Click on the "+ Event Subscription" button, and you will follow the form to create an event subscription for a target Azure Resource Group.
A couple of notes:
- The name has to be subscription unique, so you might want to be fairly descriptive here
- There are 7 default event types (all the events you can do with a resource) and they are generic in nature. Remember that an event will be created for all of them, so pick carefully not to overload any downstream systems
- Prefix could be used to narrow this down to only the specific event types you want to target.
Based on the RequestBin output, the event grid service calls out to the target url (the subscriber endpoint above) with a POST call. The body of the POST is essentially the same as what you would see in the activity log for that event.
Of course, the endpoint could have just as easily been an Azure function or an Automation runbook.
In conclusion, the goal of this post was to tap into Azure Resource Group events via Azure Event Grid, a new service currently in preview. We walked through a basic setup and passed our event directly to RequestBin. Happy event tapping!
No comments:
Post a Comment