How to find out the list of the containers who do not have the Immutable feature enabled under different 224 subscription

Prateek Rana 60 Reputation points
2023-05-31T12:39:03.7366667+00:00

Hi Team,

We have 224 subscriptions under these subscriptions we have lot of storage accounts. we want to know which storage/container are enabled with immutable features and which storage/container are not.

Please share the script which could help us to fetch this data in one Go.

Share the script for the TOP level (Tenant level) so that all the subscription will get covered under that and we can get a consolidate data.

Azure Storage Accounts
Azure Storage Accounts
Globally unique resources that provide access to data management services and serve as the parent namespace for the services.
2,941 questions
Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
2,635 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,326 questions
{count} votes

1 answer

Sort by: Most helpful
  1. KarishmaTiwari-MSFT 18,877 Reputation points Microsoft Employee
    2023-06-01T02:13:32.1633333+00:00

    @Prateek Rana
    Thanks for posting your query on Microsoft Q&A.

    You can use the following Azure CLI commands to create a script that fits your scenario:

    1. List all storage account in a subscription - https://learn.microsoft.com/en-us/cli/azure/storage/account?view=azure-cli-latest#az-storage-account-list
    2. List all containers in each storage account - https://learn.microsoft.com/en-us/cli/azure/storage/container?view=azure-cli-latest#az-storage-container-list
    3. List immutability policy for each container - https://learn.microsoft.com/en-us/cli/azure/storage/container/immutability-policy?view=azure-cli-latest#az-storage-container-immutability-policy-show
    0 comments No comments