Update network configuration on multiple storage accounts

Aleks G

I have 70+ storage accounts in my Azure account. All of them have network settings configured to allow access from certain vnets and from allowed set of IP addresses. I now need to add several more IP ranges to each of these accounts - these are the same ranges for all accounts.

Storage accounts are in many different resource groups.

While I could of course go through each one individually and make the changes via the portal, this seems to me like a massive waste of time. Is there an easier/quicker way?

amit_g

Use CLI (Bash example below). Execute this in cloud shell and it would iterate through all the storage accounts that you have access to in current subscription and create command to add a network rule (IP 12.34.56.78/24). Run and test a command manually and if it looks good, add | sh in the command to execute all

az storage account list --query '[].{ name: name, resourceGroup: resourceGroup }' -o tsv |
  awk '{ print "az storage account network-rule add -g " $2 " --account-name " $1 " --ip-address 12.34.56.78/24" }'

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Copy blob between storage accounts

Azure: Why is it advised to use multiple storage accounts for a virtual machine scale set?

Multiple G Suite Accounts

Single centralized configuration settings storage for multiple distributed .net services

Terraform - deploying in multiple accounts

Handle blob events from storage accounts in multiple Azure Subscriptions in different AD Tenants?

Fallback storage account (or multiple storage accounts) for Azure CDN

Kubernetes on AWS with multiple accounts?

Grouping multiple accounts with dplyr

Backing up multiple accounts

Mirror cloud storage accounts

Unable to access CentOS setup Network Configuration after attempting Python update

How to update the current user (Accounts)

Multiple Firefox Sync accounts

Network Manager, create multiple lan connection configuration for the same wired card

Multiple accounts with afew

Using a CDN with the new azure storage accounts

Converting Azure "classic" storage accounts

How can I set up multiple storage accounts and one custom domain on Microsoft Azure CDN

Google chrome.storage.sync: if multiple Google accounts log in and out of the same computer does their data get shared?

Woocommerce - Multiple banking accounts

Output network switch configuration txt to csv multiple columns

Copy GC Storage through multiple accounts

Multiple RingCentral Sandbox Accounts

Specifying multiple storage accounts for Kusto export

Azure bicep loop storage accounts

Handle multiple accounts in react

firefox and multiple outlook accounts

Pushing Code to Repositories Under Multiple GitHub Accounts with SSH Configuration Issue