Home
%3CLINGO-SUB%20id%3D%22lingo-sub-830200%22%20slang%3D%22en-US%22%3ECould%20not%20reach%20the%20Web%20Deploy%20endpoint%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-830200%22%20slang%3D%22en-US%22%3E%3CP%3EYou%20can%20publish%20your%20website%20directly%20to%20an%20Azure%20Virtual%20Machine%20by%20using%20Visual%20Studio.%20However%2C%20you%20may%20run%20into%20this%20error%20message%20after%20selecting%20the%20VM%3A%20%E2%80%9C%3CSTRONG%3ECould%20not%20reach%20the%20Web%20Deploy%20endpoint%20on%20the%20specified%20virtual%20machine%3C%2FSTRONG%3E%E2%80%9C%3C%2FP%3E%0A%3CDIV%20id%3D%22tinyMceEditorclipboard_image_0%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CH3%20id%3D%22toc-hId-1622615038%22%20id%3D%22toc-hId-1622615038%22%3ESolution%3C%2FH3%3E%0A%3CP%3EThe%20machine%20Visual%20Studio%20is%20trying%20to%20connect%20should%20be%20listening%20the%20port%26nbsp%3B%3CSTRONG%3E8172%3C%2FSTRONG%3E.%20Run%20the%20following%20command%20in%20the%20target%20VM%20to%20see%20if%20it%20is%20listening%20to%20this%20port%3A%3C%2FP%3E%0A%3CP%3E%3CCODE%3Enetstat%20-ano%3C%2FCODE%3E%3C%2FP%3E%0A%3CP%3EAdditionally%2C%20make%20sure%20that%20IIS%20Management%20Service%20is%20installed%20and%20running%3A%3C%2FP%3E%0A%3CDIV%20id%3D%22tinyMceEditorclipboard_image_1%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20515px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F129264i54E107BF36E353C4%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%2222.png%22%20title%3D%2222.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EFinally%2C%20go%20to%20IIS%20Manager%20and%20open%20%E2%80%9CManagement%20Service%E2%80%9D.%20Make%20sure%20that%20it%20is%20enabled%20for%20remote%20connections.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20840px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F129263i2F3913388DE4EF5F%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%2233.png%22%20title%3D%2233.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CDIV%20id%3D%22tinyMceEditorclipboard_image_2%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CH3%20id%3D%22toc-hId--929541923%22%20id%3D%22toc-hId--929541923%22%3EA%20related%20error%3A%20%E2%80%9CCould%20not%20verify%20the%20server%E2%80%99s%20certificate%E2%80%9D%3C%2FH3%3E%0A%3CP%3EAfter%20solving%20previous%20error%2C%20you%20may%20run%20into%20another%20issue%20while%20trying%20to%20publish%20the%20web%20application%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22padding-left%3A%2030px%3B%22%3E%3CEM%3EWeb%20deployment%20task%20failed.%20(Connected%20to%20the%20remote%20computer%20(%E2%80%9Ctestsite.azure.com%E2%80%9D)%20using%20the%20specified%20process%20(%E2%80%9CWeb%20Management%20Service%E2%80%9D)%2C%20but%20could%20not%20verify%20the%20server%E2%80%99s%20certificate.%20If%20you%20trust%20the%20server%2C%20connect%20again%20and%20allow%20untrusted%20certificates.%20Learn%20more%20at%3A%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fiis%2Fpublish%2Ftroubleshooting-web-deploy%2Fweb-deploy-error-codes%23errorcertificatevalidationfailed%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttp%3A%2F%2Fgo.microsoft.com%2Ffwlink%2F%3FLinkId%3D221672%23ERROR_CERTIFICATE_VALIDATION_FAILED%3C%2FA%3E.)%20%3C%2FEM%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EHere%20is%20the%20solution%3A%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3ECheck%20%E2%80%9C%3CSTRONG%3EAllow%20untrusted%3C%2FSTRONG%3E%E2%80%9D%20option%20in%20the%20Publish%20wizard%20(if%20it%20is%20available%20-%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fiis%2Fpublish%2Ftroubleshooting-web-deploy%2Fweb-deploy-error-codes%23errorcertificatevalidationfailed%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EReference%3C%2FA%3E)%3C%2FLI%3E%0A%3CLI%3EAdd%20the%20following%20lines%20to%20your%20publish%20profile%20(Publish%20profiles%20are%20located%20in%26nbsp%3B%3CCODE%3EC%3A%5CUsers%5Cusername%5Csource%5Crepos%5Capplicationname%5CProperties%5CPublishProfiles%3C%2FCODE%3E%3A(%3C%2Fimg%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3E%3CUSEMSDEPLOYEXE%3Etrue%3C%2FUSEMSDEPLOYEXE%3E%3CALLOWUNTRUSTEDCERTIFICATE%3Etrue%3C%2FALLOWUNTRUSTEDCERTIFICATE%3E%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EReinstall%20msdepsvc%20(MS%20Deploy%20service%20for%20Remote%20Agent)%3C%2FLI%3E%0A%3C%2FUL%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-830200%22%20slang%3D%22en-US%22%3E%3CP%3EYou%20can%20publish%20your%20website%20directly%20to%20an%20Azure%20Virtual%20Machine%20by%20using%20Visual%20Studio.%20However%2C%20you%20may%20run%20into%20this%20error%20message%20after%20selecting%20the%20VM%3A%20%E2%80%9C%3CSTRONG%3ECould%20not%20reach%20the%20Web%20Deploy%20endpoint%20on%20the%20specified%20virtual%20machine%3C%2FSTRONG%3E%E2%80%9C%3C%2FP%3E%3C%2FLINGO-TEASER%3E
Microsoft

You can publish your website directly to an Azure Virtual Machine by using Visual Studio. However, you may run into this error message after selecting the VM: “Could not reach the Web Deploy endpoint on the specified virtual machine

 

Solution

The machine Visual Studio is trying to connect should be listening the port 8172. Run the following command in the target VM to see if it is listening to this port:

netstat -ano

Additionally, make sure that IIS Management Service is installed and running:

 

22.png

Finally, go to IIS Manager and open “Management Service”. Make sure that it is enabled for remote connections.

33.png

 

A related error: “Could not verify the server’s certificate”

After solving previous error, you may run into another issue while trying to publish the web application:

 

Web deployment task failed. (Connected to the remote computer (“testsite.azure.com”) using the specified process (“Web Management Service”), but could not verify the server’s certificate. If you trust the server, connect again and allow untrusted certificates. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_CERTIFICATE_VALIDATION_FAILED.)

 

 

Here is the solution:

  • Check “Allow untrusted” option in the Publish wizard (if it is available - Reference)
  • Add the following lines to your publish profile (Publish profiles are located in C:\Users\username\source\repos\applicationname\Properties\PublishProfiles:(

 

<UseMSDeployExe>true</UseMSDeployExe><AllowUntrustedCertificate>true</AllowUntrustedCertificate>

 

  • Reinstall msdepsvc (MS Deploy service for Remote Agent)