Tuesday, July 4, 2017

Storage account associated with VM in Azure

$disk = Get-AzureDisk | Where-Object { $_.AttachedTo.RoleName -eq "vmname" }
$mediaLink = $disk.MediaLink
$storageAccountName = $mediaLink.Host.Split('.')[0]
$storageAccountName

No comments:

Post a Comment