Share via


CertificateOperations.DeleteCertificateAsync Method

Definition

Deletes the certificate from the Batch account.

public System.Threading.Tasks.Task DeleteCertificateAsync (string thumbprintAlgorithm, string thumbprint, System.Collections.Generic.IEnumerable<Microsoft.Azure.Batch.BatchClientBehavior> additionalBehaviors = default, System.Threading.CancellationToken cancellationToken = default);
member this.DeleteCertificateAsync : string * string * seq<Microsoft.Azure.Batch.BatchClientBehavior> * System.Threading.CancellationToken -> System.Threading.Tasks.Task
Public Function DeleteCertificateAsync (thumbprintAlgorithm As String, thumbprint As String, Optional additionalBehaviors As IEnumerable(Of BatchClientBehavior) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task

Parameters

thumbprintAlgorithm
String

The algorithm used to derive the thumbprint parameter. This must be sha1.

thumbprint
String

The thumbprint of the certificate to delete.

additionalBehaviors
IEnumerable<BatchClientBehavior>

A collection of BatchClientBehavior instances that are applied to the Batch service request after the CustomBehaviors.

cancellationToken
CancellationToken

A CancellationToken for controlling the lifetime of the asynchronous operation.

Returns

A Task that represents the asynchronous operation.

Remarks

The delete operation requests that the certificate be deleted. The request puts the certificate in the Deleting state. The Batch service will perform the actual certificate deletion without any further client action.

You cannot delete a certificate if a resource (pool or compute node) is using it. Before you can delete a certificate, you must therefore make sure that:

  • The certificate is not associated with any pools.
  • The certificate is not installed on any compute nodes. (Even if you remove a certificate from a pool, it is not removed from existing compute nodes in that pool until they restart.)

If you try to delete a certificate that is in use, the deletion fails. The certificate state changes to DeleteFailed. You can use CancelDeleteCertificateAsync(String, String, IEnumerable<BatchClientBehavior>, CancellationToken) to set the status back to Active if you decide that you want to continue using the certificate.

The delete operation runs asynchronously.

Applies to