CertificateOperations.DeleteCertificate Method

Definition

Deletes the certificate from the Batch account.

public void DeleteCertificate (string thumbprintAlgorithm, string thumbprint, System.Collections.Generic.IEnumerable<Microsoft.Azure.Batch.BatchClientBehavior> additionalBehaviors = default);
member this.DeleteCertificate : string * string * seq<Microsoft.Azure.Batch.BatchClientBehavior> -> unit
Public Sub DeleteCertificate (thumbprintAlgorithm As String, thumbprint As String, Optional additionalBehaviors As IEnumerable(Of BatchClientBehavior) = Nothing)

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.

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.

This is a blocking operation. For a non-blocking equivalent, see DeleteCertificateAsync(String, String, IEnumerable<BatchClientBehavior>, CancellationToken).

Applies to