Publish ASP.NET Core 1.1 to a Linux based App Service - asp.net

When I'm trying to publish using Web Deploy (Visual Studio 2017 for Windows) to a Linux app service hosted in Azure the following error occurs:
Could not connect to the remote computer ("my-linux-api.scm.azurewebsites.net") using the specified process ("Web Management Service") because the server did not respond. Make sure that the process ("Web Management Service") is started on the remote computer. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_COULD_NOT_CONNECT_TO_REMOTESVC.
The remote server returned an error: (405) Method Not Allowed.
The link in the error description seems to refer windows based hosts.
The service is up and running and responds to my request:
How can I fix that?

There is no Web Deploy on Linux. That's a Windows/IIS thing.
Push with git instead. The .scm. service (Kudu) knows how to handle the ASP.NET Core deployment on Linux.

Related

Can't publish ASP.NET 6.0 website to Google Cloud Platform using Compute Engine : "Failed to publish project MyProject"

I want to deploy a website that I've made with ASP.NET 6.0 on GCP. The website is fully functional in localhost, but when I try to publish it, I get this error in my Visual Studio 2022 Output :
Publishing MyProject to Compute Engine.
Failed to publish project MyProject .
I've tried a lot of things to make it work, but still can't figure the problem. Here are the steps I've done :
On Google Compute Engine, I've created an instance for ASP.NET on a windows server 2016 machine.
I've changed the windows password and noted the: Username and Password.
On Visual Studio 2022, I've installed the Google Cloud Tool.
On the Google Cloud Tool, I've linked the google account I use for Google Cloud.
On the Google Cloud Tool, I've pressed "Publish to Google Cloud" and then pressed "Compute Engine".
I've selected the right project ID, the right VM instance and I wrote the right Account user name and password from step 2.
I've pressed "Publish".
This is what I got,
Output of VS 2022 :
Publishing MyProject to Compute Engine.
Failed to publish project MyProject.
The problem is that I can't see more information on why the deployment failed.
I've also tried to use the deploy service of Visual Studio 2022, and I get this error :
Build started...
1>------ Publish started: Project: MyProject, Configuration: Release Any CPU ------
MyProject-> C:\Users\MyProject\Desktop\MyProject\MyProject\MyProject\MyProject\bin\Release\net6.0\whatmain_support.dll
MyProject-> C:\Users\MyProject\Desktop\MyProject\MyProject\MyProject\MyProject\obj\Release\net6.0\PubTmp\Out\
C:\Program Files\dotnet\sdk\6.0.202\Sdks\Microsoft.NET.Sdk.Publish\targets\PublishTargets\Microsoft.NET.Sdk.Publish.MSDeploy.targets(140,5): Error : Web deployment task failed. (Could not connect to the remote computer ("ip.ip.ip.ip") using the specified process ("Web Deployment Agent Service") because the server did not respond. Make sure that the process ("Web Deployment Agent Service") is started on the remote computer. Learn more at: https://go.microsoft.com/fwlink/?LinkId=221672#ERROR_COULD_NOT_CONNECT_TO_REMOTESVC.)
Could not connect to the remote computer ("ip.ip.ip.ip") using the specified process ("Web Deployment Agent Service") because the server did not respond. Make sure that the process ("Web Deployment Agent Service") is started on the remote computer. Learn more at: https://go.microsoft.com/fwlink/?LinkId=221672#ERROR_COULD_NOT_CONNECT_TO_REMOTESVC.
The remote server returned an error: (503) Server Unavailable.
Publish failed to deploy.
1>Build failed. Check the Output window for more details.
========== Build: 0 succeeded, 0 failed, 1 up-to-date, 0 skipped ==========
========== Publish: 0 succeeded, 1 failed, 0 skipped ==========
I was with the same problem and I wasn't able to publish using the Google Cloud tools ("Publish to Google Cloud" button).
I use the normal "Publish" button.
First
You need to install the Web Deployment Agent Service in your VM instance and install Web Deploy 3.5
https://learn.microsoft.com/en-us/iis/install/installing-publishing-technologies/installing-and-configuring-web-deploy-on-iis-80-or-later
Second
Create your publish profile:
https://codelabs.developers.google.com/codelabs/cloud-compute-engine-aspnet#6
(to know your Site Name remote access your VM instance > IIS > Sites and make sure if it really is "Default Web Site")
That's it! This should work
BUT
If you still can't make this work, you probably got the error
Web deployment task failed. (Could not connect to the remote computer
("###.###.###.###") using the specified process ("Web Deployment Agent
Service") because the server did not respond. Make sure that the
process ("Web Deployment Agent Service") is started on the remote
computer. Learn more at:
http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_COULD_NOT_CONNECT_TO_REMOTESVC.)
if that happened, this thread should be able to help you.
Web deployment task failed. Could not connect...server did not respond
For me, this error happened and it was because I was passing my Host Name instead of "Default Web Site" but this can vary.
Good luck!

Unable to use MSDeploy from Local to Remote Server

Error image Unable to Remote Deploy my Webservice on to the remote machine from local machine. I have two servers that i would be needing to enable web deployment from local system to remote server Windows 2012 system. Upon searching multiple resources i found below steps that need to be ensured before performing the remote deploy using MsDeploy from Local to Remote .
Also Package works fine which is built from Visual Studio if i copy the files on to the remote server and run the command file it is able to deply the windows service on to IIS locally . But i would need this to be deployed from my local machine to remote server*
Steps I tried :
Ensure Web Deploy is installed.
Remote Services are running.
Under Management Service in IIS ensure Enable Remote connections
is enabled.
Ensure 80 and 8172 Ports are enabled and running ( ran the below steps )
Web Deploy is installed on the server that i'm trying to deploy the
package.
I try running the below code and it returns below error :
Command I provide :
C:\Users\xxxxx>net start wmsvc
The requested service has already been started.
C:\Users\xxxxxx>net start msdepsvc
The requested service has already been started.
Command I provide :
C:\Program Files\IIS\Microsoft Web Deploy V3>msdeploy.exe -verb:sync -source:package="C:\Users\xxxxxx\Desktop\" -dest:auto="",ComputerName="https://serveripaddress:8172/MsDeploy.axd",UserName='domain/user',Password='password',AuthType='Basic' -allowUntrusted
Info: Using ID 'someinfoid like : 92c-da-sd-2398as823...... is generated' for connections to the remote server.
Error Code: ERROR_DESTINATION_NOT_REACHABLE
More Information: Could not connect to the remote computer (""). On the remote computer, make sure that Web Deploy is installed and that `the required process ("Web Management Service") is started.
Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_DESTINATION_NOT_REACHABLE.
Error: The remote server returned an error: (404) Not Found.
Error count: 1.
Installed Web Deploy Components
Ensured the Services are enabled ( Web Deploy / Remote Services )
Remote Server : Windows 2012
Local System : Windows 10

Can't Deploy Simplest ASP.NET Core Web App to Azure VM

I'm trying to deploy the simplest ASP.NET Core 2.1 Web App (Razor or MVC) I can imagine from Visual Studio 2017 15.8.2
and still failing.
I followed the instructions in
https://github.com/aspnet/Tooling/blob/AspNetVMs/docs/create-asp-net-vm-with-webdeploy.md
step by step
finished creating VM
checked the web management service is up and running
installed Web Deploy 3.6 as described above tutorial
installed Windows features required - ASP.NET 4.6
Port 80 (http) and 8172 (WebDeploy) is open
checked the inbound rules in Azure portal
and Windows Firewall in Remote Desktop
But WebDeploy still fails.
I used the credentials when I log on to the VM using RDP
It says
ERROR_COULD_NOT_CONNECT_TO_REMOTESVC
but I checked the web management service is running
Also, when trying to configure deploy profile, 'Validate Connection' fails without any error message.
What am I missing?
When installing Web Deploy 3.6, choose custom and select all checkboxes.
'Typical' setup does't work.
End up with "500 - Internal server error", but hey,
at least file uploading works, and that's a huge step for MSFT, huh?
EDIT: When Web Deploy 3.6 was installed with 'typcial', the web management service was not running and set 'manual' so I turned it on and set the startup type 'automatic' in [services] but the problem continued. So I changed the Web Deploy setup to custom/select all and succeeded uploading.

Could we deploy web site to azure web app use "MSDeployUseChecksum" config?

Actually,I got error when I deploy use "MSDeployUseChecksum" ,if remove "MSDeployUseChecksum", deploy will successed. C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\Web\Microsoft.Web.Publishing.targets(4295,5): msdeploy error ERROR_PROXY_GATEWAY: Web deployment task failed. (Could not connect to the remote computer ("dev-cms.scm.didix-dev-ase.p.azurewebsites.net") using the specified process ("Web Management Service"). This can happen if a proxy server is interrupting communication with the destination server. Disable the proxy server and try again. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_PROXY_GATEWAY.
pubxml file

TFS deploy error destination not reachable

We have 1 new DEV and 1 new QA server that I am configuring for automated deploys. I got the DEV deploys working. My problem is that the deploy to QA is giving me the below error.
Our build server contains the controller and drop folder. The error occurs when the Invoke deploy command is issued. I have ensured that the Web Management service is running on the web servers.
What could be causing the follow error message?
Error Code: ERROR_DESTINATION_NOT_REACHABLE
More Information: Could not connect to the destination computer ("myWebServer").
On the destination computer, make sure that Web Deploy is installed and that the
required process ("Web Deployment Agent Service") is started.
Error: The remote server returned an error: (404) Not Found.
Error count: 1.
Here is my deploy command:
\\myBuildServer\Builds\MyApp - Deploy to QA\myApp - Deploy to QA_20120827.1\_PublishedWebsites\AppName.UI.Web_Package\Appname.UI.Web.deploy.cmd /M:http://myWebAddress/MsDeployAgentService/ /U:myDomain\tfsUID /P:MyPassword "-setParam:name='IIS Web Application Name',value='MyWebAppName'" /Y
If you're on IIS 7, ensure that WMSvc is installed (add or turn on Windows features) running, that it is configured correctly and enabled in IIS Manager under "Management Service" and that port 8172 is open - try telnet-ing into it.
If IIS 6, install the Web Deploy agent.
For IIS 7 using WMSvc, you should use http://svr:8172/MsDeploy.axd and for MsDepSvc you are already using the right URL (see your /M param).
I've found the whole remote publishing to be a total ballache.
When you install Web Deploy, make sure to select Custom and check all components. This is what solved the issue for me.
Source: Could not reach the Web Deploy endpoint on the specified virtual machine

Resources