From dd9836be7792f8e4e33d6ed458b959aac9857980 Mon Sep 17 00:00:00 2001 From: ParthaI Date: Wed, 4 Jan 2023 13:42:54 +0530 Subject: [PATCH 1/2] Getting ResourceNotFound error in table azure_subnet closes #555 --- azure/table_azure_subnet.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/azure/table_azure_subnet.go b/azure/table_azure_subnet.go index 4028fa5f..9d6bda89 100644 --- a/azure/table_azure_subnet.go +++ b/azure/table_azure_subnet.go @@ -311,6 +311,9 @@ func getIpConfiguration(ctx context.Context, ipConfig *network.IPConfiguration, configuration, err := client.Get(ctx, resourceGroup, networkInterface, configName) if err != nil { + if strings.Contains(err.Error(), "ResourceNotFound") { + return nil, nil + } return nil, err } From bc4805c02433b8f0bd3c3509f26930406a8a7d6a Mon Sep 17 00:00:00 2001 From: ParthaI Date: Wed, 4 Jan 2023 13:58:33 +0530 Subject: [PATCH 2/2] Updated the condition --- azure/table_azure_subnet.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure/table_azure_subnet.go b/azure/table_azure_subnet.go index 9d6bda89..41e3dfea 100644 --- a/azure/table_azure_subnet.go +++ b/azure/table_azure_subnet.go @@ -294,7 +294,7 @@ func getIpConfigurationAsync(ctx context.Context, ipConfig *network.IPConfigurat rowData, err := getIpConfiguration(ctx, ipConfig, client) if err != nil { errorCh <- err - } else if rowData.ID != nil { + } else if rowData != nil { ipCh <- rowData } }