Espacio de nombres: microsoft.graph.networkaccess
Importante
Las API de la versión /beta de Microsoft Graph están sujetas a cambios. No se admite el uso de estas API en aplicaciones de producción. Para determinar si una API está disponible en la versión 1.0, use el selector de Versión.
Actualizar las propiedades de un objeto threatIntelligencePolicy .
Esta API está disponible en las siguientes implementaciones en la nube nacional.
| Servicio global |
Administración pública de EE. UU. |
Gobierno de EE. UU. L5 (DOD) |
China operado por 21Vianet |
| ✅ |
❌ |
❌ |
❌ |
Permissions
Elija el permiso o los permisos marcados como con privilegios mínimos para esta API. Use uno o varios permisos con privilegios más altos solo si la aplicación lo requiere. Para obtener más información sobre los permisos delegados y de aplicación, consulte Tipos de permisos. Para obtener más información sobre estos permisos, consulte la referencia de permisos.
| Tipo de permiso |
Permisos con privilegios mínimos |
Permisos con privilegios más altos |
| Delegado (cuenta profesional o educativa) |
NetworkAccess.ReadWrite.All |
No disponible. |
| Delegado (cuenta personal de Microsoft) |
No admitida. |
No admitida. |
| Aplicación |
NetworkAccess.ReadWrite.All |
No disponible. |
Importante
Para el acceso delegado con cuentas profesionales o educativas, el usuario que ha iniciado sesión debe tener asignado un rol compatible de Microsoft Entra o un rol personalizado que conceda los permisos necesarios para esta operación. Esta operación admite los siguientes roles integrados, que proporcionan solo el privilegio mínimo necesario:
- Administrador de acceso seguro global
- Administrador de seguridad
Solicitud HTTP
PATCH /networkAccess/threatIntelligencePolicies/{threatIntelligencePolicyId}
| Nombre |
Descripción |
| Authorization |
{token} de portador. Obligatorio. Obtenga más información sobre autenticación y autorización. |
| Content-Type |
application/json. Obligatorio. |
Cuerpo de la solicitud
En el cuerpo de la solicitud, proporcione solo los valores de las propiedades que se van a actualizar. Las propiedades existentes que no están incluidas en el cuerpo de la solicitud mantienen sus valores anteriores o se recalculan en función de los cambios realizados en otros valores de propiedad.
En la tabla siguiente se especifican las propiedades que se pueden actualizar.
Respuesta
Si se ejecuta correctamente, este método devuelve un código de respuesta 204 No Content.
Ejemplos
Solicitud
En el ejemplo siguiente se muestra la solicitud.
PATCH https://graph.microsoft.com/beta/networkAccess/threatIntelligencePolicies/{threatIntelligencePolicyId}
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.networkaccess.threatIntelligencePolicy",
"id": "a8352c78-90c6-4edd-aaca-9dc4292e7750",
"name": "Threat Intel Policy",
"description": "",
"version": "1.0.0",
"lastModifiedDateTime": "2025-06-18T17:34:25.8207682Z",
"settings": {
"defaultAction": "allow"
}
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models.Networkaccess;
var requestBody = new ThreatIntelligencePolicy
{
OdataType = "#microsoft.graph.networkaccess.threatIntelligencePolicy",
Id = "a8352c78-90c6-4edd-aaca-9dc4292e7750",
Name = "Threat Intel Policy",
Description = "",
Version = "1.0.0",
LastModifiedDateTime = DateTimeOffset.Parse("2025-06-18T17:34:25.8207682Z"),
Settings = new ThreatIntelligencePolicySettings
{
DefaultAction = ThreatIntelligenceAction.Allow,
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.NetworkAccess.ThreatIntelligencePolicies["{threatIntelligencePolicy-id}"].PatchAsync(requestBody);
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
"time"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphmodelsnetworkaccess "github.com/microsoftgraph/msgraph-beta-sdk-go/models/networkaccess"
//other-imports
)
requestBody := graphmodelsnetworkaccess.NewThreatIntelligencePolicy()
id := "a8352c78-90c6-4edd-aaca-9dc4292e7750"
requestBody.SetId(&id)
name := "Threat Intel Policy"
requestBody.SetName(&name)
description := ""
requestBody.SetDescription(&description)
version := "1.0.0"
requestBody.SetVersion(&version)
lastModifiedDateTime , err := time.Parse(time.RFC3339, "2025-06-18T17:34:25.8207682Z")
requestBody.SetLastModifiedDateTime(&lastModifiedDateTime)
settings := graphmodelsnetworkaccess.NewThreatIntelligencePolicySettings()
defaultAction := graphmodels.ALLOW_THREATINTELLIGENCEACTION
settings.SetDefaultAction(&defaultAction)
requestBody.SetSettings(settings)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
threatIntelligencePolicies, err := graphClient.NetworkAccess().ThreatIntelligencePolicies().ByThreatIntelligencePolicyId("threatIntelligencePolicy-id").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.ThreatIntelligencePolicy threatIntelligencePolicy = new com.microsoft.graph.beta.models.networkaccess.ThreatIntelligencePolicy();
threatIntelligencePolicy.setOdataType("#microsoft.graph.networkaccess.threatIntelligencePolicy");
threatIntelligencePolicy.setId("a8352c78-90c6-4edd-aaca-9dc4292e7750");
threatIntelligencePolicy.setName("Threat Intel Policy");
threatIntelligencePolicy.setDescription("");
threatIntelligencePolicy.setVersion("1.0.0");
OffsetDateTime lastModifiedDateTime = OffsetDateTime.parse("2025-06-18T17:34:25.8207682Z");
threatIntelligencePolicy.setLastModifiedDateTime(lastModifiedDateTime);
com.microsoft.graph.beta.models.networkaccess.ThreatIntelligencePolicySettings settings = new com.microsoft.graph.beta.models.networkaccess.ThreatIntelligencePolicySettings();
settings.setDefaultAction(com.microsoft.graph.beta.models.networkaccess.ThreatIntelligenceAction.Allow);
threatIntelligencePolicy.setSettings(settings);
com.microsoft.graph.models.networkaccess.ThreatIntelligencePolicy result = graphClient.networkAccess().threatIntelligencePolicies().byThreatIntelligencePolicyId("{threatIntelligencePolicy-id}").patch(threatIntelligencePolicy);
const options = {
authProvider,
};
const client = Client.init(options);
const threatIntelligencePolicy = {
'@odata.type': '#microsoft.graph.networkaccess.threatIntelligencePolicy',
id: 'a8352c78-90c6-4edd-aaca-9dc4292e7750',
name: 'Threat Intel Policy',
description: '',
version: '1.0.0',
lastModifiedDateTime: '2025-06-18T17:34:25.8207682Z',
settings: {
defaultAction: 'allow'
}
};
await client.api('/networkAccess/threatIntelligencePolicies/{threatIntelligencePolicyId}')
.version('beta')
.update(threatIntelligencePolicy);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\Networkaccess\ThreatIntelligencePolicy;
use Microsoft\Graph\Beta\Generated\Models\Networkaccess\ThreatIntelligencePolicySettings;
use Microsoft\Graph\Beta\Generated\Models\Networkaccess\ThreatIntelligenceAction;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new ThreatIntelligencePolicy();
$requestBody->setOdataType('#microsoft.graph.networkaccess.threatIntelligencePolicy');
$requestBody->setId('a8352c78-90c6-4edd-aaca-9dc4292e7750');
$requestBody->setName('Threat Intel Policy');
$requestBody->setDescription('');
$requestBody->setVersion('1.0.0');
$requestBody->setLastModifiedDateTime(new \DateTime('2025-06-18T17:34:25.8207682Z'));
$settings = new ThreatIntelligencePolicySettings();
$settings->setDefaultAction(new ThreatIntelligenceAction('allow'));
$requestBody->setSettings($settings);
$result = $graphServiceClient->networkAccess()->threatIntelligencePolicies()->byThreatIntelligencePolicyId('threatIntelligencePolicy-id')->patch($requestBody)->wait();
Import-Module Microsoft.Graph.Beta.NetworkAccess
$params = @{
"@odata.type" = "#microsoft.graph.networkaccess.threatIntelligencePolicy"
id = "a8352c78-90c6-4edd-aaca-9dc4292e7750"
name = "Threat Intel Policy"
description = ""
version = "1.0.0"
lastModifiedDateTime = [System.DateTime]::Parse("2025-06-18T17:34:25.8207682Z")
settings = @{
defaultAction = "allow"
}
}
Update-MgBetaNetworkAccessThreatIntelligencePolicy -ThreatIntelligencePolicyId $threatIntelligencePolicyId -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.threat_intelligence_policy import ThreatIntelligencePolicy
from msgraph_beta.generated.models.networkaccess.threat_intelligence_policy_settings import ThreatIntelligencePolicySettings
from msgraph_beta.generated.models.threat_intelligence_action import ThreatIntelligenceAction
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = ThreatIntelligencePolicy(
odata_type = "#microsoft.graph.networkaccess.threatIntelligencePolicy",
id = "a8352c78-90c6-4edd-aaca-9dc4292e7750",
name = "Threat Intel Policy",
description = "",
version = "1.0.0",
last_modified_date_time = "2025-06-18T17:34:25.8207682Z",
settings = ThreatIntelligencePolicySettings(
default_action = ThreatIntelligenceAction.Allow,
),
)
result = await graph_client.network_access.threat_intelligence_policies.by_threat_intelligence_policy_id('threatIntelligencePolicy-id').patch(request_body)
Respuesta
En el ejemplo siguiente se muestra la respuesta.
HTTP/1.1 204 No Content