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

Definition

Deletes a deployment from the deployment history.

public System.Threading.Tasks.Task<Microsoft.Rest.Azure.AzureOperationResponse> DeleteWithHttpMessagesAsync (string resourceGroupName, string deploymentName, System.Collections.Generic.Dictionary<string,System.Collections.Generic.List<string>> customHeaders = null, System.Threading.CancellationToken cancellationToken = null);
abstract member DeleteWithHttpMessagesAsync : string * string * System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Rest.Azure.AzureOperationResponse>
Parameters
resourceGroupName
String String

The name of the resource group with the deployment to delete. The name is case insensitive.

deploymentName
String String

The name of the deployment to delete.

customHeaders
Dictionary<String,List<String>>

The headers that will be added to request.

cancellationToken
CancellationToken CancellationToken

The cancellation token.

Returns
Task<Microsoft.Rest.Azure.AzureOperationResponse>
Exceptions
Microsoft.Rest.Azure.CloudException Microsoft.Rest.Azure.CloudException

Thrown when the operation returned an invalid status code

Microsoft.Rest.ValidationException Microsoft.Rest.ValidationException

Thrown when a required parameter is null

Remarks

A template deployment that is currently running cannot be deleted.
Deleting a template deployment removes the associated deployment
operations. Deleting a template deployment does not affect the
state of the resource group. This is an asynchronous operation that
returns a status of 202 until the template deployment is
successfully deleted. The Location response header contains the URI
that is used to obtain the status of the process. While the process
is running, a call to the URI in the Location header returns a
status of 202. When the process finishes, the URI in the Location
header returns a status of 204 on success. If the asynchronous
request failed, the URI in the Location header returns an
error-level status code.

Applies to