diff --git a/azurerm/internal/services/compute/resource_arm_linux_virtual_machine_scale_set.go b/azurerm/internal/services/compute/resource_arm_linux_virtual_machine_scale_set.go index 19e37f1e44504..65ddbc448b29c 100644 --- a/azurerm/internal/services/compute/resource_arm_linux_virtual_machine_scale_set.go +++ b/azurerm/internal/services/compute/resource_arm_linux_virtual_machine_scale_set.go @@ -613,13 +613,15 @@ func resourceArmLinuxVirtualMachineScaleSetUpdate(d *schema.ResourceData, meta i return fmt.Errorf("Error expanding `network_interface`: %+v", err) } - healthProbeId := d.Get("health_probe_id").(string) - updateProps.VirtualMachineProfile.NetworkProfile = &compute.VirtualMachineScaleSetUpdateNetworkProfile{ NetworkInterfaceConfigurations: networkInterfaces, - HealthProbe: &compute.APIEntityReference{ + } + + healthProbeId := d.Get("health_probe_id").(string) + if healthProbeId != "" { + updateProps.VirtualMachineProfile.NetworkProfile.HealthProbe = &compute.APIEntityReference{ ID: utils.String(healthProbeId), - }, + } } } diff --git a/azurerm/internal/services/compute/resource_arm_windows_virtual_machine_scale_set.go b/azurerm/internal/services/compute/resource_arm_windows_virtual_machine_scale_set.go index dfd2dc0c220d6..25a452e92dee9 100644 --- a/azurerm/internal/services/compute/resource_arm_windows_virtual_machine_scale_set.go +++ b/azurerm/internal/services/compute/resource_arm_windows_virtual_machine_scale_set.go @@ -700,13 +700,15 @@ func resourceArmWindowsVirtualMachineScaleSetUpdate(d *schema.ResourceData, meta return fmt.Errorf("Error expanding `network_interface`: %+v", err) } - healthProbeId := d.Get("health_probe_id").(string) - updateProps.VirtualMachineProfile.NetworkProfile = &compute.VirtualMachineScaleSetUpdateNetworkProfile{ NetworkInterfaceConfigurations: networkInterfaces, - HealthProbe: &compute.APIEntityReference{ + } + + healthProbeId := d.Get("health_probe_id").(string) + if healthProbeId != "" { + updateProps.VirtualMachineProfile.NetworkProfile.HealthProbe = &compute.APIEntityReference{ ID: utils.String(healthProbeId), - }, + } } }