From 5d1abbdabd8412896521165053d9d855373f6acd Mon Sep 17 00:00:00 2001 From: yupwei68 Date: Tue, 23 Jun 2020 13:49:01 +0800 Subject: [PATCH] update --- ...terface_application_security_group_association_resource.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/azurerm/internal/services/network/network_interface_application_security_group_association_resource.go b/azurerm/internal/services/network/network_interface_application_security_group_association_resource.go index 77104acd8b76..97d6fabe45c9 100644 --- a/azurerm/internal/services/network/network_interface_application_security_group_association_resource.go +++ b/azurerm/internal/services/network/network_interface_application_security_group_association_resource.go @@ -82,7 +82,9 @@ func resourceArmNetworkInterfaceApplicationSecurityGroupAssociationCreate(d *sch read, err := client.Get(ctx, resourceGroup, networkInterfaceName, "") if err != nil { if utils.ResponseWasNotFound(read.Response) { - return fmt.Errorf("Network Interface %q (Resource Group %q) was not found!", networkInterfaceName, resourceGroup) + log.Printf("[INFO] Network Interface %q does not exist - removing from state", d.Id()) + d.SetId("") + return nil } return fmt.Errorf("Error retrieving Network Interface %q (Resource Group %q): %+v", networkInterfaceName, resourceGroup, err)