1

Looks like something wrong with Azure App services and list of outbound IPs.

Recently my service stopped suddely working and it turned out that app could not connect to MongoDB as service was not in whitelist...

OK, I checked outbound IPs (App Service, Settings - Properties), added all Outbound IP addresses and Additional Outbound IP addresses to Mongo whitelist... Didn't help...

So I added into MongoDB access from all IPs - connection established...

Ok, I added simple http request into code to see outbound IP

   public static async Task Main(string[] args)
        {
            HttpClient client = new HttpClient();
            await client.GetAsync("https://requestinspector.com/inspect/<hereIsMyValue>");
            
            CreateHostBuilder(args).Build().Run();
        }

Service, re-deployed - and what I see - is totally different IP.. from 20.119.x.x range..

What's going on??? How come?

Vitaliy Markitanov
  • 2,205
  • 1
  • 24
  • 23
  • can you try `curl -s https://api.ipify.org` from the azure kudu? Just to confirm the outbound IP is not within the range `20.119.x.x`. There is another possibility if you enable `WEBSITE_VNET_ROUTE_ALL` and integrated with vnet + NAT gateway, so that NAT Gateway IP will get listed there- Refer https://techcommunity.microsoft.com/t5/apps-on-azure-blog/how-to-fix-outbound-ips-for-app-service/ba-p/2320612 – Jayendran Oct 01 '22 at 05:42
  • Actually I did this test and it had same IP as in my test code above. – Vitaliy Markitanov Oct 02 '22 at 14:47

0 Answers0