Yes, you can. You need to prepare the virtual disk (VHD or VHDX). Azure supports both gen1 and gen2 virtual machines.