List all App Service web apps outbound IP addresses used in a subscription

If you want to perform IP whitelisting against an App Service, you'll discover that on public instances of App Service (not App Service Environment) you have 4 or more outbound IP addresses.

I was in a situation where I needed to get all outbound IP addresses over multiple subscriptions for IP whitelisting purposes. With the help of PowerShell I created a little script that will do just that here is an example of the output:

.\Get-AppServiceWebAppsOutboundIpAddresses.ps1' -SubscriptionName 'mysub1','mysub2

Switching to subscription mysub1
Switching to subscription mysub2

Count IpAddress       Sites                                                                                                                                                           
----- ----            -----                                                                                                                                                           
    2 13.85.17.60     {sub1-bi-dev-as-webapp, sub2-bi-prod-as-webapp}                                                                                                     
    2 13.85.20.144    {sub1-bi-prod-as-webapp, sub1-bi-dev-as-webapp}                                                                                                     
    2 13.85.22.206    {sub2-bi-prod-as-webapp, sub1-bi-dev-as-webapp}                                                                                                     
    2 13.85.23.148    {sub1-bi-dev-as-webapp, sub2-bi-prod-as-webapp}                                                                                                     
    2 13.85.23.243    {sub1-bi-dev-as-webapp, sub2-bi-prod-as-webapp}                                                                                                     
    1 23.96.184.12    {sub1-dev-functions-mmckydd}                                                                                                                                
    1 23.96.184.209   {sub1-dev-functions-mmckydd}                                                                                                                                
    1 23.96.186.252   {sub1-dev-functions-mmckydd}                                                                                                                                
    1 23.96.187.50    {sub1-dev-functions-mmckydd}                                                                                                                                
    5 23.96.244.71    {sub1-stg-webapp-web-n7wfdda, sub1-stg-functions-n7wfdda, sub1-stg-webapp-admin-n7wfdda, sub1-dev-ops-functions-stl4tn5...}                  

If you are interested to have a sorted, unique list of IPs used in your App Services, this script is for you.

You can get it on the Script Center:
https://gallery.technet.microsoft.com/scriptcenter/List-all-App-Service-web-4d563f14