POST https://graph.microsoft.com/beta/directory/publicKeyInfrastructure/certificateBasedAuthConfigurations/{certificateBasedAuthPkiId}/upload
Content-Type: application/json
{
"uploadUrl": "https://microsoft.sharepoint.com/CBA/demo/CBARootPKI.p7b",
"sha256FileHash": "D7F9....61E6F"
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.DirectoryNamespace.PublicKeyInfrastructure.CertificateBasedAuthConfigurations.Item.Upload;
var requestBody = new UploadPostRequestBody
{
UploadUrl = "https://microsoft.sharepoint.com/CBA/demo/CBARootPKI.p7b",
Sha256FileHash = "D7F9....61E6F",
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
await graphClient.Directory.PublicKeyInfrastructure.CertificateBasedAuthConfigurations["{certificateBasedAuthPki-id}"].Upload.PostAsync(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"
graphdirectory "github.com/microsoftgraph/msgraph-beta-sdk-go/directory"
//other-imports
)
requestBody := graphdirectory.NewUploadPostRequestBody()
uploadUrl := "https://microsoft.sharepoint.com/CBA/demo/CBARootPKI.p7b"
requestBody.SetUploadUrl(&uploadUrl)
sha256FileHash := "D7F9....61E6F"
requestBody.SetSha256FileHash(&sha256FileHash)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
graphClient.Directory().PublicKeyInfrastructure().CertificateBasedAuthConfigurations().ByCertificateBasedAuthPkiId("certificateBasedAuthPki-id").Upload().Post(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.directory.publickeyinfrastructure.certificatebasedauthconfigurations.item.upload.UploadPostRequestBody uploadPostRequestBody = new com.microsoft.graph.beta.directory.publickeyinfrastructure.certificatebasedauthconfigurations.item.upload.UploadPostRequestBody();
uploadPostRequestBody.setUploadUrl("https://microsoft.sharepoint.com/CBA/demo/CBARootPKI.p7b");
uploadPostRequestBody.setSha256FileHash("D7F9....61E6F");
graphClient.directory().publicKeyInfrastructure().certificateBasedAuthConfigurations().byCertificateBasedAuthPkiId("{certificateBasedAuthPki-id}").upload().post(uploadPostRequestBody);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Directory\PublicKeyInfrastructure\CertificateBasedAuthConfigurations\Item\Upload\UploadPostRequestBody;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new UploadPostRequestBody();
$requestBody->setUploadUrl('https://microsoft.sharepoint.com/CBA/demo/CBARootPKI.p7b');
$requestBody->setSha256FileHash('D7F9....61E6F');
$graphServiceClient->directory()->publicKeyInfrastructure()->certificateBasedAuthConfigurations()->byCertificateBasedAuthPkiId('certificateBasedAuthPki-id')->upload()->post($requestBody)->wait();
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.directory.publickeyinfrastructure.certificatebasedauthconfigurations.item.upload.upload_post_request_body import UploadPostRequestBody
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = UploadPostRequestBody(
upload_url = "https://microsoft.sharepoint.com/CBA/demo/CBARootPKI.p7b",
sha256_file_hash = "D7F9....61E6F",
)
await graph_client.directory.public_key_infrastructure.certificate_based_auth_configurations.by_certificate_based_auth_pki_id('certificateBasedAuthPki-id').upload.post(request_body)