Obtain Outbound IP Adresses for Azure Webapps in a Resource Group

Use this Powershell script to obtain the outbound IP addresses of each Webapp in an Azure Resource Group. These are the IP’s you want to grant access to in any external services.

##Azure Script to Obtain outbound IP addresses for each webapp in a named Resource Group
 [CmdletBinding()]
Param( 
        [parameter(Mandatory=$true)]
        [ValidateNotNullOrEmpty()]
        [String] 
        $Name 
        )
 $scSites = Get-AzureRmWebApp -ResourceGroupName $Name 
    foreach ($site in $scSites)
    {
     write-host "Web App: $($site.DefaultHostName)" -ForegroundColor Green 
   (Get-AzureRmResource -ResourceGroupName $Name -ResourceType Microsoft.Web/sites -ResourceName $site.SiteName).OutboundIpAddresses

     write-host "web App: $($site.OutboundIpAddresses)" -ForegroundColor Yellow

    }

https://github.com/schoonercg/azuretools/blob/master/GetIPs.ps1

Facebooktwittergoogle_plusredditpinterestlinkedinmail

Leave a Reply

Your email address will not be published. Required fields are marked *