0

I would like to deploy my .NET Core web application via Visual Studio Team Services to hosting with IIS.

I have tried to discover the possibility of deployment the final release but I don't know what type of task I can use.

I usually used the deploy via Visual Studio 2017 and using publish proccess with MSDeploy and setup profile like this:

<publishData>
   <publishProfile 
   publishUrl="publishUrl" 
   msdeploySite="site" 
   destinationAppUrl="destinationAppUrl" 
   profileName="Default Settings" 
   publishMethod="MSDeploy" userName="login" /> 
</publishData>

This site is not running on azure but on shared asp.net hosting.

How can I setup the Visual Studio Team Services - Deploy release if I only know these information?

What type of task is necessary to use?

Jenan
  • 3,408
  • 13
  • 62
  • 105

1 Answers1

1

Since you can deploy it with publish profile, you can to do it in VSTS build/release too.

  1. NuGet restore (2.*) or Dotnet restore task
  2. Visual Studio Build task (MSBuild Arguments: /p:SkipInvalidConfigurations=true /p:DeployOnBuild=true /p:PublishProfile="[profile name]"

You can use IIS Web App Deployment Using WinRM tasks if you have admin account.

If the host supports FTP, you also can upload the published files through FTP task.

starian chen-MSFT
  • 33,174
  • 2
  • 29
  • 53
  • I have tried a FTP and that works great. I need try use the PublishProfile but I don't know these steps: Where can I store the PublishProfile and how can I pass a password for the PublishProfile? Thank you – Jenan Sep 02 '17 at 20:26
  • @Jenan Just right click the project => Publish =>Create new profile=>IIS, FTP etc=>Specify server, username, password etc and check Save Password option, then the Encrypted password is stored in xx.pubxml.user file, include this file to project and add xx.pubxm, xxpubxml.user to source control. – starian chen-MSFT Sep 04 '17 at 02:08
  • Is there any solution - how save this profile to VSTS? Because If it will be public repository, anyone could be able to show these publishing settings. Thank you – Jenan Sep 04 '17 at 04:56
  • @Jenan You can specify the password through MSBuild argument (/p:password), also you can override the value in publish profile through MSBuild argument too (/p:[publish profile];key1=value1;key2=value2. key1 and key 2 are in xx.pubxml file). You also can try to specify them in MSBuild argument directly: https://stackoverflow.com/questions/2647654/msdeploy-doesnt-deploy-to-remote-server-using-msbuild-and-visual-studio-2010 – starian chen-MSFT Sep 04 '17 at 05:34