List storage accounts opened to public network (Internet)
I want to have a status of my storage accounts that are opened to Internet, without any network restrictions.
In the Azure Portal, it is about going to the storage account "networking" menu and the "Firewalls and virtual networks" tab.
But I have thousands of storage network...
Use "az storage account show"
If Public network access: Disabled
az storage account show --name 'storageaccountname1' | jq '.networkRuleSet' { "bypass": "AzureServices", "defaultAction": "Deny", "ipRules": [], "resourceAccessRules": [], "virtualNetworkRules": [] }
Note the "defaultAction": "Deny"
If Public network access: Enabled from all networks
az storage account show --name 'storageaccountname1' | jq '.networkRuleSet' { "bypass": "AzureServices", "defaultAction": "Allow", "ipRules": [], "resourceAccessRules": [], "virtualNetworkRules": [] }
Note the "defaultAction": "Allow"
Warning about "az storage account network-rule list"
The documentation states that "az storage account network-rule list" is supposed to show the network rules, but is does not show "defaultAction"
az storage account network-rule list --account-name 'storageaccountname1' { "ipRules": [], "resourceAccessRules": [], "virtualNetworkRules": [] }