问题描述
需要管理 Azure Cloud Shell (ACS) 存储帐户。由于我们有大量使用 ACS 的用户,因此我们很难管理单个存储。 有时我们会用完存储帐户配额。
有没有办法通过 ARM/PowerShell 管理 ACS 存储。
提前致谢。
解决方法
据我了解,您希望通过 PowerShell 管理所有 ACS 存储。 Azure 本身不提供这种功能,但每个 ACS 存储都分配有一个标记:ms-resource-usage:azure-cloud-shell
:
所以你可以通过下面的 PowerShell 列出所有这些:
Get-AzResource -Tag @{ "ms-resource-usage"= "azure-cloud-shell"} -ResourceType "Microsoft.Storage/storageAccounts"
以便您可以根据需要通过 PowerShell 管理它们。
如果您不希望用户创建新的 ACS 存储帐户来占用您订阅的存储帐户配额,您可以创建 Azure 策略来禁止此创建,详细信息请参见{{3} },并要求您的用户使用 this official guide。