code: public void cancel(String resourceGroupName, String deploymentName) {
          cancelWithServiceResponseAsync(resourceGroupName, deploymentName).toBlocking().single().body();
      }
docs: Cancels a currently running template deployment.
  You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running template deployment and leaves the resource group partially deployed.
  
  @param resourceGroupName The name of the resource group. The name is case insensitive.
  @param deploymentName The name of the deployment to cancel.
  @throws IllegalArgumentException thrown if parameters fail the validation
  @throws CloudException thrown if the request is rejected by server
  @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent