0

I am using azure devops to host my angular application on azure appservice and it's working great. I have two files in my src folder of project and I want to move or paste those files into the wwwroot directory where my application's published code is placed.

If I add dist in the Target Folder of "Copy Files To" then files copying to the dist folder as you can see in the second image. But If i place wwwroot then after completion of this pipeline the message shows that Copying "D:\a\1\s\src\server.js to wwwroot\server.js" but if i see the directory then these files are not showing any where. I have tried $(Build.ArtifactStagingDirectory) in the Target Folder also but it's not working though. How can i copy the files from src to wwwroot?

enter image description here

enter image description here

James Z
  • 12,209
  • 10
  • 24
  • 44
Floki
  • 271
  • 1
  • 5
  • 15
  • 1
    Can you tell where do you publish your angular app? If you just place dist it will go to `System.DefaultWorkingDirectory/dist` which is different than 'Build.ArtifactStagingDirectory`. – Krzysztof Madej Jul 09 '20 at 12:13
  • Hi, how about the issue? Does the answer below resolved your question, If not, would you please let me know the latest information about this issue? – LoLance Jul 13 '20 at 09:51
  • Please check if below answer resolves your issue. If it can't help, would you please share the whole build definitions of your pipeline here? – LoLance Jul 16 '20 at 09:18

1 Answers1

1

1.You should make sure the target folder and the folder to publish is the same folder.

For example: If you copy those two files directly into $(Build.ArtifactStagingDirectory), then your Publish Artifact Task's Path To Publish should also be $(Build.ArtifactStagingDirectory).

2.Then in your Azure App Service Deploy task(if this task is in release pipeline), you should make sure the path is correct to find the drop folder:

enter image description here

(Use the button to find the artifact path, and add /drop)

3.Finally in Azure Web Portal, navigate to App Service=>Configurations=>Virtual path and make sure the physical path is wwwroot instead of wwwroot\dist:

enter image description here

Then it works well on my side to deploy the files in wwwroot folder.

halfer
  • 19,824
  • 17
  • 99
  • 186
LoLance
  • 25,666
  • 1
  • 39
  • 73