Namespace: microsoft.graph.networkaccess
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.
Update the conditional access settings to include the preservation of the original source IP address in network traffic for accurate identification and tracking, as well as the establishment of scalable network connectivity through the Global Secure Access services.
This API is available in the following national cloud deployments.
Global service |
US Government L4 |
US Government L5 (DOD) |
China operated by 21Vianet |
✅ |
❌ |
❌ |
❌ |
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) |
NetworkAccess.ReadWrite.All |
Not available. |
Delegated (personal Microsoft account) |
Not supported. |
Not supported. |
Application |
NetworkAccess.ReadWrite.All |
Not available. |
Important
In delegated scenarios with work or school accounts, the signed-in user must be assigned a supported Microsoft Entra role or a custom role with a supported role permission. The following least privileged roles are supported for this operation.
- Global Secure Access Administrator
- Security Administrator
HTTP request
PATCH /networkAccess/settings/conditionalAccess
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 |
signalingStatus |
microsoft.graph.networkaccess.status |
The current status of the conditional access settings, including the preservation of the original source IP address in network traffic for accurate identification and tracking, as well as the establishment of scalable network connectivity through the Global Secure Access services. The possible values are: enabled , disabled . Required. |
Response
If successful, this method returns a 204 No Content
response code.
Examples
Request
The following example shows a request.
PATCH https://graph.microsoft.com/beta/networkAccess/settings/conditionalAccess
Content-Type: application/json
{
"@odata.context": "https://graph.microsoft.com/beta/networkAccess/settings/$metadata#conditionalAccess",
"signalingStatus": "disabled"
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models.Networkaccess;
var requestBody = new ConditionalAccessSettings
{
SignalingStatus = Status.Disabled,
AdditionalData = new Dictionary<string, object>
{
{
"@odata.context" , "https://graph.microsoft.com/beta/networkAccess/settings/$metadata#conditionalAccess"
},
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.NetworkAccess.Settings.ConditionalAccess.PatchAsync(requestBody);
mgc-beta network-access settings conditional-access patch --body '{\
"@odata.context": "https://graph.microsoft.com/beta/networkAccess/settings/$metadata#conditionalAccess",\
"signalingStatus": "disabled"\
}\
'
// 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"
graphmodelsnetworkaccess "github.com/microsoftgraph/msgraph-beta-sdk-go/models/networkaccess"
//other-imports
)
requestBody := graphmodelsnetworkaccess.NewConditionalAccessSettings()
signalingStatus := graphmodels.DISABLED_STATUS
requestBody.SetSignalingStatus(&signalingStatus)
additionalData := map[string]interface{}{
"@odata.context" : "https://graph.microsoft.com/beta/networkAccess/settings/$metadata#conditionalAccess",
}
requestBody.SetAdditionalData(additionalData)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
conditionalAccess, err := graphClient.NetworkAccess().Settings().ConditionalAccess().Patch(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
com.microsoft.graph.beta.models.networkaccess.ConditionalAccessSettings conditionalAccessSettings = new com.microsoft.graph.beta.models.networkaccess.ConditionalAccessSettings();
conditionalAccessSettings.setSignalingStatus(com.microsoft.graph.beta.models.networkaccess.Status.Disabled);
HashMap<String, Object> additionalData = new HashMap<String, Object>();
additionalData.put("@odata.context", "https://graph.microsoft.com/beta/networkAccess/settings/$metadata#conditionalAccess");
conditionalAccessSettings.setAdditionalData(additionalData);
com.microsoft.graph.models.networkaccess.ConditionalAccessSettings result = graphClient.networkAccess().settings().conditionalAccess().patch(conditionalAccessSettings);
const options = {
authProvider,
};
const client = Client.init(options);
const conditionalAccessSettings = {
'@odata.context': 'https://graph.microsoft.com/beta/networkAccess/settings/$metadata#conditionalAccess',
signalingStatus: 'disabled'
};
await client.api('/networkAccess/settings/conditionalAccess')
.version('beta')
.update(conditionalAccessSettings);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\Networkaccess\ConditionalAccessSettings;
use Microsoft\Graph\Beta\Generated\Models\Networkaccess\Status;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new ConditionalAccessSettings();
$requestBody->setSignalingStatus(new Status('disabled'));
$additionalData = [
'@odata.context' => 'https://graph.microsoft.com/beta/networkAccess/settings/$metadata#conditionalAccess',
];
$requestBody->setAdditionalData($additionalData);
$result = $graphServiceClient->networkAccess()->settings()->conditionalAccess()->patch($requestBody)->wait();
Import-Module Microsoft.Graph.Beta.NetworkAccess
$params = @{
"@odata.context" = "https://graph.microsoft.com/beta/networkAccess/settings/$metadata#conditionalAccess"
signalingStatus = "disabled"
}
Update-MgBetaNetworkAccessSettingConditionalAccess -BodyParameter $params
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.models.networkaccess.conditional_access_settings import ConditionalAccessSettings
from msgraph_beta.generated.models.status import Status
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = ConditionalAccessSettings(
signaling_status = Status.Disabled,
additional_data = {
"@odata_context" : "https://graph.microsoft.com/beta/networkAccess/settings/$metadata#conditionalAccess",
}
)
result = await graph_client.network_access.settings.conditional_access.patch(request_body)
Response
The following example shows the response.
HTTP/1.1 204 No Content