From 5a406c9e2385e446c090999853acf516370d212c Mon Sep 17 00:00:00 2001 From: ParthaI <47887552+ParthaI@users.noreply.github.com> Date: Tue, 10 Jan 2023 12:37:46 +0530 Subject: [PATCH] Getting ResourceNotFound error in table azure_subnet closes #555 (#556) --- azure/table_azure_subnet.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/azure/table_azure_subnet.go b/azure/table_azure_subnet.go index 4028fa5f..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 } } @@ -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 }