You generalized a reference VM in your on-premises environment to create an image and need to upload that image to Azure so it appears as a selectable option when creating new Azure VMs. Which PowerShell cmdlet uploads the VHD to Azure?
Choose an answer
Tap an option to check your answer.
Correct answer: Add-AzVhd.
Why this is the answer
The Add-AzVhd cmdlet is the correct choice because it is specifically designed to upload a VHD (Virtual Hard Disk) file from an on-premises location to a blob storage account in Azure. This VHD can then be used to create an Azure managed disk, which can serve as the operating system disk for new virtual machines. Add-AzVM is incorrect because it is used to create a new Azure virtual machine, not to upload a VHD. Add-AzImage is incorrect as it's used to create an Azure Compute Gallery image definition, which typically references existing managed disks or snapshots, rather than directly uploading a VHD. Add-AzImageDataDisk is incorrect because it's used to add a data disk to an existing image definition, not to upload the initial VHD for an OS disk.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed