Azure ARM Reserved Public Ip Addresses via Powershell

I’ve had the situation where the full allocation of IP addresses are needed up front for firewall configuration. This isn’t so bad when you only need a few, but if you’re going for your full allocation of 20 (or more if you’ve spoken to Microsoft Support) then it can get a little tedious using the Azure Portal UI.

The typical output from this should be something like;

My_IPBag_1 Succeeded
My_IPBag_2 Succeeded
My_IPBag_3 Succeeded
My_IPBag_4 Succeeded
My_IPBag_5 Succeeded
My_IPBag_6 Succeeded
My_IPBag_7 Succeeded
My_IPBag_8 Succeeded
My_IPBag_9 Succeeded
My_IPBag_10 Succeeded
My_IPBag_11 Succeeded

Note that the assigned IP addresses are not in a continuous range 🙂

If you do try to obtain more than 20 Public IP Addresses in your subscription then you’ll get this friendly error message.

New-AzureRmPublicIpAddress : Cannot create more than 20 public IP addresses with static allocation method for this subscription in this region.