【问题标题】:Powershell command to retrieve storage account resource id, blob resourceid from Storage account V2用于从存储帐户 V2 检索存储帐户资源 ID、blob 资源 ID 的 Powershell 命令
【发布时间】:2021-06-10 04:41:06
【问题描述】:

我想使用 powershell 命令从存储帐户中检索所有组件资源 ID。

  • 存储帐户资源 ID
  • Blob 服务-资源 ID
  • 文件服务-资源 ID
  • 队列服务-资源 ID
  • 表服务-资源 ID

我尝试使用以下命令进行 blob 服务,但资源 ID 在属性中不可用

Get-AzStorageBlobServiceProperty -ResourceGroupName "rg-eval" -AccountName "dlseval"

如何动态检索资源 ID?

【问题讨论】:

    标签: azure-storage azure-powershell


    【解决方案1】:

    AFAIK,没有直接的方法可以得到你要找的所有ID,但是一旦你得到Storage Account Resource ID,你可以自己结合其他服务ID,它们是固定的,试试下面的代码:

    $account = Get-AzStorageAccount -ResourceGroupName '<Group Namw>' -Name '<account Name>' 
    
    $accountResID = $account.ID
    $blobResID = $account.ID + "/blobServices/default"
    $fileResID = $account.ID + "/fileServices/default"
    $queueResID = $account.ID + "/queueServices/default"
    $tableResID = $account.ID + "/tableServices/default"
    

    【讨论】:

      猜你喜欢
      • 2021-05-26
      • 1970-01-01
      • 2019-07-29
      • 2020-04-30
      • 1970-01-01
      • 2019-04-06
      • 1970-01-01
      • 1970-01-01
      • 2021-12-29
      相关资源
      最近更新 更多