Namespace: microsoft.graph.networkaccess
Update the properties of an externalCertificateAuthorityCertificate object. This can be used by a GSA admin to upload the generated certificate for GSA. The certificate is generated by signing the downloaded CSR with the customer's PKI.
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/tls/externalCertificateAuthorityCertificates/{externalCertificateAuthorityCertificateId}
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 |
| certificate |
String |
The signed X.509 certificate in PEM format. The certificate should be base64 encoded. |
| chain |
String |
The certificate chain in PEM format, containing all intermediate certificates up to the root CA. The certificate should be base64 encoded. |
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/tls/externalCertificateAuthorityCertificates/365da4f6-6194-401d-b787-b09815be36e3
Content-Type: application/json
{
"certificate": "-----BEGIN CERTIFICATE-----\nMIIBIjANBgkqh...",
"chain": "-----BEGIN CERTIFICATE-----\nMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AM..."
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models.Networkaccess;
var requestBody = new ExternalCertificateAuthorityCertificate
{
Certificate = "-----BEGIN CERTIFICATE-----\nMIIBIjANBgkqh...",
Chain = "-----BEGIN CERTIFICATE-----\nMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AM...",
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.NetworkAccess.Tls.ExternalCertificateAuthorityCertificates["{externalCertificateAuthorityCertificate-id}"].PatchAsync(requestBody);
// 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.NewExternalCertificateAuthorityCertificate()
certificate := "-----BEGIN CERTIFICATE-----\nMIIBIjANBgkqh..."
requestBody.SetCertificate(&certificate)
chain := "-----BEGIN CERTIFICATE-----\nMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AM..."
requestBody.SetChain(&chain)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
externalCertificateAuthorityCertificates, err := graphClient.NetworkAccess().Tls().ExternalCertificateAuthorityCertificates().ByExternalCertificateAuthorityCertificateId("externalCertificateAuthorityCertificate-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.ExternalCertificateAuthorityCertificate externalCertificateAuthorityCertificate = new com.microsoft.graph.beta.models.networkaccess.ExternalCertificateAuthorityCertificate();
externalCertificateAuthorityCertificate.setCertificate("-----BEGIN CERTIFICATE-----\nMIIBIjANBgkqh...");
externalCertificateAuthorityCertificate.setChain("-----BEGIN CERTIFICATE-----\nMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AM...");
com.microsoft.graph.models.networkaccess.ExternalCertificateAuthorityCertificate result = graphClient.networkAccess().tls().externalCertificateAuthorityCertificates().byExternalCertificateAuthorityCertificateId("{externalCertificateAuthorityCertificate-id}").patch(externalCertificateAuthorityCertificate);
const options = {
authProvider,
};
const client = Client.init(options);
const externalCertificateAuthorityCertificate = {
certificate: '-----BEGIN CERTIFICATE-----\nMIIBIjANBgkqh...',
chain: '-----BEGIN CERTIFICATE-----\nMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AM...'
};
await client.api('/networkAccess/tls/externalCertificateAuthorityCertificates/365da4f6-6194-401d-b787-b09815be36e3')
.version('beta')
.update(externalCertificateAuthorityCertificate);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\Networkaccess\ExternalCertificateAuthorityCertificate;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new ExternalCertificateAuthorityCertificate();
$requestBody->setCertificate('-----BEGIN CERTIFICATE-----\nMIIBIjANBgkqh...');
$requestBody->setChain('-----BEGIN CERTIFICATE-----\nMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AM...');
$result = $graphServiceClient->networkAccess()->tls()->externalCertificateAuthorityCertificates()->byExternalCertificateAuthorityCertificateId('externalCertificateAuthorityCertificate-id')->patch($requestBody)->wait();
Import-Module Microsoft.Graph.Beta.NetworkAccess
$params = @{
certificate = "-----BEGIN CERTIFICATE-----
MIIBIjANBgkqh..."
chain = "-----BEGIN CERTIFICATE-----
MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AM..."
}
Update-MgBetaNetworkAccessTlExternalCertificateAuthorityCertificate -ExternalCertificateAuthorityCertificateId $externalCertificateAuthorityCertificateId -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.external_certificate_authority_certificate import ExternalCertificateAuthorityCertificate
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = ExternalCertificateAuthorityCertificate(
certificate = "-----BEGIN CERTIFICATE-----\nMIIBIjANBgkqh...",
chain = "-----BEGIN CERTIFICATE-----\nMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AM...",
)
result = await graph_client.network_access.tls.external_certificate_authority_certificates.by_external_certificate_authority_certificate_id('externalCertificateAuthorityCertificate-id').patch(request_body)
Response
The following example shows the response.
HTTP/1.1 204 No Content