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
Copy file name to clipboardExpand all lines: articles/event-grid/event-schema-policy.md
+5-154Lines changed: 5 additions & 154 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,10 @@
1
1
---
2
2
title: Azure Policy as an Event Grid source
3
-
description: This article describes how to use Azure Policy as an Event Grid event source. It provides the schema and links to tutorial and how-to articles.
3
+
description: This article describes how to use Azure Policy as an Event Grid event source. It provides the schema and links to tutorial and how-to articles.
4
4
ms.topic: conceptual
5
-
author: DCtheGeek
6
-
ms.author: dacoulte
7
-
ms.date: 09/15/2021
5
+
author: timwarner-msft
6
+
ms.author: timwarner
7
+
ms.date: 07/12/2022
8
8
---
9
9
10
10
# Azure Policy as an Event Grid source
@@ -14,156 +14,7 @@ events. For an introduction to event schemas, see
14
14
[Azure Event Grid event schema](./event-schema.md). It also gives you a list of quick starts and
15
15
tutorials to use Azure Policy as an event source.
16
16
17
-
## Available event types
18
-
19
-
Azure Policy emits the following event types:
20
-
21
-
| Event type | Description |
22
-
| ---------- | ----------- |
23
-
| Microsoft.PolicyInsights.PolicyStateCreated | Raised when a policy compliance state is created. |
24
-
| Microsoft.PolicyInsights.PolicyStateChanged | Raised when a policy compliance state is changed. |
25
-
| Microsoft.PolicyInsights.PolicyStateDeleted | Raised when a policy compliance state is deleted. |
|`topic`| string | Full resource path to the event source. This field isn't writeable. Event Grid provides this value. |
132
-
|`subject`| string | The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions/<SubscriptionID>/resourceGroups/<ResourceGroup>/providers/<ProviderNamespace>/<ResourceType>/<ResourceName>`|
133
-
|`eventType`| string | One of the registered event types for this event source. |
134
-
|`eventTime`| string | The time the event is generated based on the provider's UTC time. |
135
-
|`id`| string | Unique identifier for the event. |
136
-
|`data`| object | Azure Policy event data. |
137
-
|`dataVersion`| string | The schema version of the data object. The publisher defines the schema version. |
138
-
|`metadataVersion`| string | The schema version of the event metadata. Event Grid defines the schema of the top-level properties. Event Grid provides this value. |
139
-
140
-
# [Cloud event schema](#tab/cloud-event-schema)
141
-
142
-
An event has the following top-level data:
143
-
144
-
| Property | Type | Description |
145
-
| -------- | ---- | ----------- |
146
-
|`source`| string | Full resource path to the event source. This field isn't writeable. Event Grid provides this value. |
147
-
|`subject`| string | The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions/<SubscriptionID>/resourceGroups/<ResourceGroup>/providers/<ProviderNamespace>/<ResourceType>/<ResourceName>`|
148
-
|`type`| string | One of the registered event types for this event source. |
149
-
|`time`| string | The time the event is generated based on the provider's UTC time. |
150
-
|`id`| string | Unique identifier for the event. |
|`timestamp`| string | The time (in UTC) that the resource was scanned by Azure Policy. For ordering events, use this property instead of the top-level `eventTime` or `time` properties. |
161
-
|`policyAssignmentId`| string | The resource ID of the policy assignment. |
162
-
|`policyDefinitionId`| string | The resource ID of the policy definition. |
163
-
|`policyDefinitionReferenceId`| string | The reference ID for the policy definition inside the initiative definition, if the policy assignment is for an initiative. May be empty. |
164
-
|`complianceState`| string | The compliance state of the resource with respect to the policy assignment. |
165
-
|`subscriptionId`| string | The subscription ID of the resource. |
166
-
|`complianceReasonCode`| string | The compliance reason code. May be empty. |
Copy file name to clipboardExpand all lines: articles/governance/policy/concepts/event-overview.md
+5-62Lines changed: 5 additions & 62 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,10 @@
1
1
---
2
2
title: Reacting to Azure Policy state change events
3
-
description: Use Azure Event Grid to subscribe to App Policy events, which allow applications to react to state changes without the need for complicated code.
4
-
ms.date: 08/17/2021
3
+
description: Use Azure Event Grid to subscribe to Azure Policy events, which allow applications to react to state changes without the need for complicated code.
4
+
ms.date: 07/12/2022
5
5
ms.topic: conceptual
6
+
ms.author: timwarner
7
+
author: timwarner-msft
6
8
---
7
9
# Reacting to Azure Policy state change events
8
10
@@ -32,66 +34,7 @@ for a full tutorial.
32
34
33
35
:::image type="content" source="../../../event-grid/media/overview/functional-model.png" alt-text="Event Grid model of sources and handlers" lightbox="../../../event-grid/media/overview/functional-model-big.png":::
34
36
35
-
## Available Azure Policy events
36
-
37
-
Event Grid uses [event subscriptions](../../../event-grid/concepts.md#event-subscriptions) to route
38
-
event messages to subscribers. Azure Policy event subscriptions can include three types of events:
39
-
40
-
| Event type | Description |
41
-
| ---------- | ----------- |
42
-
| Microsoft.PolicyInsights.PolicyStateCreated | Raised when a policy compliance state is created. |
43
-
| Microsoft.PolicyInsights.PolicyStateChanged | Raised when a policy compliance state is changed. |
44
-
| Microsoft.PolicyInsights.PolicyStateDeleted | Raised when a policy compliance state is deleted. |
45
-
46
-
## Event schema
47
-
48
-
Azure Policy events contain all the information you need to respond to changes in your data. You can
49
-
identify an Azure Policy event when the `eventType` property starts with "Microsoft.PolicyInsights".
50
-
Additional information about the usage of Event Grid event properties is documented in
|`id`| string | Unique identifier for the event. |
56
-
|`topic`| string | Full resource path to the event source. This field isn't writeable. Event Grid provides this value. |
57
-
|`subject`| string | The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions/<SubscriptionID>/resourceGroups/<ResourceGroup>/providers/<ProviderNamespace>/<ResourceType>/<ResourceName>`|
58
-
|`data`| object | Azure Policy event data. |
59
-
|`data.timestamp`| string | The time (in UTC) that the resource was scanned by Azure Policy. For ordering events, use this property instead of the top level `eventTime` or `time` properties. |
60
-
|`data.policyAssignmentId`| string | The resource ID of the policy assignment. |
61
-
|`data.policyDefinitionId`| string | The resource ID of the policy definition. |
62
-
|`data.policyDefinitionReferenceId`| string | The reference ID for the policy definition inside the initiative definition, if the policy assignment is for an initiative. May be empty. |
63
-
|`data.complianceState`| string | The compliance state of the resource with respect to the policy assignment. |
64
-
|`data.subscriptionId`| string | The subscription ID of the resource. |
65
-
|`data.complianceReasonCode`| string | The compliance reason code. May be empty. |
66
-
|`eventType`| string | One of the registered event types for this event source. |
67
-
|`eventTime`| string | The time the event is generated based on the provider's UTC time. |
68
-
|`dataVersion`| string | The schema version of the data object. The publisher defines the schema version. |
69
-
|`metadataVersion`| string | The schema version of the event metadata. Event Grid defines the schema of the top-level properties. Event Grid provides this value. |
0 commit comments