Score:0

Deploy dot net web app using dotnet publish to remote IIS server

cn flag

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.

Score:0
bf flag

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
Lex Li avatar
vn flag
Though not supported by Microsoft, it is possible to run Web Deploy on non-Windows platform via Mono.
MeemicMan avatar
bf flag
That is good to know. How do you go about installing it on a non-windows system for running with mono? Wine?
Lex Li avatar
vn flag
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).
MeemicMan avatar
bf flag
This seems like a good use case for a Docker container.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.