


Once the VM has stopped, grant access to the disk: $sas = Grant-AzDiskAccess -ResourceGroupName $rg -DiskName $diskName -DurationInSecond $sasExpiryDuration -Access Read.Use the appropriate commands to take a snapshot of the VM.Stop the VM: Stop-AzVM -ResourceGroupName $rg -Name $vmName.Create additional variables: $storageContainerName = "container1".In the Azure Portal, copy the storage account key for key1, and create a new variable: $storageAccountKey = "".In the Azure Portal, copy the storage account name, and create a new variable: $storageAccountName = "".

