MSDeploy vs WebDeploy vs Publish-AzureWebsiteProject vs dnu publish [closed]
Asked Answered
H

2

11

When learning about how to publish our ASP.NET 5 application to an Azure Web App, I came across several ways of publishing .NET web applications:

  • MSDeploy
  • WebDeploy
  • Publish-AzureWebsiteProject
  • dnu publish

Information on the Internet regarding this is quite scattered and I cannot wrap my head around what these different "techniques" are intended for.

What are the main differences between them and when should/could they be used?

Himes answered 17/9, 2015 at 5:58 Comment(3)
Your question was used in an audit and is now discussed on meta. Can we find a way to make this less of a list/broad/opinion based post?Wade
@rene: Could you provide a suggestion on how I could rephrase my question? I could rather ask What is the purpose for each of these?Himes
One way could be to take an option for example: publish-azurewebsite project and then claim that is doesn't work for your asp.net-5 site, that you tried msdeploy instead but that lacks vs-ide support (I don't know if that is true but I'm trying to generate options here). Then the question could be: How do I make my publish workflow more convenient. The current answers would still fit in that case.Wade
B
5

MSDeploy vs Web Deploy

Regarding MSDeploy vs Web Deploy, as Rick mentioned they are the same thing. The actual name is "Web Deploy" but the .exe is named msdeploy.exe so that's why both names are used.

DNU Publish

dnu publish is a cross platform utility provided by DNX/ASP.NET 5 which can be used to publish a DNX/ASP.NET 5 app to a folder.

Let me explain how that relates to the support you see in Visual Studio 2015. In VS2015 the primary responsibility of the publish dialog is to persist settings in the publish profile (.pubxml file). Visual Studio first calls dnu publish to publish the app to a local folder. Then the properties (all of them, even custom ones you add) are passed to the profilename.ps1 file as the -publishProperties parameter. The path to the folder where the results of dnu publish are at is passed in via -packOutput. At that point control is transferred to the .ps1 file, VS has no knowledge of the actual publish internals. You can gut the contents of the .ps1 and as long as the parameters remain the same it should work.

The PowerShell script, and the module that it consumes,are OSS at https://github.com/aspnet/vsweb-publish. The default script created by VS is at https://github.com/aspnet/vsweb-publish/blob/master/samples/default-publish.ps1. Note: this module currently only works for ASP.NET 5. If you're interested for previous versions let me know and we can consider adding support.

If you're interested in learning more about that script I recommend get-help Publish-AspNet after the publish module is loaded. Or you can check the help text in the source.

Publish-AzureWebsiteProject

Publish-AzureWebsiteProject is a PowerShell cmdlet shipped with the Azure PowerShell command line tools. You can use this to publish and ASP.NET 4.5 project or package to Azure Web Apps (formerly named Azure Websites). I do not believe that this has been updated to support ASP.NET 5, but I could be wrong there.

Brookbrooke answered 23/9, 2015 at 1:52 Comment(0)
W
6

There are more ways than listed here to deploy web apps. There is very good documentation here that discusses the options for deploying web apps. For example, FTP, Git, Visual Studio, CLI, etc...

From your list though, Web Deploy and MS Deploy (msdeploy.exe) are the same and arguably the most common. Web Deploy is the preferred term though and you will see it used in the tooling. For example, if you right-click an ASP.NET project and select Deploy, Web Deploy is the default option. Again, there are others and the link above explains them.

Publish-AzureWebsiteProject is one of many automated ways to build and/or deploy your web project (ie: the code/app) using PowerShell and it uses the Web Deploy method.

DNU (.NET Development Utility) is used to build, package and deploy DNX (.NET Execution Environment) projects. There's a lot of good information on this here.

Wrapper answered 17/9, 2015 at 13:18 Comment(2)
Most examples of publishing DNX applications use MS Deploy. Why are they not using DNU publish? Why are we not just using Publish-AzureWebsiteProject? Or does this actually call on DNU publish internally? Is Web Deploy the same as right clicking on a project and selecting publish? What about the FileSystemPublish target on MSBuild? Does this translate to any of the above?Himes
Web deploy is the most common and I suspect is why you see a lot of examples of it. MSBuild is used to build the web app project but can also be used in a command-line form to automate publishing the build output. BTW, I made a few edits to my original answer to address these other questions you raised.Wrapper
B
5

MSDeploy vs Web Deploy

Regarding MSDeploy vs Web Deploy, as Rick mentioned they are the same thing. The actual name is "Web Deploy" but the .exe is named msdeploy.exe so that's why both names are used.

DNU Publish

dnu publish is a cross platform utility provided by DNX/ASP.NET 5 which can be used to publish a DNX/ASP.NET 5 app to a folder.

Let me explain how that relates to the support you see in Visual Studio 2015. In VS2015 the primary responsibility of the publish dialog is to persist settings in the publish profile (.pubxml file). Visual Studio first calls dnu publish to publish the app to a local folder. Then the properties (all of them, even custom ones you add) are passed to the profilename.ps1 file as the -publishProperties parameter. The path to the folder where the results of dnu publish are at is passed in via -packOutput. At that point control is transferred to the .ps1 file, VS has no knowledge of the actual publish internals. You can gut the contents of the .ps1 and as long as the parameters remain the same it should work.

The PowerShell script, and the module that it consumes,are OSS at https://github.com/aspnet/vsweb-publish. The default script created by VS is at https://github.com/aspnet/vsweb-publish/blob/master/samples/default-publish.ps1. Note: this module currently only works for ASP.NET 5. If you're interested for previous versions let me know and we can consider adding support.

If you're interested in learning more about that script I recommend get-help Publish-AspNet after the publish module is loaded. Or you can check the help text in the source.

Publish-AzureWebsiteProject

Publish-AzureWebsiteProject is a PowerShell cmdlet shipped with the Azure PowerShell command line tools. You can use this to publish and ASP.NET 4.5 project or package to Azure Web Apps (formerly named Azure Websites). I do not believe that this has been updated to support ASP.NET 5, but I could be wrong there.

Brookbrooke answered 23/9, 2015 at 1:52 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.