/// <summary> /// The Begin Deleting Deployment By Name operation deletes the /// specified deployment. This operation is an asynchronous operation. /// To determine whether the Management service has finished /// processing the request, call Get Operation Status. For more /// information on asynchronous operations, see Tracking Asynchronous /// Service Management Requests at /// http://msdn.microsoft.com/en-us/library/windowsazure/ee460791.aspx. /// (see /// http://msdn.microsoft.com/en-us/library/windowsazure/ee460815.aspx /// for more information) /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.Compute.IDeploymentOperations. /// </param> /// <param name='serviceName'> /// Required. The name of the cloud service. /// </param> /// <param name='deploymentName'> /// Required. The name of your deployment. /// </param> /// <param name='deleteFromStorage'> /// Required. Specifies that the source blob for the disk should also /// be deleted from storage. /// </param> /// <returns> /// A standard service response including an HTTP status code and /// request ID. /// </returns> public static Task<AzureOperationResponse> BeginDeletingByNameAsync(this IDeploymentOperations operations, string serviceName, string deploymentName, bool deleteFromStorage) { return operations.BeginDeletingByNameAsync(serviceName, deploymentName, deleteFromStorage, CancellationToken.None); }
/// <summary> /// The Delete Deployment operation deletes the specified deployment. /// The Delete Deployment operation is an asynchronous operation. To /// determine whether the Management service has finished processing /// the request, call Get Operation Status. For more information on /// asynchronous operations, see Tracking Asynchronous Service /// Management Requests. (see /// http://msdn.microsoft.com/en-us/library/windowsazure/ee460815.aspx /// for more information) /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.Compute.IDeploymentOperations. /// </param> /// <param name='serviceName'> /// The name of the cloud service. /// </param> /// <param name='deploymentName'> /// The name of your deployment. /// </param> /// <param name='deleteFromStorage'> /// Optional. Specifies that the source blob for the disk should also /// be deleted from storage. /// </param> /// <returns> /// A standard service response including an HTTP status code and /// request ID. /// </returns> public static OperationResponse BeginDeletingByName(this IDeploymentOperations operations, string serviceName, string deploymentName, bool deleteFromStorage) { try { return operations.BeginDeletingByNameAsync(serviceName, deploymentName, deleteFromStorage).Result; } catch (AggregateException ex) { if (ex.InnerExceptions.Count > 1) { throw; } else { throw ex.InnerException; } } }