Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Get all the storage accounts
- $all = Get-AzureRmResource | where-object { $_.ResourceType -like "Microsoft.Storage/storageAccounts" }
- # Enable the firewall on all storage accounts and add the IP addresses 1.1.1.1 / changes 1.1.1.1. to your own IP addresses
- foreach ($item in $all)
- {
- Update-AzureRmStorageAccountNetworkRuleSet -ResourceGroupName $item.ResourceGroupName -AccountName $item.Name -Bypass AzureServices,Metrics,Logging -DefaultAction Deny -IpRule (@{IPAddressOrRange="1.1.1.1";Action="allow"},@{IPAddressOrRange="1.1.1.1";Action="allow"},@{IPAddressOrRange="1.1.1.1";Action="allow"},@{IPAddressOrRange="1.1.1.1";Action="allow"})
- }
Add Comment
Please, Sign In to add comment