QuestionQ8

VerifiedDeploy and manage Azure compute resources

Your company has a Microsoft Entra tenant configured for hybrid coexistence with the on-premises Active Directory domain.

You plan to deploy several new virtual machines (VMs) in Azure. The VMs will have the same operating system and custom software requirements.

You configure a reference VM in the on-premises virtual environment and then generalize the VM to create an image.

You need to upload the image to Azure so that it is available for selection when you create the new Azure VMs.

Which PowerShell cmdlet should you use?

Explanation

Add-AzVhd uploads a virtual hard disk from an on-premises machine to Azure (to a managed disk or a blob). That is the step required to place the generalized image in Azure so it can be used as the basis for new VMs. Add-AzVM and Add-AzImage aren't Az PowerShell cmdlets: VMs are created with New-AzVM, and managed images with New-AzImage. Add-AzImageDataDisk only adds a data disk to an image object; it doesn't upload the source image.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!