diff --git a/azurerm/resource_arm_subnet.go b/azurerm/resource_arm_subnet.go index 044c6d4f1e0c..27b67c98751e 100644 --- a/azurerm/resource_arm_subnet.go +++ b/azurerm/resource_arm_subnet.go @@ -169,10 +169,14 @@ func resourceArmSubnetRead(d *schema.ResourceData, meta interface{}) error { if resp.SubnetPropertiesFormat.NetworkSecurityGroup != nil { d.Set("network_security_group_id", resp.SubnetPropertiesFormat.NetworkSecurityGroup.ID) + } else { + d.Set("network_security_group_id", "") } if resp.SubnetPropertiesFormat.RouteTable != nil { d.Set("route_table_id", resp.SubnetPropertiesFormat.RouteTable.ID) + } else { + d.Set("route_table_id", "") } if resp.SubnetPropertiesFormat.IPConfigurations != nil {