充当事件网格源的 Azure 应用程序配置Azure App Configuration as an Event Grid source

本文提供 Azure 应用程序配置事件的属性和架构。This article provides the properties and schema for Azure App Configuration events. 有关事件架构的简介,请参阅 Azure 事件网格事件架构For an introduction to event schemas, see Azure Event Grid event schema. 本文还提供了有关将 Azure 应用程序配置用作事件源的快速入门和教程列表。It also gives you a list of quick starts and tutorials to use Azure App Configuration as an event source.

可用事件类型Available event types

Azure 应用程序配置会发出以下事件类型:Azure App Configuration emits the following event types:

事件类型Event type 说明Description
Microsoft.AppConfiguration.KeyValueModifiedMicrosoft.AppConfiguration.KeyValueModified 创建或替换键/值时引发。Raised when a key-value is created or replaced.
Microsoft.AppConfiguration.KeyValueDeletedMicrosoft.AppConfiguration.KeyValueDeleted 删除键/值时引发。Raised when a key-value is deleted.

示例事件Example event

以下示例显示键/值修改事件的架构:The following example shows the schema of a key-value modified event:

[{
  "id": "84e17ea4-66db-4b54-8050-df8f7763f87b",
  "topic": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/microsoft.appconfiguration/configurationstores/contoso",
  "subject": "https://contoso.azconfig.io/kv/Foo?label=FizzBuzz",
  "data": {
    "key": "Foo",
    "label": "FizzBuzz",
    "etag": "FnUExLaj2moIi4tJX9AXn9sakm0"
  },
  "eventType": "Microsoft.AppConfiguration.KeyValueModified",
  "eventTime": "2019-05-31T20:05:03Z",
  "dataVersion": "1",
  "metadataVersion": "1"
}]

键/值删除事件的架构与此类似:The schema for a key-value deleted event is similar:

[{
  "id": "84e17ea4-66db-4b54-8050-df8f7763f87b",
  "topic": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/microsoft.appconfiguration/configurationstores/contoso",
  "subject": "https://contoso.azconfig.io/kv/Foo?label=FizzBuzz",
  "data": {
    "key": "Foo",
    "label": "FizzBuzz",
    "etag": "FnUExLaj2moIi4tJX9AXn9sakm0"
  },
  "eventType": "Microsoft.AppConfiguration.KeyValueDeleted",
  "eventTime": "2019-05-31T20:05:03Z",
  "dataVersion": "1",
  "metadataVersion": "1"
}]

事件属性Event properties

事件具有以下顶级数据:An event has the following top-level data:

属性Property 类型Type 说明Description
topic stringstring 事件源的完整资源路径。Full resource path to the event source. 此字段不可写入。This field isn't writeable. 事件网格提供此值。Event Grid provides this value.
subject stringstring 事件主题的发布者定义路径。Publisher-defined path to the event subject.
eventType stringstring 此事件源的一个注册事件类型。One of the registered event types for this event source.
eventTime stringstring 基于提供程序 UTC 时间的事件生成时间。The time the event is generated based on the provider's UTC time.
id 字符串string 事件的唯一标识符。Unique identifier for the event.
data 对象object 应用配置事件数据。App Configuration event data.
dataVersion stringstring 数据对象的架构版本。The schema version of the data object. 发布者定义架构版本。The publisher defines the schema version.
metadataVersion stringstring 事件元数据的架构版本。The schema version of the event metadata. 事件网格定义顶级属性的架构。Event Grid defines the schema of the top-level properties. 事件网格提供此值。Event Grid provides this value.

数据对象具有以下属性:The data object has the following properties:

属性Property 类型Type 说明Description
key 字符串string 已修改或已删除的键/值的键。The key of the key-value that was modified or deleted.
label 字符串string 已修改或已删除的键/值的标签(如果有)。The label, if any, of the key-value that was modified or deleted.
etag 字符串string 对于 KeyValueModified,为新键/值的 etag。For KeyValueModified the etag of the new key-value. 对于 KeyValueDeleted,为已删除的键/值的 etag。For KeyValueDeleted the etag of the key-value that was deleted.

教程和操作指南Tutorials and how-tos

标题Title 说明Description
使用事件网格响应 Azure 应用程序配置事件React to Azure App Configuration events by using Event Grid 概述 Azure 应用程序配置与事件网格的集成。Overview of integrating Azure App Configuration with Event Grid.
使用事件网格进行数据更改通知Use Event Grid for data change notifications 了解如何设置 Azure 应用程序配置事件订阅,以将键值修改事件发送到 Web 终结点。Learn how to use Azure App Configuration event subscriptions to send key-value modification events to a web endpoint.

后续步骤Next steps