Azure webjobs are unable to connect to sharepoint online: For security reasons DTD is prohibited in this XML document

Fernando Leitzelar 21 Reputation points
2020-07-01T21:32:27.687+00:00

Azure webjobs are unable to connect to sharepoint online. The error message is:
For security reasons DTD is prohibited in this XML document. To enable DTD processing set the DtdProcessing property on XmlReaderSettings to Parse and pass the settings into XmlReader.Create method

The issue is well documented and it is caused by a CNAME entry (MSOID). I fixed the issue locally using the following entries in the hosts file:
127.0.0.1 msoid.tenantdomain.onmicrosoft.com
127.0.0.1 msoid.onmicrosoft.com

Since the Azure WebJob runs in multiple containers, the Webjob fails intermittently, depending on what the host configuration is.

Is there a way to force the container running an Azure Webjob to resolve the MSOID names.

Azure Container Instances
Azure Container Instances
An Azure service that provides customers with a serverless container experience.
711 questions
Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,073 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,893 questions
{count} votes

Accepted answer
  1. prmanhas-MSFT 17,906 Reputation points Microsoft Employee
    2020-07-06T12:17:38.33+00:00

    @FernandoLeitzelar-0895 Apologies for the delay in response.

    One of the way to avoid the problem of setting hostname manually is to use Azure DNS. You can create an azure DNS entry for specific private network (with entries which you are creating on the host directly) and then associate the azure Web jobs to this private network.

    Using this mechanism, you can avoid creating DNS entries and manage the entries from central place.

    Web jobs when run in these private network would use the DNS entries configured to fetch the DNS mapping. You can read more about azure DNS here

    Hope this helps.

    Please 'Accept as answer' if it helped, so that it can help others in the community looking for help on similar topics.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

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.