How to fix frequent DNS resolution fails in Azure functions?

Jannes Wübbena (Geo++) 20 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.


1 answer

Sort by: Most helpful
  1. Tom Wilson 5 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.

    Was this answer helpful?

    1 person found this answer helpful.

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.