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: powerapps-docs/developer/data-platform/auditing/configure.md
+67-78Lines changed: 67 additions & 78 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,45 +1,42 @@
1
1
---
2
-
title: "Configure auditing (Microsoft Dataverse) | Microsoft Docs"# Intent and product brand in a unique string of 43-59 chars including spaces
3
-
description: "Explains how to configure programatically configure auditing settins for the organization, tables and columns."# 115-145 characters including spaces. This abstract displays in the search result.
4
-
ms.date: 06/13/2022
5
-
ms.reviewer: jdaly
2
+
title: Configure auditing
3
+
description: Learn how to programmatically configure auditing settings for the organization, tables, and columns in Microsoft Dataverse.
4
+
ms.date: 06/02/2023
6
5
ms.topic: overview
7
-
author: paulliew # GitHub ID
8
6
ms.subservice: dataverse-developer
9
-
ms.author: paulliew # MSFT alias of Microsoft employees only
7
+
author: paulliew
8
+
ms.author: paulliew
9
+
ms.reviewer: jdaly
10
10
search.audienceType:
11
11
- developer
12
12
contributors:
13
13
- JimDaly
14
14
- phecke
15
+
ms.custom: bap-template
15
16
---
16
17
17
18
# Configure auditing
18
19
19
-
Auditing uses settings in the [Organization table](../reference/entities/organization.md) and definitions of individual tables and columns to determine what kind of audit history data to capture.
20
-
21
-
Anyone can read this configuration data, but you must have the System Administrator or System Customizer roles to change these settings.
22
-
23
-
Changes made to audit configuration are included in the auditing history. More information: [Audit change events](retrieve-audit-data.md#audit-change-events)
20
+
Microsoft Dataverse auditing uses settings in the [Organization table](../reference/entities/organization.md) and definitions of individual tables and columns to determine what kind of audit history data to capture. Anyone can view the configuration, but you must have the System Administrator or System Customizer role to change the settings. [Changes made to the audit configuration](retrieve-audit-data.md#audit-change-events) are included in the audit history.
24
21
25
22
## Configure organization settings
26
23
27
-
Four properties in the [Organization table](../reference/entities/organization.md) control how auditing is enabled for an environment. The `organization` table contains a single row. The `organizationid` column is the primary key. You can get the key value by querying the row directly or you may already have it cached by previously executing the `WhoAmI` message. The `WhoAmIResponse.OrganizationId` property returns the primary key value for the single row in the `organization` table.
24
+
Four properties in the [Organization table](../reference/entities/organization.md) control how auditing is enabled for an environment. The organization table contains a single row. The `organizationid` column is the primary key. Query the row directly to get the key value, or execute the `WhoAmI` message and take the value of the `WhoAmIResponse.OrganizationId` property.
28
25
29
-
The following table describes the `organization` table columns that control auditing behavior.
26
+
The following table describes the organization table columns that control auditing behavior.
|`IsAuditEnabled`<br/>`isauditenabled`<br/>**Is Auditing Enabled**|Boolean|Whether auditing is enabled for the environment.|
34
-
|`AuditRetentionPeriodV2`<br/>`auditretentionperiodv2`<br/>**Audit Retention Period Settings**|Integer|The number of days to retain audit log records.<br/>The default value is 30. Valid values are between 1 and 365,000 days (~1000 years) or if the value is set to -1, the records will be retained forever.<br />More information: [Microsoft Power Platform admin: Start/stop auditing and set retention policy](/power-platform/admin/manage-dataverse-auditing#startstop-auditing-for-a-dataverse-environment-and-set-retention-policy)|
35
-
|`IsUserAccessAuditEnabled`<br/>`isuseraccessauditenabled`<br/>**Is User Access Auditing Enabled**|Boolean|Whether user access logging is enabled.<br/>Auditing for the environment must also be enabled for user access logging to be enabled.|
36
-
|`UserAccessAuditingInterval`<br/>`useraccessauditinginterval`<br/>**User Authentication Auditing Interval**|Integer|The interval how often user access is logged in hours. Default value is 4.|
30
+
|`IsAuditEnabled`<br/>`isauditenabled`<br/>**Is Auditing Enabled**|Boolean|Whether auditing is enabled for the environment|
31
+
|`AuditRetentionPeriodV2`<br/>`auditretentionperiodv2`<br/>**Audit Retention Period Settings**|Integer|The number of days to retain audit log records<br/>The default value is 30. Valid values are between 1 and 365,000 days (~1,000 years). If the value is set to -1, the records are retained forever.<br/>[Administrator's guide: Start/stop auditing and set retention policy](/power-platform/admin/manage-dataverse-auditing#startstop-auditing-for-a-dataverse-environment-and-set-retention-policy)|
32
+
|`IsUserAccessAuditEnabled`<br/>`isuseraccessauditenabled`<br/>**Is User Access Auditing Enabled**|Boolean|Whether user access logging is enabled<br/>Auditing for the environment must be enabled for user access logging to be enabled.|
33
+
|`UserAccessAuditingInterval`<br/>`useraccessauditinginterval`<br/>**User Authentication Auditing Interval**|Integer|How often user access is logged, in hours<br/>The default value is 4.|
37
34
38
35
### Retrieve organization settings
39
36
40
-
You can retrieve these values using the following queries:
37
+
Use the following queries to retrieve your organization settings.
Update the column properties in the table above to change how auditing works for the environment. You must have the System Administrator or System Customizer roles to change these settings.
126
+
Change the column values in the organization table to change how auditing works for the environment. You must have the System Administrator or System Customizer role to change these settings.
130
127
131
-
You can set these column values using Web API or Dataverse SDK for .NET. More information:
128
+
You can use Web API or Dataverse SDK for .NET to change your organization settings:
132
129
133
130
-[Update and delete table rows using the Web API](../webapi/update-delete-entities-using-web-api.md)
134
131
-[Update and delete table rows using the Organization Service](../org-service/entity-operations-update-delete.md)
135
132
136
133
## Configure tables and columns
137
134
138
-
When auditing is configured for the organization, any tables configured for auditing will write auditing data for all of the columns that are enabled for auditing. The primary control is at the organization and then table level.
135
+
When auditing is enabled for the organization, any tables that are enabled for auditing write audit data for all columns that are enabled for auditing. The primary control is at the organization and then the table level.
139
136
140
-
Tables and columns each have a *managed property* named `IsAuditEnabled` that controls whether they are enabled for auditing.
137
+
Tables and columns each have a *managed property* named `IsAuditEnabled` that controls whether they're enabled for auditing.
A `BooleanManagedProperty` has two important properties:
154
151
@@ -157,18 +154,18 @@ A `BooleanManagedProperty` has two important properties:
157
154
|`Value`|Determines whether the setting is enabled.|
158
155
|`CanBeChanged`|Determines whether the `Value` setting can be changed after the table or column is included in a managed solution.|
159
156
160
-
The publisher of the solution that adds a table may block people who install their managed solution from enabling auditing. Some Dataverse system tables cannot be enabled or disabled for auditing because the `CanBeChanged` property is set to `false`. More information: [Managed properties](/power-platform/alm/managed-properties-alm)
157
+
The publisher of a managed solution that adds a table may prevent people who install the solution from enabling auditing. Some Dataverse system tables can't be enabled or disabled for auditing because the `CanBeChanged` property is set to `false`. [Learn more about managed properties](/power-platform/alm/managed-properties-alm).
161
158
162
159
> [!NOTE]
163
160
> The `IsAuditEnabled` property is exposed in the designer as a simple boolean property with the label **Audit changes to its data** for tables or **Enable auditing** for columns. The `CanBeChanged` property can only be read or set programmatically.
164
161
165
162
### Detect which tables are enabled for auditing
166
163
167
-
Query the table definitions to detect which tables currently support auditing and which ones can be changed by looking at the `IsAuditEnabled` property.
164
+
Query the table definitions and look at the `IsAuditEnabled` property to determine which tables support auditing and which ones can be changed.
168
165
169
-
# [Web API](#tab/webapi)
166
+
####[Web API](#tab/webapi)
170
167
171
-
This query returns the `Logicalname` for all public tables that are enabled for auditing:
168
+
This query returns the `Logicalname` for all public tables that are enabled for auditing.
-[Retrieve and detect changes to table definitions](../org-service/metadata-retrieve-detect-changes.md)
278
274
-[Private tables](../entities.md#private-tables)
@@ -281,12 +277,9 @@ More information:
281
277
282
278
### Detect which columns are enabled for auditing
283
279
284
-
Query the column definitions to detect which table columns currently support auditing and which ones can be changed by looking at the `IsAuditEnabled` property.
285
-
280
+
Query the column definitions and look at the `IsAuditEnabled` property to determine which columns support auditing and which ones can be changed.
286
281
287
-
# [Web API](#tab/webapi)
288
-
289
-
This returns all the columns enabled for auditing for the `account` table.
282
+
#### [Web API](#tab/webapi)
290
283
291
284
**Request**
292
285
@@ -323,9 +316,9 @@ If-None-Match: null
323
316
}
324
317
```
325
318
326
-
More information: [Query table definitions using the Web API](../webapi/query-metadata-web-api.md)
319
+
Learn more about: [Query table definitions using the Web API](../webapi/query-metadata-web-api.md)
|SDK for .NET|<xref:Microsoft.Xrm.Sdk.Metadata.EntityMetadata.IsAuditEnabled?text=EntityMetadata.IsAuditEnabled>.`Value`|[Retrieve and update a table](../org-service/metadata-retrieve-update-delete-entities.md#retrieve-and-update-a-table)|
420
+
|SDK for .NET|[EntityMetadata.IsAuditEnabled](xref:Microsoft.Xrm.Sdk.Metadata.EntityMetadata.IsAuditEnabled).`Value`|[Retrieve and update a table](../org-service/metadata-retrieve-update-delete-entities.md#retrieve-and-update-a-table)|
428
421
429
422
### Columns
430
423
431
424
|API|Property|More information|
432
425
|---------|---------|---------|
433
426
|Web API|<xref:Microsoft.Dynamics.CRM.AttributeMetadata>.`IsAuditEnabled.Value`|[Update a column](../webapi/create-update-entity-definitions-using-web-api.md#update-a-column)|
434
-
|SDK for .NET|<xref:Microsoft.Xrm.Sdk.Metadata.AttributeMetadata.IsAuditEnabled?text=AttributeMetadata.IsAuditEnabled>.`Value`|[Update a column](../org-service/metadata-attributemetadata.md#update-a-column)|
435
-
427
+
|SDK for .NET|[AttributeMetadata.IsAuditEnabled](xref:Microsoft.Xrm.Sdk.Metadata.AttributeMetadata.IsAuditEnabled).`Value`|[Update a column](../org-service/metadata-attributemetadata.md#update-a-column)|
436
428
437
429
> [!IMPORTANT]
438
-
> After you change the value for columns you must publish customizations for the table.
439
-
> Changes will not take effect until the table customizations are published.
430
+
> Changes don't take effect until you publish the table customizations.
440
431
441
432
### Publish column changes
442
433
443
434
Use the `PublishXml` message to publish customizations for the table.
444
-
445
-
# [Web API](#tab/webapi)
446
-
447
-
This example publishes the `account` table.
435
+
#### [Web API](#tab/webapi)
448
436
449
437
**Request**
450
438
@@ -467,14 +455,13 @@ If-None-Match: null
467
455
HTTP/1.1 204 OK
468
456
```
469
457
470
-
More information:
458
+
Learn more about:
471
459
472
-
-[Use Web API actions](../webapi/use-web-api-actions.md)
0 commit comments