azure-docs
azure-docs copied to clipboard
Typo in the script provided to Attach the disk
The variable $vm used two times, second time we can make it $vm1 (or anything) when when adding the Disk, so it can be used as $vm1 in update-azvm command
[$resourceGroup = "myResourceGroup" $location = "WestCentralUS"
$vm = New-AzVm -ResourceGroupName $resourceGroup -Name "myVM" -Location $location -VirtualNetworkName "myVnet" -SubnetName "mySubnet" -SecurityGroupName "myNetworkSecurityGroup" -PublicIpAddressName "myPublicIpAddress"
$dataDisk = Get-AzDisk -ResourceGroupName $resourceGroup -DiskName "mySharedDisk"
$vm = Add-AzVMDataDisk -VM $vm -Name "mySharedDisk" -CreateOption Attach -ManagedDiskId $dataDisk.Id -Lun 0
update-AzVm -VM $vm -ResourceGroupName $resourceGroup]
Document Details
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.
- ID: 4adcc7c9-6709-7f9e-4ec8-63dec6d78293
- Version Independent ID: 151f998f-898f-6b49-dfeb-ae29040d1af1
- Content: Enable shared disks for Azure managed disks - Azure Virtual Machines
- Content Source: articles/virtual-machines/disks-shared-enable.md
- Service: storage
- Sub-service: disks
- GitHub Login: @roygara
- Microsoft Alias: rogarana
@MDYShah Thanks for your feedback! We will investigate and update as appropriate.
@MDYShah Could you please help us with the screenshot and mark the line that changes to be made. So, it will be helpful for us to make necessary changes.
Thanks.
@MDYShah We are going to close this thread but if there are any further questions in the documentation, please tag me in your reply and we will be happy to continue the conversation.