ICertificateOperations.DeleteWithHttpMessagesAsync(String, String, CertificateDeleteOptions, Dictionary<String,List<String>>, CancellationToken) Method

Definition

Deletes a certificate from the specified account.

public System.Threading.Tasks.Task<Microsoft.Rest.Azure.AzureOperationHeaderResponse<Microsoft.Azure.Batch.Protocol.Models.CertificateDeleteHeaders>> DeleteWithHttpMessagesAsync (string thumbprintAlgorithm, string thumbprint, Microsoft.Azure.Batch.Protocol.Models.CertificateDeleteOptions certificateDeleteOptions = null, System.Collections.Generic.Dictionary<string,System.Collections.Generic.List<string>> customHeaders = null, System.Threading.CancellationToken cancellationToken = null);
abstract member DeleteWithHttpMessagesAsync : string * string * Microsoft.Azure.Batch.Protocol.Models.CertificateDeleteOptions * System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Rest.Azure.AzureOperationHeaderResponse<Microsoft.Azure.Batch.Protocol.Models.CertificateDeleteHeaders>>

Parameters

thumbprintAlgorithm
System.String

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

thumbprint
System.String

The thumbprint of the certificate to be deleted.

certificateDeleteOptions
CertificateDeleteOptions

Additional parameters for the operation

customHeaders
System.Collections.Generic.Dictionary<System.String,System.Collections.Generic.List<System.String>>

The headers that will be added to request.

cancellationToken
System.Threading.CancellationToken

The cancellation token.

Returns

System.Threading.Tasks.Task<Microsoft.Rest.Azure.AzureOperationHeaderResponse<CertificateDeleteHeaders>>

Exceptions

Thrown when the operation returned an invalid status code

Thrown when a required parameter is null

Remarks

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 existing 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), and no running tasks depend on the certificate. If you try to delete a certificate that is in use, the deletion fails. The certificate status changes to deleteFailed. You can use Cancel Delete Certificate to set the status back to active if you decide that you want to continue using the certificate.

Applies to