0

Using dotnet publish, how do I deploy a dotnet core web application to a IIS server hosted remotely? What is the best way to do that?

I am setting up Jenkins for CICD for this app and need this process to be part of this.

1 Answer 1

0

I think what you are looking for is MS Web Deploy. This is a Windows tool, that can perform remote deployments to IIS using a CLI command, making it easy to integrate into tools like Bamboo or Jenkins.

In order to use this, you'll need to have 2 services setup and installed on the IIS server.

  • Web Management Service
  • Web Deployment Agent Service

Once those services are setup and running, you can run the msdeploy.exe (C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe) that comes with MS Web Deploy to execute a application deployment. This can be done from the same server, or from a remote server.

Example:

msdeploy.exe -verb:sync -source:iisApp="$appPath\web" -dest:iisApp='$SiteName',wmsvc="$IIS-Server-Name",UserName='$user',Password='$password',AuthType='Basic',skipAppCreation=true -enableRule:AppOffline -allowUntrusted:true 
4
  • Though not supported by Microsoft, it is possible to run Web Deploy on non-Windows platform via Mono. Commented Apr 24, 2022 at 2:18
  • That is good to know. How do you go about installing it on a non-windows system for running with mono? Wine? Commented Apr 25, 2022 at 14:21
  • 1. Install Mono on that machine (Linux or macOS). 2. Copy msdeploy.exe (and its dependencies) from your Windows machine to that machine. 3. Run mono msdeploy.exe with the necessary parameters. This should enable certain features (but probably not all). Commented Apr 25, 2022 at 15:01
  • This seems like a good use case for a Docker container. Commented Apr 26, 2022 at 18:02

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.