删除Azure存储帐户密钥

时间:2019-11-05 17:57:53

标签: azure powershell azure-storage-account

我需要删除预订的存储帐户中的所有身份验证密钥。您知道是否可以删除它吗?我正在Powershell中寻找一个cmdlet来执行此操作,但是找不到它。

我能够检索“存储帐户”列表并检查是否存在验证密钥集,但是无法将其删除。我试图将它们设置为null,但是没有用

$colStorageAccounts = Get-AzureRMStorageAccount
for ($objStorageAccount in $colStorageAccounts)
{
    $objAccountKey = Get-AzureRMStorageAccountKey -ResourceGroupName $objStorageAccount.ResourceGroupName -AccountName $objStorageAccount.Id
    if ($objAccountKey -ne $null)
    {
        here i should set the code for remove it
    }
}

1 个答案:

答案 0 :(得分:0)

从azure存储模块支持的commands列表中可以看到,没有命令删除帐户密钥,而是可以根据需要删除容器或从门户中生成一个新容器。 / p>