Search code examples
azurecommand-line-interfacestorageaccount

Disable entire Azure storage account


Is it possible to disable the entire storage account using az cli? I looked through all properties for a storage account and couldn't find anything related to it.

Thanks.


Solution

  • Is it possible to disable the entire storage account using az cli?

    AFAIK, There is no direct command to disable the entire storage account using Azure CLI.

    I agree with both acrophat's and Anthony Norwood's comments.

    • First, you need to remove all RBAC permissions except yours or a subset of your accounts so that no one may access it.
    • To invalidate any SAS tokens, you would probably have to rotate the keys.
    • Another thing is to disable the networking.

    You can use the below command to disable networking.

    Command:

    az storage account update --name MyStorageAccount --resource-group MyResourceGroup --public-network-access Disabled
    

    Output:

    "provisioningState": "Succeeded",
     "publicNetworkAccess": "Disabled",
    

    Portal: enter image description here

    Now users like reader role can't able to read the files.

    enter image description here

    Reference:

    Configure Azure Storage firewalls and virtual networks | Microsoft Learn