How to fix frequent DNS resolution fails in Azure functions?

Jannes Wübbena (Geo++) 15 Reputation points
2024-03-12T13:36:01.4533333+00:00

Since 4 days (08th of March), our daily running Azure functions script that synchronizes a couple of data sources via public REST apis is experiencing DNS problems every day. The error messages are as follows:

Result: Failure Exception: ConnectionError: HTTPSConnectionPool(host='api.personio.de', port=443): Max retries exceeded with url: /v1/company/attendances (Caused by NameResolutionError("

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,929 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Tom Wilson 0 Reputation points
    2024-09-24T18:19:36.0733333+00:00

    Solution: Stop using the "Default (Azure provided)" DNS service

    This worked for us so I am posting it as an answer.

    • From the Azure portal, select your Azure Function, and go to the Networking page (that's on the left side menu now, but they "improve" the interface all the time so it might be somewhere else)
    • Under "Outbound traffic configuration" go to "Outbound DNS"
    • Change from "Default (Azure provided)" to "Custom" and add the DNS server addresess of your choice. We used the well-known Google servers at 8.8.8.8 and 4.4.4.4.
    • Don't forget to save this setting, and you will likely have to restart your Azure Function

    This worked for us immediately, and the usually-intermittent (but today, consistent) DNS errors disappeared. For details on our rig, please see my comment on the original question.

    0 comments No comments

  2. Ahmed Ibrahem 0 Reputation points
    2024-12-23T12:47:33.0533333+00:00

    I am encountering an issue that occurs intermittently with the Flex Consumption Plan. I did not face these errors with the standard Consumption Plan, but I had to upgrade due to timeout constraints. Unfortunately, this issue severely limits and renders our work built on Azure Functions useless.

    I have tried overriding the DNS providers as suggested in other solutions, but the issue persists. Additionally, I have attempted to use the network debugging features, but they do not work in this case, as I encounter a Kudu error. I have also tried multiple regions in Europe, but I keep running into this issue in all of them.

    0 comments No comments

Your answer

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