Skip to content

Commit 3298df0

Browse files
Implement feedback
1 parent af206fe commit 3298df0

File tree

2 files changed

+31
-81
lines changed

2 files changed

+31
-81
lines changed

articles/event-grid/event-schema-policy.md

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -16,51 +16,6 @@ tutorials to use Azure Policy as an event source.
1616

1717
[!INCLUDE [policy-events.md](../../includes/policy/policy-events.md)]
1818

19-
## Event properties
20-
21-
# [Event Grid event schema](#tab/event-grid-event-schema)
22-
23-
An event has the following top-level data:
24-
25-
| Property | Type | Description |
26-
| -------- | ---- | ----------- |
27-
| `topic` | string | Full resource path to the event source. This field isn't writeable. Event Grid provides this value. |
28-
| `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>` |
29-
| `eventType` | string | One of the registered event types for this event source. |
30-
| `eventTime` | string | The time the event is generated based on the provider's UTC time. |
31-
| `id` | string | Unique identifier for the event. |
32-
| `data` | object | Azure Policy event data. |
33-
| `dataVersion` | string | The schema version of the data object. The publisher defines the schema version. |
34-
| `metadataVersion` | string | The schema version of the event metadata. Event Grid defines the schema of the top-level properties. Event Grid provides this value. |
35-
36-
# [Cloud event schema](#tab/cloud-event-schema)
37-
38-
An event has the following top-level data:
39-
40-
| Property | Type | Description |
41-
| -------- | ---- | ----------- |
42-
| `source` | string | Full resource path to the event source. This field isn't writeable. Event Grid provides this value. |
43-
| `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>` |
44-
| `type` | string | One of the registered event types for this event source. |
45-
| `time` | string | The time the event is generated based on the provider's UTC time. |
46-
| `id` | string | Unique identifier for the event. |
47-
| `data` | object | Azure Policy event data. |
48-
| `specversion` | string | CloudEvents schema specification version. |
49-
50-
---
51-
52-
The data object has the following properties:
53-
54-
| Property | Type | Description |
55-
| -------- | ---- | ----------- |
56-
| `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. |
57-
| `policyAssignmentId` | string | The resource ID of the policy assignment. |
58-
| `policyDefinitionId` | string | The resource ID of the policy definition. |
59-
| `policyDefinitionReferenceId` | string | The reference ID for the policy definition inside the initiative definition, if the policy assignment is for an initiative. May be empty. |
60-
| `complianceState` | string | The compliance state of the resource with respect to the policy assignment. |
61-
| `subscriptionId` | string | The subscription ID of the resource. |
62-
| `complianceReasonCode` | string | The compliance reason code. May be empty. |
63-
6419
## Next steps
6520

6621
- For a walkthrough routing Azure Policy state change events, see

includes/policy/policy-events.md

Lines changed: 31 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -17,55 +17,50 @@ Azure Policy emits the following event types:
1717
| Microsoft.PolicyInsights.PolicyStateChanged | Raised when a policy compliance state is changed. |
1818
| Microsoft.PolicyInsights.PolicyStateDeleted | Raised when a policy compliance state is deleted. |
1919

20-
## Event schema
20+
## Event properties
2121

22-
Azure Policy events contain all the information you need to respond to changes in your data. You can
23-
identify an Azure Policy event when the `eventType` property starts with "Microsoft.PolicyInsights".
24-
Additional information about the usage of Event Grid event properties is documented in
25-
[Event Grid event schema](../../articles/event-grid/event-schema.md).
22+
# [Event Grid event schema](#tab/event-grid-event-schema)
23+
24+
An event has the following top-level data:
2625

2726
| Property | Type | Description |
2827
| -------- | ---- | ----------- |
29-
| `id` | string | Unique identifier for the event. |
3028
| `topic` | string | Full resource path to the event source. This field isn't writeable. Event Grid provides this value. |
3129
| `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>` |
32-
| `data` | object | Azure Policy event data. |
33-
| `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. |
34-
| `data.policyAssignmentId` | string | The resource ID of the policy assignment. |
35-
| `data.policyDefinitionId` | string | The resource ID of the policy definition. |
36-
| `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. |
37-
| `data.complianceState` | string | The compliance state of the resource with respect to the policy assignment. |
38-
| `data.subscriptionId` | string | The subscription ID of the resource. |
39-
| `data.complianceReasonCode` | string | The compliance reason code. May be empty. |
4030
| `eventType` | string | One of the registered event types for this event source. |
4131
| `eventTime` | string | The time the event is generated based on the provider's UTC time. |
32+
| `id` | string | Unique identifier for the event. |
33+
| `data` | object | Azure Policy event data. |
4234
| `dataVersion` | string | The schema version of the data object. The publisher defines the schema version. |
4335
| `metadataVersion` | string | The schema version of the event metadata. Event Grid defines the schema of the top-level properties. Event Grid provides this value. |
4436

45-
Here's an example of a policy state change event:
37+
# [Cloud event schema](#tab/cloud-event-schema)
4638

47-
```json
48-
[{
49-
"id": "5829794FCB5075FCF585476619577B5A5A30E52C84842CBD4E2AD73996714C4C",
50-
"topic": "/subscriptions/<SubscriptionID>",
51-
"subject": "/subscriptions/<SubscriptionID>/resourceGroups/<ResourceGroup>/providers/<ProviderNamespace>/<ResourceType>/<ResourceName>",
52-
"data": {
53-
"timestamp": "2021-03-27T18:37:42.4496956Z",
54-
"policyAssignmentId": "<policy-assignment-scope>/providers/microsoft.authorization/policyassignments/<policy-assignment-name>",
55-
"policyDefinitionId": "<policy-definition-scope>/providers/microsoft.authorization/policydefinitions/<policy-definition-name>",
56-
"policyDefinitionReferenceId": "",
57-
"complianceState": "NonCompliant",
58-
"subscriptionId": "<subscription-id>",
59-
"complianceReasonCode": ""
60-
},
61-
"eventType": "Microsoft.PolicyInsights.PolicyStateChanged",
62-
"eventTime": "2021-03-27T18:37:42.5241536Z",
63-
"dataVersion": "1",
64-
"metadataVersion": "1"
65-
}]
66-
```
39+
An event has the following top-level data:
6740

68-
For more information, see [Azure Policy events schema](../../articles/event-grid/event-schema-policy.md).
41+
| Property | Type | Description |
42+
| -------- | ---- | ----------- |
43+
| `source` | string | Full resource path to the event source. This field isn't writeable. Event Grid provides this value. |
44+
| `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>` |
45+
| `type` | string | One of the registered event types for this event source. |
46+
| `time` | string | The time the event is generated based on the provider's UTC time. |
47+
| `id` | string | Unique identifier for the event. |
48+
| `data` | object | Azure Policy event data. |
49+
| `specversion` | string | CloudEvents schema specification version. |
50+
51+
---
52+
53+
The data object has the following properties:
54+
55+
| Property | Type | Description |
56+
| -------- | ---- | ----------- |
57+
| `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. |
58+
| `policyAssignmentId` | string | The resource ID of the policy assignment. |
59+
| `policyDefinitionId` | string | The resource ID of the policy definition. |
60+
| `policyDefinitionReferenceId` | string | The reference ID for the policy definition inside the initiative definition, if the policy assignment is for an initiative. May be empty. |
61+
| `complianceState` | string | The compliance state of the resource with respect to the policy assignment. |
62+
| `subscriptionId` | string | The subscription ID of the resource. |
63+
| `complianceReasonCode` | string | The compliance reason code. May be empty. |
6964

7065
## Example event
7166

0 commit comments

Comments
 (0)