获取Azure VM的存储帐户

编程入门 行业动态 更新时间:2024-10-23 16:24:03
本文介绍了获取Azure VM的存储帐户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在尝试找到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的存储帐户

本文发布于:2023-11-16 22:09:36,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1607668.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:帐户   Azure   VM

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!