diff --git a/azurerm/internal/services/loadbalancer/outbound_rule_resource.go b/azurerm/internal/services/loadbalancer/outbound_rule_resource.go index 1e37c8f81ccf..4197773deb46 100644 --- a/azurerm/internal/services/loadbalancer/outbound_rule_resource.go +++ b/azurerm/internal/services/loadbalancer/outbound_rule_resource.go @@ -231,19 +231,21 @@ func resourceArmLoadBalancerOutboundRuleRead(d *schema.ResourceData, meta interf d.Set("enable_tcp_reset", props.EnableTCPReset) frontendIpConfigurations := make([]interface{}, 0) - for _, feConfig := range *props.FrontendIPConfigurations { - if feConfig.ID == nil { - continue + if configs := props.FrontendIPConfigurations; configs != nil { + for _, feConfig := range *configs { + if feConfig.ID == nil { + continue + } + feid, err := parse.LoadBalancerFrontendIpConfigurationID(*feConfig.ID) + if err != nil { + return err + } + + frontendIpConfigurations = append(frontendIpConfigurations, map[string]interface{}{ + "id": feid.ID(), + "name": feid.FrontendIPConfigurationName, + }) } - feid, err := parse.LoadBalancerFrontendIpConfigurationID(*feConfig.ID) - if err != nil { - return err - } - - frontendIpConfigurations = append(frontendIpConfigurations, map[string]interface{}{ - "id": feid.ID(), - "name": feid.FrontendIPConfigurationName, - }) } d.Set("frontend_ip_configuration", frontendIpConfigurations)