IIS MSDeploy doesn`t work with appgateway v2 and self signed certificate

Yehor Sereda 0 Reputation points
2025-09-03T14:08:45.8+00:00

I migrated from Azure AppGateway v1 to v2 and configured self signed ssl certificate for configuration of backend setting with msdeploy.axd on 8172 port and ssl root certificate for WMSVC according to this doc: https://free.blessedness.top/en-us/azure/application-gateway/self-signed-certificates

Currently IIS configured to use this certificate and authenticate only Windows Management Service with windows credentials or IIS Manager creds. Backend healthprobe shows healthy status and it responce code is 401 and it`s ok. Problem is when I am trying to make msbuild with deploy parameter and AllowUntrustedCertificate and it fails each time with below error:

C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Microsoft\VisualStudio\v17.0\Web\Microsoft.Web.Publishing.targets(4455,5): error : Web deployment task failed. ((9/3/2025 1:52:14 PM) An error occurred when the request was processed on the remote computer.)

When I try to search any info in Event Viewer for WebDeploy it shows this error:

Content-Type:

Version: 9.0.0.0

MSDeploy.VersionMin:

MSDeploy.VersionMax:

MSDeploy.Method:

MSDeploy.RequestId:

MSDeploy.RequestCulture:

MSDeploy.RequestUICulture:

ServerVersion: 9.0.1973.0

A tracing deployment agent exception occurred that was propagated to the client. Request ID ''. Request Timestamp: '9/3/2025 1:52:14 PM'. Error Details:

System.ArgumentNullException: Value cannot be null.

Parameter name: input

at System.Version.Parse(String input)

at System.Version..ctor(String version)

at Microsoft.Web.Deployment.DeploymentAgentWorkerRequest.get_MaximumSupportedVersion()

at Microsoft.Web.Deployment.DeploymentAgent.HandleClientServerVersionMismatch(DeploymentAgentWorkerRequest workerRequest)

at Microsoft.Web.Deployment.DeploymentAgent.HandleRequestWorker(DeploymentAgentAsyncData asyncData)

at Microsoft.Web.Deployment.DeploymentAgent.HandleRequest(DeploymentAgentAsyncData asyncData)

Multiple times checked configuration of IIS, Gateway and SSL certs and it seems that everything looks correct but problem occurs or on gateway side or on auth with ssl. Can you please provide any info how to resolve this issue and what this error means?

Azure Application Gateway
Azure Application Gateway
An Azure service that provides a platform-managed, scalable, and highly available application delivery controller as a service.
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Thanmayi Godithi 1,635 Reputation points Microsoft External Staff Moderator
    2025-09-03T18:21:12.4366667+00:00

    Hi @Yehor Sereda,

    Thank you for reaching out on the Microsoft Q&A forum.

    I understand that after migrating from Application Gateway v1 to v2, you configured IIS with a self-signed SSL certificate for Web Deploy (msdeploy.axd over port 8172). You mentioned that the backend health probe shows as healthy (401), but when deploying through MSBuild with AllowUntrustedCertificate, the deployment fails with the error:

    System.ArgumentNullException: Value cannot be null.  
    Parameter name: input  
    at System.Version.Parse(String input)  
    at System.Version..ctor(String version)  
    at Microsoft.Web.Deployment.DeploymentAgentWorkerRequest.get_MaximumSupportedVersion()
    

    In Application Gateway v2 SKU, the certificate handling model is different from v1. Application Gateway v2 only accepts trusted root certificates for backend authentication. Unlike v1, where you could upload a self-signed certificate, in v2 this is not supported. If your IIS server is using a self-signed certificate, Application Gateway will fail to trust it unless its root certificate is uploaded to the backend HTTP settings. This stricter validation ensures that the TLS handshake between the gateway and the backend can complete successfully. Without trust, the handshake can fail silently, causing Web Deploy requests to break and resulting in incomplete metadata being sent to IIS, which explains why the deployment agent throws parsing errors.

    You can find the relevant documentation here:

    Certificates required for backend authentication in Application Gateway v2

    Using self-signed certificates with Application Gateway

    If you would like to continue using a self-signed certificate, you will need to:

    1. Export the root certificate (Base-64 encoded .cer file)- Export a root certificate.
    2. Upload the root certificate in Application Gateway > Backend HTTP Settings > Trusted root certificates.

    Once the root certificate is registered, Application Gateway will be able to establish a trusted TLS connection to IIS, and your Web Deploy traffic should flow correctly.

    Could you please confirm whether you have already uploaded the root certificate into the Application Gateway backend HTTP settings?

    If not, please try the steps above and let us know if this resolves the issue.

    Please "Accept the answer" if the information helped you. This will help us and others in the community as well.


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.