我正在尝试找到PowerShell cmdlet,该cmdlet可以检索有关Azure VM使用哪个存储帐户的信息. 例如,我想提供VM的名称,并想查看该VM使用哪个存储.或者,查询特定的存储帐户并查看哪些VM使用该存储帐户也将是一件好事.
I am trying to find PowerShell cmdlet which can retrieve information about which storage account Azure VM use. Example, I want to supply name of VM and I would like to see which storage that VM use. Or it will be also good to query specific storage account and see which VMs use this storage account.
我正在尝试使用cmdlet,但看不到有关存储帐户的详细信息:
I am trying following cmdlets but I cannot see details about storage account:
Select-AzureSubscription -SubscriptionName "name" Get-AzureVM -Name "name" -ServiceName "name"推荐答案
Get-AzureDisk cmdlet可能对您有用.这就是我正在使用的方法.
The Get-AzureDisk cmdlet may be useful for you. This is the approach that I'm using.
$disk = Get-AzureDisk | Where-Object { $_.AttachedTo.RoleName -eq "YOURVMNAME" } $mediaLink = $disk.MediaLink $storageAccountName = $mediaLink.Host.Split('.')[0]msdn.microsoft/en-us/library/azure/dn495125.aspx
更多推荐
获取Azure VM的存储帐户
发布评论