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 (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
NaoVaz
Highly Voted 5 months, 2 weeks 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 77 times
margotfrpp
1 year, 11 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
Dankho
4 months, 2 weeks ago
how does a person from 1 year, 6 months ago reply to someone from 4 weeks, 1 day ago. Riddle me that...
upvoted 25 times
mirajkumar
2 months ago
Time Travel exits
upvoted 3 times
...
...
jersonmartinez
1 year, 10 months ago
It command does not exists. It only exist `New-AzImage`. That's different.
upvoted 12 times
...
...
...
Chi1987
Highly Voted 3 years, 5 months ago
Correct answer. Example for how you do this: Add-AzVhd -ResourceGroupName $resourceGroup -Destination $urlOfUploadedImageVhd ` -LocalFilePath $localPath
upvoted 50 times
jackdryan
2 years ago
B is correct.
upvoted 3 times
...
...
0a92195
Most Recent 1 week, 1 day ago
Selected Answer: C
C. Add-AzImage Explanation: Since you generalized the VM to create an image, you need to upload it to Azure as a managed image. Add-AzImage is the PowerShell cmdlet used to add a VM image to Azure, making it available for creating new VMs. Why Not the Other Options? A. Add-AzVM → This is used to create a VM, not to upload an image. B. Add-AzVhd → Used for uploading a VHD file, but does not create an image from it. D. Add-AzImageDataDisk → Used to add a data disk, not a VM image.
upvoted 1 times
...
ea4b48e
3 weeks ago
Selected Answer: C
By using Add-AzImage, you ensure that the image is available for selection when creating new Azure VMs.
upvoted 1 times
...
SolimanAlali
3 weeks, 4 days ago
Selected Answer: C
To upload a generalized VM image and make it available for deployment in Azure, we need to use Add-AzImage. This cmdlet allows to register a VM image in Azure Compute Gallery (formerly Shared Image Gallery) or in the subscription's image repository. After we generalize the reference VM using Sysprep (Windows), we need to follow these steps: 1- Capture the image: * For Azure VMs, use Save-AzVmImage. * For on-premises VMs, create a VHD and upload it. 2- Upload the VHD to an Azure Storage account. 3- Create an image using Add-AzImage: $imageConfig = New-AzImageConfig -Location "EastUS" -SourceUri "https://yourstorageaccount.blob.core.windows.net/vhds/your-image.vhd" -OsType Windows Add-AzImage -Image $imageConfig -ResourceGroupName "YourResourceGroup" This ensures that the image is available for VM creation in Azure.
upvoted 1 times
...
Marie12345678900
4 weeks, 1 day ago
Selected Answer: B
It is Add-AzVhd. This is one of the question in the Microsoft Learn mock test
upvoted 1 times
...
SHAHIN_STA
2 months, 3 weeks ago
Selected Answer: B
B is correct
upvoted 1 times
...
Thomas_M
3 months ago
Selected Answer: B
To upload a generalized VM image to Azure and make it available for creating new VMs, you would use a combination of the following PowerShell cmdlets: Add-AzVhd: This cmdlet uploads the generalized VHD file (your image) to an Azure storage account. Add-AzImage: This cmdlet creates a managed image from the uploaded VHD file, making it available for creating new Azure VMs.
upvoted 3 times
...
Mark74
3 months ago
Selected Answer: B
for me B is correct
upvoted 1 times
...
[Removed]
6 months ago
Selected Answer: B
B is corerct
upvoted 2 times
...
nachito
7 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
11 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
11 months, 2 weeks ago
B is correct
upvoted 1 times
...
Amir1909
1 year ago
B is correct
upvoted 1 times
...
koenigParas2324
1 year, 1 month 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
1 year, 1 month 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
1 year, 2 months 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
1 year, 2 months ago
There is not such a thing as a "add-azimage". Please, just google it.
upvoted 2 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 ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago