Edit

configurationDrift: remediate

Namespace: microsoft.graph

Important

APIs under the /beta version in Microsoft Graph are subject to change. Use of these APIs in production applications is not supported. To determine whether an API is available in v1.0, use the Version selector.

Restore all drifted properties of a configurationDrift to their desired values in the baseline.

This action operates synchronously on one resource instance represented by the drift. It returns success if all drifted properties are updated to the values specified in the baseline; otherwise, it returns failure. On success, the drift's status changes to fixed. On failure, it remains active.

Permissions

Choose the permission or permissions marked as least privileged for this API. Use a higher privileged permission or permissions only if your app requires it. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.

Permission type Least privileged permissions Higher privileged permissions
Delegated (work or school account) ConfigurationMonitoring.ReadWrite.All Not available.
Delegated (personal Microsoft account) Not supported. Not supported.
Application Not supported. Not supported.

Remediation supports delegated permissions only. In addition to the calling app's delegated ConfigurationMonitoring.ReadWrite.All permission, the TCM service principal needs delegated permissions for the target workload, and the signed-in user needs the appropriate resource-management role. See Set up permissions for remediation and applyOnce.

HTTP request

POST /admin/configurationManagement/configurationDrifts/{configurationDrift-id}/remediate

Request headers

Name Description
Authorization Bearer {token}. Required. Learn more about authentication and authorization.

Request body

Don't supply a request body for this method.

Response

If successful, this method returns a 200 OK response code and a configurationDriftRemediationResult object in the response body.

A 200 OK response means that a remediation result was returned. Check status to determine whether remediation succeeded or failed. The current preview doesn't return partial results. An already-fixed drift returns 409 Conflict.

Examples

Request

The following example shows a request.

POST https://graph.microsoft.com/beta/admin/configurationManagement/configurationDrifts/33333333-4444-5555-6666-777777777777/remediate

Response

The following example shows the response.

HTTP/1.1 200 OK
Content-Type: application/json

{
  "@odata.type": "#microsoft.graph.configurationDriftRemediationResult",
  "configurationDriftId": "33333333-4444-5555-6666-777777777777",
  "tenantId": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
  "status": "succeeded",
  "resourceType": "microsoft.entra.securitydefaults",
  "baselineResourceDisplayName": "Security defaults",
  "resourceInstanceIdentifier": {
    "IsSingleInstance": "Yes"
  },
  "remediatedProperties": [
    {
      "propertyName": "IsEnabled",
      "previousValue": false,
      "currentValue": true,
      "desiredValue": true
    }
  ],
  "remediationFailedProperties": []
}