#Provide the subscription Id $subscriptionId = 'yourSubscriptionId' #Provide the name of your resource group $resourceGroupName ='yourResourceGroupName' #Provide the name of the snapshot that will be used to create Managed Disks $snapshotName = 'yourSnapshotName' #Provide the name of the Managed Disk $diskName = 'yourManagedDiskName' #Provide the size of the disks in GB. It should be greater than the VHD file size. $diskSize = '128' #Provide the storage type for Managed Disk. PremiumLRS or StandardLRS. $storageType = 'Premium_LRS' #Provide the Azure region (e.g. westus) where Managed Disks will be located. #This location should be same as the snapshot location #Get all the Azure location using command below: #Get-AzLocation $location = 'westus' #Set the context to the subscription Id where Managed Disk will be created Select-AzSubscription -SubscriptionId $SubscriptionId $snapshot = Get-AzSnapshot -ResourceGroupName $resourceGroupName -SnapshotName $snapshotName $diskConfig = New-AzDiskConfig -SkuName $storageType -Location $location -CreateOption Copy -SourceResourceId $snapshot.Id New-AzDisk -Disk $diskConfig -ResourceGroupName $resourceGroupName -DiskName $diskName