Skip to content

Ulysses Neves

Microsoft Entra ID, authentication, and hybrid identity troubleshooting.

Menu
  • Início
  • Microsoft Azure
  • Microsoft AD FS
  • Microsoft 365
  • Contact
Menu

AD FS – Troubleshooting AD FS event ‘web.config file is malformed’

Posted on 3 de April de 2021

Hi mates. Today we’re going to cover a specific error when establishing trust between Web Application Proxy and AD FS servers: “The Web request failed because the web.config file is malformed”.

The microsoft.identityServer.proxyservice.exe.config is a file that holds some proxy configurations such as trust certificate thumbprint, congestion control thresholds, client service ports, AD FS federation service name and other configurations.

Error

You might face error below when trying to establish or reestablish the trust between WAP and AD FS:

An error occurred attempting to update the proxy service configuration file. An error occurred when attempting to save the proxy configuration.

In case you are using the WAP configuration wizard, you might face error below:

More details about the error, you can find in the Event viewer » Applications and Services Logs » AD FS » Admin.

Log Name: AD FS/Admin
Source: AD FS
Event ID: 383
Task Category: None
Level: Error
Keywords: AD FS
Computer: WAP.domain
Description: The Web request failed because the web.config file is malformed.
User Action: Fix the malformed data in the web.config file.
Exception details:
Root element is missing. (C:\windows\ADFS\Config\microsoft.identityServer.proxyservice.exe.config)
Root element is missing.
Investigating the error

Once the event above give us more information about the issue, let’s check if the file microsoft.identityServer.proxyservice.exe.config is created and has the proxy configurations on it.

Checking C:\windows\ADFS\Config\ path, we opened the file and confirmed that it’s empty:

FIX:

To fix this issue, we need to recover the file microsoft.identityServer.proxyservice.exe.config before reestablishing the trust. To achieve this goal, we have two options:

Option 1 – Copy valid file from another WAP server

In case you have another working WAP server, follow steps below:

1 – Copy file microsoft.identityServer.proxyservice.exe.config from a WAP server that is working into folder C:\Windows\ADFS\Config in the non-working WAP server.
2 – Establish the trust between WAP and AD FS using commands below:

$FScredential = Get-Credential
Install-WebApplicationProxy -FederationServiceName "FS01.Contoso.com" -FederationServiceTrustCredential $FScredential -CertificateThumbprint "0a1b2c3d0a1b2c3d0a1b2c3d0a1b2c3d0a1b2c3d"

Note: Modify the Federation Service name and Certificate Thumbprint according to your environment.

Option 2 – Uninstall WAP role using PowerShell

To uninstall the feature using PowerShell, run command below:

Remove-WindowsFeature -Name Web-application-proxy

After the process is finished, reboot the WAP server.

Reinstalling WAP role using PowerShell

To reinstall the feature using PowerShell, run the command below:

Install-WindowsFeature Web-Application-Proxy -IncludeManagementTools

In my scenario, I renamed the blank configuration file to .old to confirm the new one was created by the wizard.

After the service is reinstalled, we can reestablish the trust using commands below:

$FScredential = Get-Credential
Install-WebApplicationProxy -FederationServiceName "FS01.Contoso.com" -FederationServiceTrustCredential $FScredential -CertificateThumbprint "0a1b2c3d0a1b2c3d0a1b2c3d0a1b2c3d0a1b2c3d"

Note: Modify the Federation Service name and Certificate Thumbprint according to your environment.

With the successful trust configuration. you might see event 245 being registered on WAP server:

Log Name: AD FS/Admin
Source: AD FS
Event ID: 245
Task Category: None
Level: Information
Keywords: AD FS
Computer: WAP
Description: The federation server proxy successfully retrieved and updated its configuration from the Federation Service ‘XXXXXXXX’.

Summary

In this article, we covered how to troubleshoot error ‘The Web request failed because the web.config file is malformed.’ when establishing the trust between WAP and AD FS server.

I hope you have enjoyed reading this article, and it helps you to manage your AD FS environment.

Enjoyed the article? Like and share. 🙂

In case you have any suggestion or feedback, please leave a comment.

[ ]’s

Ulysses Neves

6 thoughts on “AD FS – Troubleshooting AD FS event ‘web.config file is malformed’”

  1. Diogo says:
    11 de August de 2021 at 08:38

    Thank you for the detailed information / troubleshoot and solution.
    This has helped me to solve my issue 🙂

    Reply
    1. Uneves says:
      11 de August de 2021 at 10:34

      It’s a pleasure to help with this material, buddy! 🙂

      Reply
  2. Thomas says:
    9 de November de 2022 at 21:30

    Legend!

    3 hour outage resolved with your steps. Thank you good sir!

    Reply
    1. Uneves says:
      11 de November de 2022 at 12:10

      Hello Fahan! Nice that this article could help. Happy for you! 🙂

      Reply
  3. Jay says:
    5 de October de 2023 at 11:49

    This worked perfectly for me! Thank you much!

    Reply
    1. Uneves says:
      15 de October de 2023 at 14:29

      Happy to help! Thanks for the feedback.

      Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recent Posts

  • Microsoft Authenticator Will Block Jailbroken Devices in 2026 — What You Need to Know 17 de March de 2026
  • Enhancing Azure role activation security with FIDO2/Passkeys 23 de September de 2024
  • Microsoft Entra ID CAP | Enforcing WHfB using Authentication Strength 21 de April de 2024
  • Troubleshooting Error Code ‘0x000005e’ in WHfB: PIN Authentication Woes 11 de February de 2024
  • WHfB: Fixing Windows Hello for Business error ‘LogoncertTemplateReady: NO (StateNoTemplate)’ 29 de December de 2023

Archives

  • March 2026
  • September 2024
  • April 2024
  • February 2024
  • December 2023
  • September 2023
  • July 2023
  • June 2023
  • May 2023
  • April 2023
  • March 2023
  • February 2023
  • January 2023
  • December 2022
  • October 2022
  • September 2022
  • August 2022
  • July 2022
  • June 2022
  • May 2022
  • April 2022
  • March 2022
  • February 2022
  • January 2022
  • December 2021
  • November 2021
  • October 2021
  • September 2021
  • August 2021
  • July 2021
  • June 2021
  • May 2021
  • April 2021
  • March 2021
  • February 2021
  • January 2021
  • December 2020
  • November 2020
  • October 2020
  • September 2020
  • August 2020
  • July 2020
  • June 2020
  • May 2020
  • April 2020
  • March 2020
  • February 2020
  • January 2020
  • December 2019
  • November 2019
  • October 2019
  • September 2019
  • August 2019
  • July 2019

Tags

#aaddownleveldevice #aadhybridjoin #adfs #adfsonsql #azuread #azureauth #azureCA #azuredevice #azurehybridjoin #azuremfa #azuresecurity #capolicy #cloudkerberostrust #conditionalaccess #conditionalaccesspolicy #deviceregistration #gmsaaccount #gopasswordless #hybridaadjoin #mfaserver #msadfs #msazure #msidentity #namedlocation #sslcertificatevalidation #tshootadfs #tshoothybridjoin #tshootwaptrust #waptrust #WHFBcerttrust #whfbdeployment #WHfBhybridsetup #widdatabase adconnect authenticationcontext authenticationstrength az500 azuread azuremfa azurepim azuresecurity cloudsecurity microsoft365 msazure WHfB
©2026 Ulysses Neves | Design: Newspaperly WordPress Theme
Ulysses Neves
Gerenciar Consentimento de Cookies
Para fornecer as melhores experiências, usamos tecnologias como cookies para armazenar e/ou acessar informações do dispositivo. O consentimento para essas tecnologias nos permitirá processar dados como comportamento de navegação ou IDs exclusivos neste site. Não consentir ou retirar o consentimento pode afetar negativamente certos recursos e funções.
Funcional Always active
O armazenamento ou acesso técnico é estritamente necessário para a finalidade legítima de permitir a utilização de um serviço específico explicitamente solicitado pelo assinante ou utilizador, ou com a finalidade exclusiva de efetuar a transmissão de uma comunicação através de uma rede de comunicações eletrónicas.
Preferências
O armazenamento ou acesso técnico é necessário para o propósito legítimo de armazenar preferências que não são solicitadas pelo assinante ou usuário.
Estatísticas
O armazenamento ou acesso técnico que é usado exclusivamente para fins estatísticos. O armazenamento técnico ou acesso que é usado exclusivamente para fins estatísticos anônimos. Sem uma intimação, conformidade voluntária por parte de seu provedor de serviços de Internet ou registros adicionais de terceiros, as informações armazenadas ou recuperadas apenas para esse fim geralmente não podem ser usadas para identificá-lo.
Marketing
O armazenamento ou acesso técnico é necessário para criar perfis de usuário para enviar publicidade ou para rastrear o usuário em um site ou em vários sites para fins de marketing semelhantes.
  • Manage options
  • Manage services
  • Manage {vendor_count} vendors
  • Read more about these purposes
Ver preferências
  • {title}
  • {title}
  • {title}