diff --git a/internal/services/legacy/virtual_machine_resource.go b/internal/services/legacy/virtual_machine_resource.go index 176e20bd1b63..451b7ba66283 100644 --- a/internal/services/legacy/virtual_machine_resource.go +++ b/internal/services/legacy/virtual_machine_resource.go @@ -1755,7 +1755,7 @@ func expandAzureRmVirtualMachineDiagnosticsProfile(d *pluginsdk.ResourceData) *c func expandAzureRmVirtualMachineAdditionalCapabilities(d *pluginsdk.ResourceData) *compute.AdditionalCapabilities { additionalCapabilities := d.Get("additional_capabilities").([]interface{}) - if len(additionalCapabilities) == 0 { + if len(additionalCapabilities) == 0 || additionalCapabilities[0] == nil { return nil }