I deployed a function in Azure that is triggered by a timer, every 5 minutes it executes a GET request to an API and stores the results into MongoDB hosted in a server.
Running the function in my localhost accessing the same MongoDB server works fine, but running the function on Azure I get a exception precisely every 10 minutes (or 2 function executions) as we can see bellow:
The exception throw is the following:
A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
I have tried changing the MongoDB client configuration, but didn't work. Any ideias why this happens on Azure and not on the localhost emulator? And more importantly, is there any fix or work around?
Thank you!