diff --git a/azurerm/resource_arm_virtual_machine_scale_set.go b/azurerm/resource_arm_virtual_machine_scale_set.go index c5f1c9bcc4f6..daf71d642c19 100644 --- a/azurerm/resource_arm_virtual_machine_scale_set.go +++ b/azurerm/resource_arm_virtual_machine_scale_set.go @@ -898,9 +898,12 @@ func flattenAzureRmVirtualMachineScaleSetNetworkProfile(profile *compute.Virtual result := make([]map[string]interface{}, 0, len(*networkConfigurations)) for _, netConfig := range *networkConfigurations { s := map[string]interface{}{ - "name": *netConfig.Name, - "primary": *netConfig.VirtualMachineScaleSetNetworkConfigurationProperties.Primary, - "accelerated_networking": *netConfig.VirtualMachineScaleSetNetworkConfigurationProperties.EnableAcceleratedNetworking, + "name": *netConfig.Name, + "primary": *netConfig.VirtualMachineScaleSetNetworkConfigurationProperties.Primary, + } + + if v := netConfig.VirtualMachineScaleSetNetworkConfigurationProperties.EnableAcceleratedNetworking; v != nil { + s["accelerated_networking"] = *v } if v := netConfig.VirtualMachineScaleSetNetworkConfigurationProperties.NetworkSecurityGroup; v != nil {