I have developed a PowerShell script to send mail to specified users using MX record DNS once in a day. Mails are delivered successfully but all mails are going in to Junk folder.
Exchange team have analyzed the message header and responded that sender IP addresses needs to be white-listed.
How to find Azure Function IP or IP range as I am using Consumption plan for my Function App.
Regards, K Senthilrajan
In order to whitelist IP address for the Azure function, Follow the below steps Once you logged in to the Azure Portal, Navigate to the Azure Function App On the Azure Function App page, click on the Networking option from the left side navigation and then click on the Configure Access restrictions under the Access Restrictions options
In real-time, we will meet with the scenario where In order to Secure your Azure Function App, you need to allow some specific set range of IP addresses that are authorized by your Organisation and you need to restrict all other IP addresses that are unauthorized as per your organization. This is called whitelisting.
To find that IP address: Sign in to the Azure portal. Navigate to the function app. Under Settings, select Properties. The inbound IP address appears under Virtual IP address.
1 Sign in to the Azure Resource Explorer. 2 Select subscriptions > {your subscription} > providers > Microsoft.Web > sites. 3 In the JSON panel, find the site with an id property that ends in the name of your function app. 4 See outboundIpAddresses and possibleOutboundIpAddresses.
Unfortunately things have changed since Kim's answer. You now have to go into a JSON file via Azure Resource Manager to find the possible outbound IP addresses. Per the current Microsoft documentation:
- Sign in to the Azure Resource Explorer.
- Select subscriptions > {your subscription} > providers > Microsoft.Web > sites.
- In the JSON panel, find the site with an id property that ends in the name of your function app.
- See outboundIpAddresses and possibleOutboundIpAddresses.
Alternatively, you can also do it via the Az Powershell Module:
az webapp show --resource-group <group_name> --name <app_name> --query outboundIpAddresses --output tsv
az webapp show --resource-group <group_name> --name <app_name> --query possibleOutboundIpAddresses --output tsv
In the background behind an Azure Function is an Azure App Service. So, how do you find the IP addresses it use?
There is the section containing current outbound IP addresses in the App Service settings page, see
But keep in mind, since the platform is a PaaS service, it might, without any notice, move to other hardware and get a totally different set of outbound IP addresses.
See this twitter conversation with Azure Support, for more details. Conclusion of the discussion is the IP range is not static and may change.
The only surefire way to know what IP's an Azure Function may be using, is to refer to the XML document published by Microsoft Azure that contain the entire IP range of all data centers, making this task a little difficult to implement.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With