Edit

Share via


Update configurationMonitor

Namespace: microsoft.graph

Update the properties of a configurationMonitor object, including the monitor name, description, and baseline.

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 ConfigurationMonitoring.ReadWrite.All Not available.

HTTP request

PATCH /admin/configurationManagement/configurationMonitors/{configurationMonitorId}

Request headers

Name Description
Authorization Bearer {token}. Required. Learn more about authentication and authorization.
Content-Type application/json. Required.

Request body

In the request body, supply only the values for properties to update. Existing properties that aren't included in the request body maintain their previous values or are recalculated based on changes to other property values.

The following table specifies the properties that can be updated.

Property Type Description
baseline configurationBaseline This relationship defines details of at least one resource and one property associated with the resource to be monitored. When updating the baseline, you must provide the full baseline object. Optional.
description String User-friendly description of the monitor given by the user. Optional.
displayName String User-friendly name given by the user to the monitor. Optional.
parameters openComplexDictionaryType Key-value pairs that contain the values of parameters which might be used in the baseline. Optional.
status monitorStatus Status of the monitor. The possible values are: active, inactive, unknownFutureValue. Optional.

Response

If successful, this method returns a 204 No Content response code.

Examples

Example 1: Update the displayName of a configurationMonitor

The following example shows how to update the displayName property of a configurationMonitor object.

Request

The following example shows a request.

PATCH https://graph.microsoft.com/v1.0/admin/configurationManagement/configurationMonitors/b86049ce-0180-404e-803a-5616d49290d7
Content-Type: application/json

{
  "displayName": "Demo Monitor Name Change"
}

Response

The following example shows the response.

HTTP/1.1 204 No Content

Example 2: Update the baseline of a configurationMonitor

The following example shows how to update the baseline property of a configurationMonitor object. You must supply the full baseline object.

Request

The following example shows a request.

PATCH https://graph.microsoft.com/v1.0/admin/configurationManagement/configurationMonitors/b86049ce-0180-404e-803a-5616d49290d7
Content-Type: application/json

{
  "displayName": "Demo Monitor",
  "description": "This is a Demo Monitor",
  "baseline": {
    "displayName": "Demo Baseline",
    "description": "This is a baseline with SharedMailbox, AcceptedDomain and MailContact",
    "parameters": [
      {
        "displayName": "FQDN",
        "description": "The Fully Qualified Domain Name of the Tenant",
        "parameterType": "String"
      }
    ],
    "resources": [
      {
        "displayName": "TestSharedMailbox Resource",
        "resourceType": "microsoft.exchange.sharedmailbox",
        "properties": {
          "DisplayName": "TestSharedMailbox",
          "Identity": "TestSharedMailbox",
          "Ensure": "Present",
          "PrimarySmtpAddress": "[concat('testSharedMailbox', parameters('FQDN'))]",
          "EmailAddresses": [
            "abc@contoso.onmicrosoft.com",
            "[concat('testSharedMailbox@', parameters('FQDN'))]"
          ]
        }
      },
      {
        "displayName": "Accepted Domain",
        "resourceType": "microsoft.exchange.accepteddomain",
        "properties": {
          "Identity": "contoso.onmicrosoft.com",
          "DomainType": "InternalRelay",
          "Ensure": "Present"
        }
      },
      {
        "displayName": "Mail Contact Resource",
        "resourceType": "microsoft.exchange.mailcontact",
        "properties": {
          "Name": "Chris",
          "DisplayName": "Chris",
          "ExternalEmailAddress": "SMTP:chris@fabrikam.com",
          "Alias": "Chrisa",
          "Ensure": "Present"
        }
      }
    ]
  },
  "parameters": {
    "FQDN": "contoso.onmicrosoft.com"
  }
}

Response

The following example shows the response.

HTTP/1.1 204 No Content