Skip to content

Commit 89bdf95

Browse files
authored
Merge pull request #8214 from MicrosoftDocs/edit-13874
Editing Request 13874
2 parents 259a07b + c9da7c3 commit 89bdf95

File tree

4 files changed

+291
-333
lines changed

4 files changed

+291
-333
lines changed

powerapps-docs/developer/data-platform/auditing/configure.md

Lines changed: 67 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,42 @@
11
---
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
65
ms.topic: overview
7-
author: paulliew # GitHub ID
86
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
1010
search.audienceType:
1111
- developer
1212
contributors:
1313
- JimDaly
1414
- phecke
15+
ms.custom: bap-template
1516
---
1617

1718
# Configure auditing
1819

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.
2421

2522
## Configure organization settings
2623

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.
2825

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.
3027

31-
|Schema Name<br />Logical Name<br />Display Name|Type|Description |
28+
|Schema Name<br/>Logical Name<br/>Display Name|Type|Description|
3229
|---------|---------|---------|
33-
|`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.|
3734

3835
### Retrieve organization settings
3936

40-
You can retrieve these values using the following queries:
37+
Use the following queries to retrieve your organization settings.
4138

42-
# [Web API](#tab/webapi)
39+
#### [Web API](#tab/webapi)
4340

4441
**Request**
4542

@@ -76,12 +73,12 @@ HTTP/1.1 200 OK
7673
}
7774
```
7875

79-
More information:
76+
Learn more about:
8077

81-
- <xref:Microsoft.Dynamics.CRM.organization?text=organization EntityType>
8278
- [Retrieve a table row using the Web API](../webapi/retrieve-entity-using-web-api.md)
79+
- [organization EntityType](xref:Microsoft.Dynamics.CRM.organization)
8380

84-
# [SDK for .NET](#tab/sdk)
81+
#### [SDK for .NET](#tab/sdk)
8582

8683
```csharp
8784
/// <summary>
@@ -115,40 +112,40 @@ static void ShowAuditingConfig(IOrganizationService svc)
115112
}
116113
```
117114

118-
More information:
115+
Learn more about:
119116

120-
- <xref:Microsoft.Xrm.Sdk.IOrganizationService.Execute*?text=IOrganizationService.Execute Method>
121-
- <xref:Microsoft.Crm.Sdk.Messages.WhoAmIRequest?text=WhoAmIRequest Class>
122-
- <xref:Microsoft.Crm.Sdk.Messages.WhoAmIResponse?text=WhoAmIResponse Class>
123-
- <xref:Microsoft.Xrm.Sdk.IOrganizationService.Retrieve*?text=IOrganizationService.Retrieve Method>
117+
- [IOrganizationService.Execute Method](xref:Microsoft.Xrm.Sdk.IOrganizationService.Execute%2A)
118+
- [WhoAmIRequest Class](xref:Microsoft.Crm.Sdk.Messages.WhoAmIRequest)
119+
- [WhoAmIResponse Class](xref:Microsoft.Crm.Sdk.Messages.WhoAmIResponse)
120+
- [IOrganizationService.Retrieve Method](xref:Microsoft.Xrm.Sdk.IOrganizationService.Retrieve%2A)
124121

125122
---
126123

127124
### Change organization settings
128125

129-
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.
130127

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:
132129

133130
- [Update and delete table rows using the Web API](../webapi/update-delete-entities-using-web-api.md)
134131
- [Update and delete table rows using the Organization Service](../org-service/entity-operations-update-delete.md)
135132

136133
## Configure tables and columns
137134

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.
139136

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.
141138

142139
|Item |Web API | SDK for .NET|
143140
|---------|---------|---------|
144-
|Table|<xref:Microsoft.Dynamics.CRM.EntityMetadata>.`IsAuditEnabled`|<xref:Microsoft.Xrm.Sdk.Metadata.EntityMetadata.IsAuditEnabled?text=EntityMetadata.IsAuditEnabled Property>|
145-
|Column|<xref:Microsoft.Dynamics.CRM.AttributeMetadata>.`IsAuditEnabled`|<xref:Microsoft.Xrm.Sdk.Metadata.AttributeMetadata.IsAuditEnabled?text=AttributeMetadata.IsAuditEnabled Property>|
141+
|Table|<xref:Microsoft.Dynamics.CRM.EntityMetadata>.`IsAuditEnabled`|[EntityMetadata.IsAuditEnabled Property](xref:Microsoft.Xrm.Sdk.Metadata.EntityMetadata.IsAuditEnabled)|
142+
|Column|<xref:Microsoft.Dynamics.CRM.AttributeMetadata>.`IsAuditEnabled`|[AttributeMetadata.IsAuditEnabled Property](xref:Microsoft.Xrm.Sdk.Metadata.AttributeMetadata.IsAuditEnabled)|
146143

147-
The `IsAuditEnabled` property is a managed property that is defined by the following types:
144+
The `IsAuditEnabled` property is a managed property that's defined by the following types:
148145

149146
|Web API |SDK for .NET|
150147
|---------|---------|
151-
|<xref:Microsoft.Dynamics.CRM.BooleanManagedProperty?text=BooleanManagedProperty ComplexType>|<xref:Microsoft.Xrm.Sdk.BooleanManagedProperty?text=BooleanManagedProperty Class>|
148+
|[BooleanManagedProperty ComplexType](xref:Microsoft.Dynamics.CRM.BooleanManagedProperty)|[BooleanManagedProperty Class](xref:Microsoft.Xrm.Sdk.BooleanManagedProperty)|
152149

153150
A `BooleanManagedProperty` has two important properties:
154151

@@ -157,18 +154,18 @@ A `BooleanManagedProperty` has two important properties:
157154
|`Value`|Determines whether the setting is enabled.|
158155
|`CanBeChanged` |Determines whether the `Value` setting can be changed after the table or column is included in a managed solution.|
159156

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).
161158

162159
> [!NOTE]
163160
> 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.
164161
165162
### Detect which tables are enabled for auditing
166163

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.
168165

169-
# [Web API](#tab/webapi)
166+
#### [Web API](#tab/webapi)
170167

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.
172169

173170
**Request**
174171

@@ -205,13 +202,13 @@ If-None-Match: null
205202
}
206203
```
207204

208-
More information:
205+
Learn more about:
209206

207+
- [EntityMetadata EntityType](xref:Microsoft.Dynamics.CRM.EntityMetadata)
210208
- [Query table definitions using the Web API](../webapi/query-metadata-web-api.md)
211-
- <xref:Microsoft.Dynamics.CRM.EntityMetadata?text=EntityMetadata EntityType>
212209
- [Private tables](../entities.md#private-tables)
213210

214-
# [SDK for .NET](#tab/sdk)
211+
#### [SDK for .NET](#tab/sdk)
215212

216213
```csharp
217214
/// <summary>
@@ -271,8 +268,7 @@ static void ShowTableAuditConfigurations(IOrganizationService svc)
271268
});
272269
}
273270
```
274-
275-
More information:
271+
Learn more about:
276272

277273
- [Retrieve and detect changes to table definitions](../org-service/metadata-retrieve-detect-changes.md)
278274
- [Private tables](../entities.md#private-tables)
@@ -281,12 +277,9 @@ More information:
281277

282278
### Detect which columns are enabled for auditing
283279

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.
286281

287-
# [Web API](#tab/webapi)
288-
289-
This returns all the columns enabled for auditing for the `account` table.
282+
#### [Web API](#tab/webapi)
290283

291284
**Request**
292285

@@ -323,9 +316,9 @@ If-None-Match: null
323316
}
324317
```
325318

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)
327320

328-
# [SDK for .NET](#tab/sdk)
321+
#### [SDK for .NET](#tab/sdk)
329322

330323
```csharp
331324
/// <summary>
@@ -411,40 +404,35 @@ response.EntityMetadata.ToList().ForEach(x =>
411404
}
412405
```
413406

414-
More information: [Retrieve and detect changes to table definitions](../org-service/metadata-retrieve-detect-changes.md)
407+
Learn more about: [Query schema definitions](../query-schema-definitions.md)
415408

416409
---
417410

418411
## Enable or disable tables and columns for auditing
419412

420-
If you want to change which tables or columns support auditing, you must update the respective `IsAuditEnabled.Value` property.
413+
To change which tables and columns support auditing, update their `IsAuditEnabled.Value` property.
421414

422415
### Tables
423416

424417
|API|Property|More information|
425418
|---------|---------|---------|
426419
|Web API|<xref:Microsoft.Dynamics.CRM.EntityMetadata>.`IsAuditEnabled.Value`|[Update table definitions](../webapi/create-update-entity-definitions-using-web-api.md#update-table-definitions)|
427-
|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)|
428421

429422
### Columns
430423

431424
|API|Property|More information|
432425
|---------|---------|---------|
433426
|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)|
436428

437429
> [!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.
440431
441432
### Publish column changes
442433

443434
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)
448436

449437
**Request**
450438

@@ -467,14 +455,13 @@ If-None-Match: null
467455
HTTP/1.1 204 OK
468456
```
469457

470-
More information:
458+
Learn more about:
471459

472-
- [Use Web API actions](../webapi/use-web-api-actions.md)
473-
- <xref:Microsoft.Dynamics.CRM.PublishXml?text=PublishXml Action>
460+
- [PublishXml Action](xref:Microsoft.Dynamics.CRM.PublishXml)
474461

475-
# [SDK for .NET](#tab/sdk)
462+
#### [SDK for .NET](#tab/sdk)
476463

477-
This example publishes the `account` table.
464+
The following example publishes the `account` table:
478465

479466
```csharp
480467
PublishXmlRequest request = new PublishXmlRequest()
@@ -488,22 +475,24 @@ PublishXmlRequest request = new PublishXmlRequest()
488475
svc.Execute(request);
489476
```
490477

491-
More information:
478+
Learn more about:
492479

493-
- <xref:Microsoft.Xrm.Sdk.IOrganizationService.Execute*?text=IOrganizationService.Execute Method>
494-
- <xref:Microsoft.Crm.Sdk.Messages.PublishXmlRequest?text=PublishXmlRequest Class>
495-
- [Publish customizations](../../model-driven-apps/publish-customizations.md)
496-
- [Publish request schema](../../model-driven-apps/publish-request-schema.md)
480+
- [IOrganizationService.Execute Method](xref:Microsoft.Xrm.Sdk.IOrganizationService.Execute%2A)
481+
- [PublishXmlRequest Class](xref:Microsoft.Crm.Sdk.Messages.PublishXmlRequest)
497482

498483
---
499484

485+
Learn more about:
486+
487+
- [Publish customizations](../../model-driven-apps/publish-customizations.md)
488+
- [Publish request schema](../../model-driven-apps/publish-request-schema.md)
500489

501490
### See also
502491

503-
[Administrators Guide: Manage Dataverse auditing](/power-platform/admin/manage-dataverse-auditing)<br />
504-
[Administrators Guide: System Settings Auditing tab](/power-platform/admin/system-settings-dialog-box-auditing-tab)<br />
505-
[Auditing overview](overview.md)<br />
506-
[Retrieve the history of audited data changes](retrieve-audit-data.md)<br />
492+
[Administrator's guide: Manage Dataverse auditing](/power-platform/admin/manage-dataverse-auditing)
493+
[Administrator's guide: System Settings Auditing tab](/power-platform/admin/system-settings-dialog-box-auditing-tab)
494+
[Auditing overview](overview.md)
495+
[Retrieve the history of audited data changes](retrieve-audit-data.md)
507496
[Delete audit data](delete-audit-data.md)
508497

509-
[!INCLUDE[footer-include](../../../includes/footer-banner.md)]
498+
[!INCLUDE [footer-include](../../../includes/footer-banner.md)]

0 commit comments

Comments
 (0)