上QQ阅读APP看书,第一时间看更新
Creating an event subscription
The idea here is to leverage two Azure services that allow you to implement a complete solution without writing a single line of code. To do so, follow these instructions:
- The gateway to automation in your resource group can be found in the Events blade, which can be found in every resource group:
Figure 2.16: Creating an event subscription
Once you get there, we can start implementing our automation workflow.
- When you click on the + Event Subscription button, you will see a new screen where you will be able to enter all the required details for a new event subscription. Here, you can find an example of my settings:
Figure 2.17: Creating an event subscription form
You will have to configure the following fields in order to add an event subscription:
-
- Name: A unique name for a subscription.
- Event Schema: A selected event schema supported by Azure Event Grid. Unfortunately, this topic will not be covered in this book (if you are an advanced Azure user, you can use any schema you want) – this is why I suggest you leave the default option as-is. If you are interested in the other schema, you can refer to the following link regarding the Event Grid schema: https://docs.microsoft.com/en-us/azure/event-grid/event-schema.
- EVENT TYPES: You can subscribe to all nine types or only the specific ones. Note that a resource group defines the same event types as a subscription – the difference is in the scope as here, only events from a specific resource group will be handled.
- ENDPOINT DETAILS: You can choose between Web Hook, Storage Queue, Event Hub, and Hybrid Connection. This example is limited to Storage Queues, but feel free to experiment on your own.
A Storage Queue has to be configured before a subscription is created, so make sure you have an available Storage Account with the desired queue already created.
- Once you are satisfied with your choices, you can click on the Create button. After a few seconds, a new subscription will become available for the resource group:
Figure 2.18: Event subscriptions view
The preceding view will show you the current status of the created subscription. It contains information regarding all the generated events (regardless of whether they succeeded or not). To understand the actual behavior, we will have to analyze the data.