PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Tuesday, September 27, 2022

[FIXED] How to MSDeploy an ASP.NET Core app from command line? (csproj not project.json)

 September 27, 2022     .net-core, asp.net-core, continuous-deployment, msbuild, msdeploy     No comments   

Issue

Can ASP.NET Core apps be deployed via msdeploy.exe and a .pubxml definition similar to what was possible for pre-.NET Core? This is the command that I've used previously:

msbuild myproj.csproj /p:DeployOnBuild=true /p:PublishProfile=<profile-name>.

If not, what is the preferred way to deploy an ASP.NET Core app from the command line?


Solution

To deploy your asp.net core app to Azure web App simply do the following steps:

1. dotnet publishsomeproject.csproj -c release -o someDirectory
2. msdeploy.exe  -verb:sync -source:contentPath="someDirectory" -dest:contentPath="webAppName",ComputerName="https://WebAppName.scm.azurewebsites.net/msdeploy.axd",UserName="username",Password="password",IncludeAcls="False",AuthType="Basic"
-enablerule:AppOffline -enableRule:DoNotDeleteRule -retryAttempts:20 -verbose

Username and Password can be retrieved or set on the deployment preview section in the web app in Azure portal. I have set an env path for my msdeploy.exe which can be found usually here C:\Program Files\IIS\Microsoft Web Deploy V3.



Answered By - Buba Conteh
Answer Checked By - David Goodson (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing