Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.
exam questions

Exam AZ-104 All Questions

View all questions & answers for the AZ-104 exam

Exam AZ-104 topic 1 question 22 discussion

Actual exam question from Microsoft's AZ-104
Question #: 22
Topic #: 1
[All AZ-104 Questions]

Your company has an Azure Active Directory (Azure AD) tenant that is 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-premise virtual environment. You then generalize the VM to create an image.
You need to upload the image to Azure to ensure that it is available for selection when you create the new Azure VMs.
Which PowerShell cmdlets should you use?

  • A. Add-AzVM
  • B. Add-AzVhd
  • C. Add-AzImage
  • D. Add-AzImageDataDisk
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
NaoVaz
Highly Voted 2 weeks, 2 days ago
Selected Answer: B
"New-AzVM" is for creating new VMs, not uploading images. "Add-AzImage" does not exist. the correct command is "New-AzImage". "Add-AzImageDataDisk" Adds a data disk to an image object. "Add-AzVhd" seems to be the correct option, sing the it "Uploads a virtual hard disk from an on-premises machine to Azure (managed disk or blob)." (https://docs.microsoft.com/en-us/powershell/module/az.compute/add-azvhd?view=azps-8.3.0)
upvoted 67 times
margotfrpp
1 year, 6 months ago
this command exist " Add-AzImage" https://learn.microsoft.com/en-us/powershell/module/az.compute/new-azimage?view=azps-9.6.0
upvoted 2 times
jersonmartinez
1 year, 5 months ago
It command does not exists. It only exist `New-AzImage`. That's different.
upvoted 9 times
...
...
...
Chi1987
Highly Voted 3 years ago
Correct answer. Example for how you do this: Add-AzVhd -ResourceGroupName $resourceGroup -Destination $urlOfUploadedImageVhd ` -LocalFilePath $localPath
upvoted 49 times
jackdryan
1 year, 7 months ago
B is correct.
upvoted 3 times
...
...
SeMo0o0o0o
Most Recent 1 month ago
Selected Answer: B
B is corerct
upvoted 1 times
...
nachito
2 months, 1 week ago
Selected Answer: B
Based on the reference the best option is B: Before you upload a Windows virtual machine (VM) from on-premises to Azure, you must prepare the virtual hard disk (VHD or VHDX). reference https://learn.microsoft.com/en-us/azure/virtual-machines/windows/prepare-for-upload-vhd-image
upvoted 1 times
...
MCLC2021
6 months ago
Selected Answer: B
Uploads a virtual hard disk from an on-premises machine to Azure (managed disk or blob). https://learn.microsoft.com/en-us/powershell/module/az.compute/add-azvhd?view=azps-11.5.0
upvoted 1 times
...
tashakori
6 months, 2 weeks ago
B is correct
upvoted 1 times
...
Amir1909
7 months, 1 week ago
B is correct
upvoted 1 times
...
koenigParas2324
8 months, 3 weeks ago
Selected Answer: C
The correct PowerShell cmdlet to use for uploading the generalized VM image to Azure is C. Add-AzImage. This cmdlet is used to create a new image in Azure. After generalizing the VM to create an image, you can use the Add-AzImage cmdlet to upload the image to Azure, ensuring that it is available for selection when creating new Azure VMs
upvoted 2 times
...
RVivek
9 months ago
Selected Answer: B
"Add-AzImage" can create a new image from managedisk only( -ManagedDiskId parameter is required). That means your VHD image should be uploaded first. Add-AzVHD is used to upload image
upvoted 1 times
...
VirenderPannu
9 months, 1 week ago
Add-AzImage: Purpose: This cmdlet is used to create a managed image from an existing virtual machine (VM) or from a generalized VM image. Usage: You typically use this cmdlet after capturing a VM image, and it creates a generalized or specialized image that you can use to deploy new VMs. Example: Copy Add-AzImage -ImageName "MyImage" -ResourceGroupName "MyResourceGroup" -SourceVirtualMachineId $vm.Id Add-AzVhd: Purpose: This cmdlet is used to copy a virtual hard disk (VHD) file to an Azure Storage Account, making it available for use in creating or configuring VMs. Usage: You might use this cmdlet when you have a VHD file that you want to use to create a new VM, and you need to copy it to Azure storage before attaching it to a VM. Example: Copy Add-AzVhd -LocalFilePath "C:\Path\To\Your\VHD.vhd" -ResourceGroupName "MyResourceGroup" -Destination "https://mystorageaccount.blob.core.windows.net/vhds/MyVHD.vhd"
upvoted 1 times
MatAlves
9 months, 1 week ago
There is not such a thing as a "add-azimage". Please, just google it.
upvoted 2 times
...
...
Yuraq
12 months ago
Add-AzVhd Uploads a virtual hard disk from an on-premises machine to Azure (managed disk or blob). https://learn.microsoft.com/en-us/powershell/module/az.compute/add-azvhd?view=azps-10.4.1&viewFallbackFrom=azps-7.3.0
upvoted 2 times
...
Manny123456
1 year ago
https://learn.microsoft.com/en-us/azure/devtest-labs/devtest-lab-upload-vhd-using-powershell Check upload a VHD file process: To upload a VHD file by using PowerShell: In a text editor, paste the generated PowerShell script you copied from the Azure portal. Modify the -LocalFilePath parameter of the Add-AZVHD cmdlet to point to the location of the VHD file you want to upload. At a PowerShell command prompt, run the Add-AZVHD cmdlet with the modified -LocalFilePath parameter. The process of uploading a VHD file might be lengthy depending on the size of the VHD file and your connection speed. The correct answer is Add-AzVHD
upvoted 2 times
...
amsioso
1 year ago
Vote for B Add-AzVhd https://learn.microsoft.com/en-us/previous-versions/azure/virtual-machines/windows/sa-upload-generalized#start-the-upload
upvoted 2 times
...
Damiski
1 year ago
To upload a generalized virtual machine image to Azure for use in creating new Azure VMs, you should use the following PowerShell cmdlet: **C. Add-AzImage** Here's a brief explanation of each option: A. `Add-AzVM` is used to create a new Azure virtual machine, not to upload images. B. `Add-AzVhd` is used to upload a virtual hard disk (VHD) to Azure. It's not used for creating generalized VM images. C. `Add-AzImage` is specifically designed for uploading generalized VM images to Azure. This is the cmdlet you should use for your scenario. D. `Add-AzImageDataDisk` is used to add a data disk to an existing Azure virtual machine, not for uploading generalized images. So, in your case, you should use `Add-AzImage` to upload your generalized VM image to Azure so that it can be used to create new Azure VMs.
upvoted 5 times
...
Techbiz
1 year, 1 month ago
Option B is correct
upvoted 1 times
...
desertsmissdrain
1 year, 1 month ago
Image = OS VHD + optionally Data VHD https://learn.microsoft.com/en-us/powershell/module/az.compute/add-azvhd?view=azps-10.2.0 - "The Add-AzVhd cmdlet uploads an on-premise virtual hard disk to a managed disk or a blob storage account"
upvoted 1 times
...
desertsmissdrain
1 year, 1 month ago
https://learn.microsoft.com/en-us/powershell/module/az.compute/new-azimage?view=azps-10.2.0 $imageConfig = New-AzImageConfig -Location 'West US'; $osDiskVhdUri = "https://contoso.blob.core.windows.net/test/os.vhd" $dataDiskVhdUri1 = "https://contoso.blob.core.windows.net/test/data1.vhd" $dataDiskVhdUri2 = "https://contoso.blob.core.windows.net/test/data2.vhd" Set-AzImageOsDisk -Image $imageConfig -OsType 'Windows' -OsState 'Generalized' -BlobUri $osDiskVhdUri; Add-AzImageDataDisk -Image $imageConfig -Lun 1 -BlobUri $dataDiskVhdUri1; Add-AzImageDataDisk -Image $imageConfig -Lun 2 -BlobUri $dataDiskVhdUri2; New-AzImage -Image $imageConfig -ImageName 'ImageName01' -ResourceGroupName 'ResourceGroup01';
upvoted 1 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...