问题
Is it possible to deploy an application from VSTS to a WebApp on Linux.
My Webapp is a simple ruby app and I'm currently deploying it with the hosted git repo like in the doc: https://docs.microsoft.com/en-us/azure/app-service/containers/quickstart-ruby
git remote add azure <Git deployment URL from above>
git add -A
git commit -m "Initial deployment commit"
git push azure master
Is there a way to do it using a repo in VSTS?
回答1:
First, the Azure App Service Deployment task supports Web App on Linux app service type, so you can deploy your ruby app through this task, for example:
- Create a new build definition
- Specify the source with corresponding repository and branch
- Add Archive files task to put necessary files to zip file
- Add Azure App Service Deploy task (App type: Linux Web App; Image Source: Built-in Image; Package or folder: [zip file in step 3]; Runtime Stack: Ruby 2.3)
Note: You can deploy it through Release.
Secondly, if Deployment option is available, you can configure it in azure portal: Continuous Deployment to Azure App Service.
On the other hand, you also can push source to server through git command as you are using:
- Add Command Line task: (Tool:
git
; Arguments:remove add azure [git deployment URL]
; Working folder:$(build.SourcesDirectory)
). Note: the git deployment URL should contains username and password, for example:https://[username]:[password]@[app name].scm.azurewebsites.net/[app name].git
(username can’t contains@
character) - The same as other git command
来源:https://stackoverflow.com/questions/48525048/vsts-deploy-to-azure-webapp-for-linux