Search code examples
azureazure-storageazure-cloud-shell

Automating Azure Cloud Shell provision deprovision storage account


Need to Manage Azure Cloud Shell(ACS) storage account. As we have a huge audience who uses ACS it is difficult for us to manage individual storage. Sometimes we run short of the Storage account quota.

Is there a way to manage ACS storage via ARM/PowerShell.

Thank you in advance.


Solution

  • Per my understanding, you want to manage all ACS storage by PowerShell. Azure does not provide this kind of functionality natively, but each ACS storage assigned with a tag:ms-resource-usage:azure-cloud-shell: enter image description here

    so you can list all of them by PowerShell below:

    Get-AzResource -Tag @{ "ms-resource-usage"= "azure-cloud-shell"} -ResourceType "Microsoft.Storage/storageAccounts"
    

    Result: enter image description here

    So that you can manage them by PowerShell as you want.

    If you don't want users to create new ACS storage accounts to occupy the storage account quota of your subscription, you can create an Azure policy to disallow this creation, details see this official guide, and ask your users to use existing storage accounts.