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:
- Export the root certificate (Base-64 encoded
.cerfile)- Export a root certificate. - 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.