0
votes

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

1 Answers

0
votes

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