Seeking solutions to DNS resolution issues in Azure Functions

Daniel 50 Reputation points
2025-03-18T09:44:01.1133333+00:00

Hi,

We are getting frequent DNS Name resolution errors all of a sudden for our Azure Function. It will work for many hours/days and then stop working. The issue is with Azure, as we connect to the server from other sources without problems. Have tried setting custom DNS servers to 1.1.1.1 and 8.8.8.8 with no success. I have also set WEBSITE_DNS_SERVER in environment variables to the custom DNS servers, this did not help either.

The error message:

An error occurred while processing the request. Error: HTTPSConnectionPool(host='mail.REDACTED.com', port=443): Max retries exceeded with url: /EWS/Exchange.asmx (Caused by NameResolutionError("<urllib3.connection.HTTPSConnection object at 0x7fdd30044800>: Failed to resolve 'mail.REDACTED.com' ([Errno -3] Temporary failure in name resolution)"))

What can we do to solve this?

Azure Functions
Azure Functions

An Azure service that provides an event-driven serverless compute platform.


1 answer

Sort by: Most helpful
  1. LeelaRajeshSayana-MSFT 17,871 Reputation points Moderator
    2025-03-29T00:09:12.09+00:00

    @Daniel We noticed that this problem was observed during the scale-out process of your Function App. When a new instance was added, it failed to start as expected, and shortly after, the other instances also began to fail during their operation. Following several attempts to start and allocate jobs, these instances gradually shut down.

     

    Unfortunately, there are no logs that definitively confirm the root cause. What we can conclude is that the problem stems from the platform in some form. As a temporary work around until the team resolves this issue the suggestion is to implement the Auto-Heal option as below

    To configure Auto-Heal for detecting and recovering from such random Function App offline failures, you can set up rules based on specific conditions like high memory usage, frequent crashes, or lack of activity. Here’s a basic example of how you can configure Auto-Heal:

    1. Navigate to your App Service in the Azure portal.
    2. Select “Diagnose and solve problems” from the left-hand menu.
    3. Under “Diagnostic Tools,” select “Auto-Heal.”
    4. Add a rule to monitor specific conditions (500 HTTP status codes in this case).
    5. Set the action to “Recycle” the worker process or “Restart” the app service.

    For more detailed steps, you can refer to the Auto-Heal documentation on Microsoft Learn.

    Announcing the New Auto Healing Experience in App Service Diagnostics - Azure App Service

    I will update this thread once the underlying issue has been fixed. I apologize for the inconvenience this issue has caused you and appreciate your patience in trying to resolve the issue.

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.