【问题标题】:How to get storage account id given storage account name and resource group using azure powershell command?如何使用 azure powershell 命令获取给定存储帐户名称和资源组的存储帐户 ID?
【发布时间】:2021-05-26 13:51:06
【问题描述】:

我是 azure-CLI 的初学者。

我只是想找出存储帐户 ID。

我有一个名为“group2”的资源组和一个名为“storageacc1”的存储帐户。

我尝试了以下 PowerShell 命令来获取存储帐户详细信息:

Get-AzStorageAccount -ResourceGroupName "group2" -AccountName "storageacc11"

在返回中,我得到了 StorageAccountName、ResourceGroupName、PrimaryLocation、SkuName、Kind、AccessTier、CreationTime、ProvisioningState、EnableHttpsTrafficOnly、LargeFileShares。

如何获取存储帐户 ID?

【问题讨论】:

    标签: azure azure-storage azure-powershell azure-storage-account


    【解决方案1】:

    只需使用代码:

    $s = Get-AzStorageAccount -ResourceGroupName "xx" -AccountName "xx"
    
    $s.Id
    

    【讨论】:

      猜你喜欢
      • 2021-06-10
      • 2017-06-28
      • 2018-02-10
      • 2021-01-31
      • 2017-06-20
      • 2020-01-13
      • 1970-01-01
      • 1970-01-01
      • 2015-05-13
      相关资源
      最近更新 更多