You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
description: Use Azure Event Grid to subscribe to App Configuration events, which allow applications to react to changes in key-values without the need for complicated code.
4
4
services: azure-app-configuration,event-grid
5
5
author: jimmyca
6
-
6
+
ms.custom: devdivchpfy22
7
7
ms.author: jimmyca
8
-
ms.date: 02/20/2020
8
+
ms.date: 08/30/2022
9
9
ms.topic: article
10
10
ms.service: azure-app-configuration
11
11
12
12
---
13
13
14
14
# Reacting to Azure App Configuration events
15
15
16
-
Azure App Configuration events enable applications to react to changes in key-values. This is done without the need for complicated code or expensive and inefficient polling services. Instead, events are pushed through [Azure Event Grid](https://azure.microsoft.com/services/event-grid/) to subscribers such as [Azure Functions](https://azure.microsoft.com/services/functions/), [Azure Logic Apps](https://azure.microsoft.com/services/logic-apps/), or even to your own custom http listener. Critically, you only pay for what you use.
16
+
Azure App Configuration events enable applications to react to changes in key-values. This is done without the need for complicated code or expensive and inefficient polling services. Instead, events are pushed through [Azure Event Grid](https://azure.microsoft.com/services/event-grid/) to subscribers, such as [Azure Functions](https://azure.microsoft.com/services/functions/), [Azure Logic Apps](https://azure.microsoft.com/services/logic-apps/), or even to your own custom HTTP listener. Critically, you only pay for what you use.
17
17
18
-
Azure App Configuration events are sent to the Azure Event Grid, which provides reliable delivery services to your applications through rich retry policies and dead-letter delivery. To learn more, see [Event Grid message delivery and retry](../event-grid/delivery-and-retry.md).
18
+
Azure App Configuration events are sent to the Azure Event Grid, which provides reliable delivery services to your applications through rich retry policies and dead-letter delivery. For more information, see [Event Grid message delivery and retry](../event-grid/delivery-and-retry.md).
19
19
20
20
Common App Configuration event scenarios include refreshing application configuration, triggering deployments, or any configuration-oriented workflow. When changes are infrequent, but your scenario requires immediate responsiveness, event-based architecture can be especially efficient.
21
21
22
-
Take a look at [Use Event Grid for data change notifications](./howto-app-configuration-event.md) for a quick example.
22
+
Take a look at [Use Event Grid for data change notifications](./howto-app-configuration-event.md) for a quick example.
:::image type="content" source="./media/event-grid-functional-model.png" alt-text="Diagram that shows Event Grid Model.":::
25
25
26
26
## Available Azure App Configuration events
27
-
Event grid uses [event subscriptions](../event-grid/concepts.md#event-subscriptions) to route event messages to subscribers. Azure App Configuration event subscriptions can include two types of events:
27
+
28
+
Event Grid uses [event subscriptions](../event-grid/concepts.md#event-subscriptions) to route event messages to subscribers. Azure App Configuration event subscriptions can include two types of events:
28
29
29
30
> |Event Name|Description|
30
31
> |----------|-----------|
31
-
> |`Microsoft.AppConfiguration.KeyValueModified`|Fired when a key-value is created or replaced|
32
-
> |`Microsoft.AppConfiguration.KeyValueDeleted`|Fired when a key-value is deleted|
32
+
> |`Microsoft.AppConfiguration.KeyValueModified`|Fired when a key-value is created or replaced.|
33
+
> |`Microsoft.AppConfiguration.KeyValueDeleted`|Fired when a key-value is deleted.|
33
34
34
35
## Event schema
35
-
Azure App Configuration events contain all the information you need to respond to changes in your data. You can identify an App Configuration event because the eventType property starts with "Microsoft.AppConfiguration". Additional information about the usage of Event Grid event properties is documented in [Event Grid event schema](../event-grid/event-schema.md).
36
+
37
+
Azure App Configuration events contain all the information you need to respond to changes in your data. You can identify an App Configuration event because the `eventType` property starts with `Microsoft.AppConfiguration`. Additional information about the usage of Event Grid event properties is documented in the [Event Grid event schema](../event-grid/event-schema.md).
> |topic|string|Full Azure Resource Manager id of the App Configuration that emits the event.|
40
-
> |subject|string|The URI of the key-value that is the subject of the event.|
41
-
> |eventTime|string|The date/time that the event was generated, in ISO 8601 format.|
42
-
> |eventType|string|"Microsoft.AppConfiguration.KeyValueModified" or "Microsoft.AppConfiguration.KeyValueDeleted".|
41
+
> |topic|string|Full Azure Resource Manager ID of the App Configuration that emits the event.|
42
+
> |subject|string|The URI of the key-value that's the subject of the event.|
43
+
> |eventTime|string|The date/time that the event was generated in ISO 8601 format.|
44
+
> |eventType|string|`Microsoft.AppConfiguration.KeyValueModified` or `Microsoft.AppConfiguration.KeyValueDeleted`.|
43
45
> |Id|string|A unique identifier of this event.|
44
46
> |dataVersion|string|The schema version of the data object.|
45
47
> |metadataVersion|string|The schema version of top-level properties.|
46
-
> |data|object|Collection of Azure App Configuration specific event data|
48
+
> |data|object|Collection of Azure App Configuration specific event data.|
47
49
> |data.key|string|The key of the key-value that was modified or deleted.|
48
50
> |data.label|string|The label, if any, of the key-value that was modified or deleted.|
49
-
> |data.etag|string|For `KeyValueModified` the etag of the new key-value. For `KeyValueDeleted` the etag of the key-value that was deleted.|
51
+
> |data.etag|string|For `KeyValueModified`, the etag of the new key-value. For `KeyValueDeleted`, the etag of the key-value that was deleted.|
52
+
53
+
Here's an example of a `KeyValueModified` event:
50
54
51
-
Here is an example of a KeyValueModified event:
52
55
```json
53
56
[{
54
57
"id": "84e17ea4-66db-4b54-8050-df8f7763f87b",
@@ -70,18 +73,21 @@ Here is an example of a KeyValueModified event:
70
73
For more information, see [Azure App Configuration events schema](../event-grid/event-schema-app-configuration.md).
71
74
72
75
## Practices for consuming events
76
+
73
77
Applications that handle App Configuration events should follow these recommended practices:
74
78
> [!div class="checklist"]
75
-
> * Multiple subscriptions can be configured to route events to the same event handler, so do not assume events are from a particular source. Instead, check the topic of the message to ensure the App Configuration instance sending the event.
76
-
> * Check the eventType and do not assume that all events you receive will be the types you expect.
77
-
> * Use the etag fields to understand if your information about objects is still up-to-date.
79
+
> * Multiple subscriptions can be configured to route events to the same event handler, so don't assume events are from a particular source. Instead, check the topic of the message to ensure that the App Configuration instance is sending the event.
80
+
> * Check the `eventType`, and don't assume that all events you receive will be the types you expect.
81
+
> * Use the `etag` fields to understand if your information about objects is still up-to-date.
78
82
> * Use the sequencer fields to understand the order of events on any particular object.
79
83
> * Use the subject field to access the key-value that was modified.
80
84
81
-
82
85
## Next steps
83
86
84
-
Learn more about Event Grid and give Azure App Configuration events a try:
87
+
To learn more about Event Grid and to give Azure App Configuration events a try, see:
88
+
89
+
> [!div class="nextstepaction"]
90
+
> [About Event Grid](../event-grid/overview.md)
85
91
86
-
-[About Event Grid](../event-grid/overview.md)
87
-
-[How to use Event Grid for data change notifications](./howto-app-configuration-event.md)
92
+
> [!div class="nextstepaction"]
93
+
>[How to use Event Grid for data change notifications](./howto-app-configuration-event.md)
0 commit comments