1

I've a two applications, backend and frontend, hosted on the same Azure web app (os : windows).

Actually, i Deploy the two artficats via FTP/S.

I use wwwroot folder to the front and a subfolder in wwwroot folder to the backend

I would use Azure Devops to create a Azure Release to deploy the two application to my web app.

I can't use two app service for the backend and the frontend.

What is the best approch to deploy ? and It's possible to specify a subfolder target in Azure App service into Azure release ?

Regards

1 Answers1

0

It is impossible to specify a subfolder to deploy to in azure release pipeline using the deployment tasks. The artifacts will be deployed to wwwroot folder by default.

However,You can use copy files task in your release pipeline to copy the backend artifacts into the subfolder which resides in the frontend artifacts folder. And then deploy the frontend artifacts folder which contains the backend artifacts in its subfolder. See below:

enter image description here

You can also run Kudu rest api in azure powershell task to deploy to azure web app service.

You can first use the command api to create a subfolder in wwwroot.

{
 "command" = 'md subfolder',
 "dir"='D:\home\site\wwwroot'
}

Then you can deploy the backend artifacts to the subfolder using zip deploy api

$apiUrl = "https://{sitename}.scm.azurewebsites.net/api/zip/site/wwwroot/subfolder"

Please check out this blog for more information. See this thread for example using azure powershell task to call kudu rest api

Levi Lu-MSFT
  • 27,483
  • 2
  • 31
  • 43
  • When deploy the front , the folder of backend will be deleted , is it ? –  Mar 02 '21 at 07:45
  • @Andrelemarchand I tested and found if the subfolder was created by kudu api. The subfolder will not be deleted when deploy the front to wwwroot. – Levi Lu-MSFT Mar 02 '21 at 09:08
  • When deploy with azure devops ? –  Mar 02 '21 at 20:07
  • @Andrelemarchand Yes – Levi Lu-MSFT Mar 03 '21 at 02:01
  • The wwwroot folder have the two artficats , if i Deploy the backend with kudu api to subfolder in wwwroot , this folder will not be deleted if i Deploy the frontend ? –  Mar 03 '21 at 04:56
  • @Andrelemarchand From the result of my test. Its behavior looks like this. (The `removeAdditionalFilesFlag` of azure web app deploy task should be set to `false`) – Levi Lu-MSFT Mar 03 '21 at 09:48
  • @Andrelemarchand Did you get a chance to try out above solution. How did it go? – Levi Lu-MSFT Mar 05 '21 at 08:11