0

I have an Angular application and hosted in IIS. I want to deploy this application using Web Deploy.

I know VS solutions (.sln) could be deployed using MSBUILD and Publish Profiles.

How to deploy non VS, static applications using web deploy?

I'm looking for an option to deploy from a Bamboo build server to a remote IIS target.

Purushoth
  • 2,673
  • 3
  • 22
  • 36
  • Set it up directly on an IIS machine, and sync to others, https://learn.microsoft.com/en-us/iis/publish/using-web-deploy/synchronize-iis – Lex Li Mar 06 '19 at 17:35
  • I'm trying for a build server @LexLi It's remote deployment. – Purushoth Mar 07 '19 at 07:20

3 Answers3

1

As Lex Li says, if you want to publish a hosted angualr application to another IIS by using web deploy, you could use web deploy sync method.

If you just want to sync 2 folders directly root-to-root, you could try below command:

Notice:The webdeploy tool normally is inside the C:\Program Files (x86)\IIS\ folder, you need firstly locate it.

>msdeploy  -verb:sync -source:dirPath="D:\my-app\dist" -dest:dirPath="D:\AnTest"

enter image description here

If you want to include IIS configuration on the destination, you should use iisApp provider instead of dirPath:

>msdeploy  -verb:sync -source:iisApp=<SourceFolderOrIISPath> -dest:iisApp=<DestinationFolderOrIISPath>
Brando Zhang
  • 22,586
  • 6
  • 37
  • 65
  • I want to deploy it from Bamboo. It's a remote deployment. For visual studio projects I can use MSBUILD publish. Here using ``ng build`` I have output that I need to transfer to remote IIS. – Purushoth Mar 07 '19 at 07:20
  • Yes, for asp.net application, the it could use msbuild to publish easily.Microsoft has wirte the logic to build and deploy it. But for angular application, use ngbuild and xcopy is the most easily way to publish the application. I suggest you could refer to this [answer](https://stackoverflow.com/a/48090284/7609093) to know how deploy the angular application from bamboo to remote server. – Brando Zhang Mar 07 '19 at 07:29
  • Thanks @Brand I could do a build and have all the files to be transferred. But Bamboo supports AWS code deploy or Tomcat directly for deployment. For IIS there no support for non .net projects. I did check the answer which is specific to Apache Tomcat. – Purushoth Mar 07 '19 at 08:01
1

I have gone with the following approach:

  1. Setup dist folder of angular project at angular.json => projects > your_project > architect > build > options > outputPath > your_dist_folder

  2. build Angular project

  3. On Visual Studio inside a solution right click > Add Existing Website and choose the folder of the built angular code

  4. Right click on the new website > Publish Web App

  5. Create Web Deploy Profile

  6. Publish with the new profile

Xaris Fytrakis
  • 487
  • 6
  • 16
0

Install msdeploy on the bamboo agent. Use the script task and use this line:

"C:\Program Files (x86)\IIS\Microsoft Web Deploy V3\msdeploy.exe" -verb:sync -source:iisApp=<SourceFolderOrIISPath> -dest:iisApp=<DestinationFolderOrIISPath>

If you have another path to the msdeploy you enter that path instead.

P.Brymér
  • 41
  • 6