VSTS Deploy to Azure WebApp For Linux

微笑、不失礼 提交于 2020-02-06 06:28:25

问题


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:

  1. Create a new build definition
  2. Specify the source with corresponding repository and branch
  3. Add Archive files task to put necessary files to zip file
  4. 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:

  1. 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)
  2. The same as other git command


来源:https://stackoverflow.com/questions/48525048/vsts-deploy-to-azure-webapp-for-linux

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!