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 9 months 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 82 times
margotfrpp
2 years, 2 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 3 times
Dankho
8 months ago
how does a person from 1 year, 6 months ago reply to someone from 4 weeks, 1 day ago. Riddle me that...
upvoted 28 times
mirajkumar
5 months, 2 weeks ago
Time Travel exits
upvoted 3 times
...
...
jersonmartinez
2 years, 1 month ago
It command does not exists. It only exist `New-AzImage`. That's different.
upvoted 13 times
...
...
...
Chi1987
Highly Voted 3 years, 8 months ago
Correct answer. Example for how you do this: Add-AzVhd -ResourceGroupName $resourceGroup -Destination $urlOfUploadedImageVhd ` -LocalFilePath $localPath
upvoted 52 times
jackdryan
2 years, 3 months ago
B is correct.
upvoted 3 times
...
...
TonyH20
Most Recent 6 days, 5 hours ago
Selected Answer: C
AI Mode All Videos Images Shopping Short videos Forums Web News Books Maps Flights Finance 3 sites New-AzImage (Az.Compute) | Microsoft Learn Learn Microsoft Add-AzImageDataDisk (Az.Compute) | Microsoft Learn Learn Microsoft Create a legacy managed image of a generalized VM in Azure Azure.cn Add-AzImageDataDisk (Az.Compute) | Microsoft Learn Learn Microsoft Based on the search results, it seems there's a slight confusion about the exact cmdlet. The correct cmdlet for adding an image in Azure PowerShell is actually New-AzImage, and you might use Add-AzImageDataDisk to add data disks to an image object. Here's how these cmdlets relate to managing images in Azure, according to the Microsoft Learn documentation: New-AzImage: This cmdlet is used to create a new Azure image. This is the primary cmdlet for creating a custom VM image in Azure from a generalized VM or a snapshot.
upvoted 1 times
...
NicoVick
3 weeks ago
Selected Answer: C
c is correct
upvoted 1 times
...
chaabouchihakim
4 weeks ago
Selected Answer: B
"Importer cette image dans Azure" → Cela signifie transférer un fichier .vhd depuis l'environnement local vers Azure (vers un compte de stockage Azure). "afin qu'elle soit disponible lors de la création..." → Cela signifie que ce VHD doit être mis à disposition, pas encore utilisé pour créer une image managée. L'action demandée est bien l'importation du fichier .vhd dans Azure, pas la création d'une image managée. La bonne réponse est : B. Add-AzVhd
upvoted 1 times
...
lumax007
2 months, 4 weeks ago
Selected Answer: C
Add-AzImage add/upload image to resource manager https://learn.microsoft.com/en-us/powershell/module/az.compute/new-azimage?view=azps-13.3.0
upvoted 1 times
...
0a92195
3 months, 3 weeks 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 2 times
...
ea4b48e
4 months 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
4 months, 1 week 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 months, 2 weeks ago
Selected Answer: B
It is Add-AzVhd. This is one of the question in the Microsoft Learn mock test
upvoted 2 times
...
SHAHIN_STA
6 months, 1 week ago
Selected Answer: B
B is correct
upvoted 1 times
...
Thomas_M
6 months, 2 weeks 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
6 months, 2 weeks ago
Selected Answer: B
for me B is correct
upvoted 1 times
...
[Removed]
9 months, 2 weeks ago
Selected Answer: B
B is corerct
upvoted 2 times
...
nachito
10 months, 3 weeks 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
1 year, 2 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
1 year, 2 months ago
B is correct
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 ...