Aspnetcore.docs: Link to Azure publish from command line is invalid

Created on 28 Nov 2018  Â·  16Comments  Â·  Source: dotnet/AspNetCore.Docs

In the section "Publishing to Azure", the link in the sentence "The app can also be published to Azure from the command line" points to a page that does not describe how to publish a .NET Core web app to Azure using CLI.

In fact, I could not find any documentation describing how to publish an ASP.NET Core web project to an Azure web app using only the built-in tools from CLI (not using git).


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

P2 Source - Docs.ms

All 16 comments

@tdykstra should I make an issue for the TOC entry publish with CLI which doesn't link to CLI publishing?

image

My link above does use CLI

The paragraph linked in your 1st post explains how to prepare the deployment files using dotnet publish command, but does not explain how to publish the files to Azure using CLI, which is what you usually need when scripting deployments. It only states:

Move the contents of the bin/Release/{TARGET FRAMEWORK}/{RUNTIME IDENTIFIER}/publish directory to the site in App Service.

I was really looking for a replacement for the MSBuild DeployOnBuild / PublishProfile command which I have been using with .NET framework web projects (maybe this still works? although I'd prefer using the dotnet CLI tool rather than MSBuild).

So, there is no way to build locally and publish using CLI tools? The Azure Cloud Shell example uses git deployment, which builds the project on the target web app.

@cephalin Do we have:

documentation describing how to publish an ASP.NET Core web project to an Azure web app using only the built-in tools from CLI (not using git).

@Rick-Anderson

should I make an issue for the TOC entry publish with CLI which doesn't link to CLI publishing?

It does do publish with CLI, using Git. We could use this issue to add a link to non-Git CLI deployment if such an article exists.

From your remark @madmox, it looks like you're not trying to use MSDeploy (??).

Just as a btw @Rick-Anderson @tdykstra ... That description is in the publish profiles topic. We might need to cross-link better, since an Azure Apps profile should work via that approach. I haven't tried it from a CL ... just from VS ... but there's no reason to think it wouldn't ✨ Just Work:tm: ✨

https://docs.microsoft.com/aspnet/core/host-and-deploy/visual-studio-publish-profiles#publish-to-an-msdeploy-endpoint-from-the-command-line

@guardrex Thanks, I was looking for this part of the documentation elsewhere (here). At least it's still possible to use msbuild on Windows machines to deploy! I don't know why I expected the command & config to be different from ASP.NET 4 web apps, but it looks like it's not.

Well I still miss a clear way to publish a web app from the dotnet CLI toolchain (instead of MSBuild/MSDeploy), but I think I can rely on the git deploy option if the build server does not support MSBuild.exe for any reason.

@madmox WRT ...

from the dotnet CLI toolchain

There's dotnet msbuild ...

The command has the exact same capabilities as existing MSBuild command-line client.

It should work with a publish profile. I haven't tried it, but it seems like it would work. 🤞

@Rick-Anderson @tdykstra There's cross-linking opportunities here + possibly surfacing dotnet msbuild. If you'd like me to work this, we could schedule for late in the month. I don't think it would take long to resolve it.

@tdykstra I'd actually never known before that dotnet can publish. We don't have anything that publish with that route. Since App Service doesn't write for multiple permutations, is this something that most people will prefer instead of publishing with Git?

@Rick-Anderson @scottaddie @guardrex See question from Cephas -- what method should the Azure App Service docs focus on? I'd say stick with Git publishing.

Git sounds good to me.

I suggest a cross-link over to the publish profiles topic at the end in an Additional resources section because that's a bit hard to find if one doesn't want to use Git. Could link it directly to that MSDeploy/CLI section that I mentioned earlier ... and then ...

That publish profiles topic section could have a cross-link over to dotnet msbuild. The text isn't really accurate the way that it's currently written because it was written before dotnet msbuild was a thing. ~Also, that section could use a passing remark (or a link to a bookmark in the topic) about Azure Apps. I'd test the approach (Azure Apps profile deployment) to make sure it works ... it should work ... there's no reason for it not to work.~

[EDIT] It's almost there ...

In the following sample, an ASP.NET Core web app is created (using dotnet new mvc), and an Azure publish profile is added with Visual Studio.

... so just touch-ups for the lingo: RP over MVC. Perhaps, rename that profile in the example. Perhaps, link that to something earlier on generating the profile.

I can work on this in a couple weeks if you guys want. I don't think it would take very long. Assign me and put it on the backlog if you like.

@madmox I should be able to get to this in a few weeks. If you have a good/bad experience ... gotchas ... additional thoughts ... please let me know here so that I can take your feedback into account for the updates.

My last post lays out some of the things that I'd like to do. Thus far, the dotnet msbuild command with an Azure Apps publish profile looks like a good bet for a scriptable scenario. I'll make sure cross-links surface the approach and to the dotnet msbuild command.

Thanks for the feedback. I'm OK with the clarifications you intend to make, it sounds good.

git deployment is definitely the thing you have to "push" forward as it is a more versatile approach, but at the time being it's not always possible / sometimes a bit complicated to set up correctly (thinking large projects taking forever to build on web apps, mixed csproj projects failing to build because of netstandard references issues (this one does not concern dotnet core), incompatible build extensions like webcompiler...). So yeah, you definitely need to make the dotnet msbuild section more visible in the doc!

Adding my two cents:

For the App Service side, I don't think of it as "which one do we want to push", but really "which one is representative of the audience at large", with the addition of "what is the one link to point people to find out more about .NET Core+App Service". The App Service article is not the place to become a collection of links for .NET Core customers, but primarily for a "first 5 minutes with the service" experience.

@madmox with the concerns you bring up, does it make Git an unattractive option for .NET Core customers? That's the question we would ask from our end. When you say it's not always possible/easy, are you saying the majority case or the minority case? All those issues you brought up are things that we probably should cover in our .NET/Core specific "Configure app" article we intend to rewrite. Do you have a doc somewhere that outlines the issues and configuration steps to address each?

Was this page helpful?
0 / 5 - 0 ratings