问题
I have a release in VSTS to deploy my webapp to the azure app service. For this I use a Azure App Service deploy step. After the normal deploy of the webapp I want to add an additional zip artifact from another build result. I want to copy only those file to a specific path of the web application on azure. How can I do that?
回答1:
If the zip file is the web deploy package, you can refer to Joy’s answer. (Need to check Application option)
Otherwise, the simple way is using Kudu REST API (remain folder structure), steps:
- Uncheck Publish using Web Deploy option of Azure App Service Deploy task
- (Optional) Add Unzip task to extract zip files to a folder in artifact folder (the folder that you want in app service, e.g.
D:/1/a/mylib
) - Specify folder (parent folder of step 2 to remain folder structure) or package (zip) in Package or folder input box
回答2:
You could use Virtual applications and directories to do it.You could check my steps.
- Go to azure portal -> APPLICATION -> APPLICATION SETTINGS->Virtual applications and directories
- set virtual directory with virtual path :
/YourApplication
tosite\YourApplication
orsite\wwwroot\YourApplication
- Go to VSTS-> the release option-> the
Deploy Azure App Service
task - set virtual application to
/myApplication
Hope it can help you.
来源:https://stackoverflow.com/questions/49740986/adding-additional-files-to-vsts-release-to-azure-web-app