From ec101b5b2a55fe4c4eddcdd477b05267d6d05a99 Mon Sep 17 00:00:00 2001 From: Julien Corioland Date: Wed, 5 Dec 2018 17:54:01 +0100 Subject: [PATCH] fix Batch account delete function --- azurerm/resource_arm_batch_account.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/azurerm/resource_arm_batch_account.go b/azurerm/resource_arm_batch_account.go index ca31a103df6a..0c6b6c456c37 100644 --- a/azurerm/resource_arm_batch_account.go +++ b/azurerm/resource_arm_batch_account.go @@ -3,6 +3,7 @@ package azurerm import ( "fmt" "log" + "net/http" "regexp" "github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2017-09-01/batch" @@ -193,7 +194,8 @@ func resourceArmBatchAccountDelete(d *schema.ResourceData, meta interface{}) err } err = future.WaitForCompletionRef(ctx, client.Client) - if err != nil { + // if the error is not that the Batch account was not found + if err != nil && future.Response().StatusCode != http.StatusNotFound { return fmt.Errorf("Error waiting for deletion of Batch account %q (Resource Group %q): %+v", name, resourceGroupName, err) }