diff --git a/builtin/providers/azurerm/resource_arm_subnet.go b/builtin/providers/azurerm/resource_arm_subnet.go index 796202c3e186..dbdb11f112de 100644 --- a/builtin/providers/azurerm/resource_arm_subnet.go +++ b/builtin/providers/azurerm/resource_arm_subnet.go @@ -151,6 +151,12 @@ func resourceArmSubnetRead(d *schema.ResourceData, meta interface{}) error { } } + if resp.Properties.RouteTable == nil { + d.Set("route_table_id", nil) + } else { + d.Set("route_table_id", *resp.Properties.RouteTable.ID) + } + return nil }