When making an outbound network call from Azure App Services it can be useful to know your application’s outbound IP addresses. Usually, you will use this information to configure the firewalls of external services to allow requests from your application. In Azure, your application’s outbound IP addresses are fixed. This post explains where to find your application’s IP addresses using the portal, the Resource Explorer, Powershell and the Azure CLI.
It’s useful to note that this isn’t necessary for outbound calls to Azure SQL Server if you are using the “Allow all Azure Services” firewall setting.
Portal
In the Azure Portal navigate to the App Service blade for your application. Select ‘Properties’ in the blade’s left navigation to find useful information about your application - including a list of outbound IP addresses.
Resource Explorer
The same information is available from the Resource Explorer. In the explorer select your application from the resource tree on the left or navigate directly to your application using the URL template below:
https://resources.azure.com/subscriptions/[subscription-id]/resourceGroups/[resource-group-id]/providers/Microsoft.Web/sites/[resource-name]
In the output panel, you will see the “outboundIpAddresses” property, which will contain a comma-separated list of IP addresses.
Powershell
Using Azure’s Powershell module you can run the following command to list your application’s outbound IP addresses:
(Get-AzureRmWebApp -Name [name] -ResourceGroupName [resource-group-name]).OutboundIpAddresses -split ","
Azure CLI
If you’re using the Azure CLI, you can run the following command to retrieve your application’s configuration as JSON.
az webapp show [resource-group-name] [name] --json
Within the JSON printed in your console, you will see a comma-separated list of IP addresses in the ‘outboundIpAddresses’ property.