From 10c9439cf581a1aacf560f5a4def5ff86ef24571 Mon Sep 17 00:00:00 2001 From: tombuildsstuff Date: Wed, 10 Feb 2021 15:38:31 +0100 Subject: [PATCH] r/cosmosdb_account: removing a panic when the response is nil Fixes #10522 --- .../internal/services/cosmos/cosmosdb_account_resource.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/azurerm/internal/services/cosmos/cosmosdb_account_resource.go b/azurerm/internal/services/cosmos/cosmosdb_account_resource.go index 7f8327bad37d..4dbeaeef5533 100644 --- a/azurerm/internal/services/cosmos/cosmosdb_account_resource.go +++ b/azurerm/internal/services/cosmos/cosmosdb_account_resource.go @@ -768,11 +768,7 @@ func resourceCosmosDbAccountDelete(d *schema.ResourceData, meta interface{}) err return err } - future, err := client.Delete(ctx, id.ResourceGroup, id.Name) - if err != nil { - if future.Response().StatusCode == http.StatusNoContent { - return nil - } + if _, err := client.Delete(ctx, id.ResourceGroup, id.Name); err != nil { return fmt.Errorf("deleting CosmosDB Account %q (Resource Group %q): %+v", id.Name, id.ResourceGroup, err) }