diff --git a/azurerm/resource_arm_virtual_machine.go b/azurerm/resource_arm_virtual_machine.go index b753da4b8205..2681129ba04f 100644 --- a/azurerm/resource_arm_virtual_machine.go +++ b/azurerm/resource_arm_virtual_machine.go @@ -1406,6 +1406,9 @@ func flattenAzureRmVirtualMachineReviseDiskInfo(result map[string]interface{}, d func expandAzureRmVirtualMachinePlan(d *schema.ResourceData) (*compute.Plan, error) { planConfigs := d.Get("plan").([]interface{}) + if len(planConfigs) == 0 { + return nil, nil + } planConfig := planConfigs[0].(map[string]interface{})