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.
Update the properties of a Microsoft Entra health monitoring alertConfiguration object. You can use alertConfiguration settings to specify the distribution groups where alert notifications are to be sent.
This API doesn't currently support group validation.
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)
HealthMonitoringAlertConfig.ReadWrite.All
Not available.
Delegated (personal Microsoft account)
Not supported.
Not supported.
Application
Not supported.
Not supported.
Important
In addition to the delegated permissions, the signed-in user needs to belong to a Microsoft Entra role that allows them to update alert configurations. The following least privileged roles are supported for this operation.
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.
Email notification settings for the particular alert type. Currently, only one email notification configuration is supported for an alert configuration, meaning just one group will receive notifications for an alert type.
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models.HealthMonitoring;
var requestBody = new AlertConfiguration
{
EmailNotificationConfigurations = new List<EmailNotificationConfiguration>
{
new EmailNotificationConfiguration
{
GroupId = "c5140914-9507-4180-b60c-04d5ec5eddcb",
IsEnabled = true,
},
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Reports.HealthMonitoring.AlertConfigurations["{alertConfiguration-id}"].PatchAsync(requestBody);
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphmodelshealthmonitoring "github.com/microsoftgraph/msgraph-beta-sdk-go/models/healthmonitoring"
//other-imports
)
requestBody := graphmodelshealthmonitoring.NewAlertConfiguration()
emailNotificationConfiguration := graphmodelshealthmonitoring.NewEmailNotificationConfiguration()
groupId := "c5140914-9507-4180-b60c-04d5ec5eddcb"
emailNotificationConfiguration.SetGroupId(&groupId)
isEnabled := true
emailNotificationConfiguration.SetIsEnabled(&isEnabled)
emailNotificationConfigurations := []graphmodelshealthmonitoring.EmailNotificationConfigurationable {
emailNotificationConfiguration,
}
requestBody.SetEmailNotificationConfigurations(emailNotificationConfigurations)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
alertConfigurations, err := graphClient.Reports().HealthMonitoring().AlertConfigurations().ByAlertConfigurationId("alertConfiguration-id").Patch(context.Background(), requestBody, nil)
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
com.microsoft.graph.beta.models.healthmonitoring.AlertConfiguration alertConfiguration = new com.microsoft.graph.beta.models.healthmonitoring.AlertConfiguration();
LinkedList<com.microsoft.graph.beta.models.healthmonitoring.EmailNotificationConfiguration> emailNotificationConfigurations = new LinkedList<com.microsoft.graph.beta.models.healthmonitoring.EmailNotificationConfiguration>();
com.microsoft.graph.beta.models.healthmonitoring.EmailNotificationConfiguration emailNotificationConfiguration = new com.microsoft.graph.beta.models.healthmonitoring.EmailNotificationConfiguration();
emailNotificationConfiguration.setGroupId("c5140914-9507-4180-b60c-04d5ec5eddcb");
emailNotificationConfiguration.setIsEnabled(true);
emailNotificationConfigurations.add(emailNotificationConfiguration);
alertConfiguration.setEmailNotificationConfigurations(emailNotificationConfigurations);
com.microsoft.graph.models.healthmonitoring.AlertConfiguration result = graphClient.reports().healthMonitoring().alertConfigurations().byAlertConfigurationId("{alertConfiguration-id}").patch(alertConfiguration);
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\HealthMonitoring\AlertConfiguration;
use Microsoft\Graph\Beta\Generated\Models\HealthMonitoring\EmailNotificationConfiguration;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new AlertConfiguration();
$emailNotificationConfigurationsEmailNotificationConfiguration1 = new EmailNotificationConfiguration();
$emailNotificationConfigurationsEmailNotificationConfiguration1->setGroupId('c5140914-9507-4180-b60c-04d5ec5eddcb');
$emailNotificationConfigurationsEmailNotificationConfiguration1->setIsEnabled(true);
$emailNotificationConfigurationsArray []= $emailNotificationConfigurationsEmailNotificationConfiguration1;
$requestBody->setEmailNotificationConfigurations($emailNotificationConfigurationsArray);
$result = $graphServiceClient->reports()->healthMonitoring()->alertConfigurations()->byAlertConfigurationId('alertConfiguration-id')->patch($requestBody)->wait();
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.models.health_monitoring.alert_configuration import AlertConfiguration
from msgraph_beta.generated.models.health_monitoring.email_notification_configuration import EmailNotificationConfiguration
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = AlertConfiguration(
email_notification_configurations = [
EmailNotificationConfiguration(
group_id = "c5140914-9507-4180-b60c-04d5ec5eddcb",
is_enabled = True,
),
],
)
result = await graph_client.reports.health_monitoring.alert_configurations.by_alert_configuration_id('alertConfiguration-id').patch(request_body)
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.