简体   繁体   English

如何从VSTS部署到Azure应用服务?

[英]How to deploy to azure app service from VSTS?

I have nodejs app. 我有nodejs应用程序。 Can I deploy it to azure app service without VS or other big IDE? 我可以在没有VS或其他大型IDE的情况下将其部署到azure app服务吗?

So, I want an easy way to select branch what I need push it to azure and run default command for nodejs. 所以,我想要一个简单的方法来选择我需要的分支将它推到azure并运行nodejs的默认命令。

I'm stuck with it, because all of solution it is use VS. 我坚持使用它,因为所有的解决方案都是使用VS.

This can be done. 这可以做到。 Take a look at the build and release functionality in Visual Studio Team Services. 查看Visual Studio Team Services中的构建和发布功能。

With VSTS Build, you can trigger a build and push to an Azure Web App automatically on a Git check-in for a particular branch, or you can manually trigger the build and push. 使用VSTS Build,您可以在特定分支的Git签入中自动触发构建并推送到Azure Web App,或者您可以手动触发构建和推送。

Take a look at the Azure App Service Deploy task in VSTS build. 查看VSTS构建中的Azure App Service Deploy任务。

Note that since VSTS is pulling from your Git repo, it doesn't matter what IDE you use to actually develop your app with. 请注意,由于VSTS是从您的Git仓库中提取的,因此使用哪种IDE来实际开发您的应用并不重要。

Also, VSTS is free for small teams and a single deployment pipeline. 此外,VSTS对于小型团队和单个部署管道是免费的。

You can deploy to azure app service by using Azure App Service Deployment step/task. 您可以使用Azure App Service部署步骤/任务部署到azure应用程序服务。 For example: 例如:

  1. Create a build definition 创建构建定义
  2. Add related step/task to build your project 添加相关步骤/任务以构建项目
  3. Add Azure App Service Deployment step/task (Can publish using Web Deploy or upload files directly) 添加Azure App Service部署步骤/任务(可以使用Web Deploy发布或直接上载文件)
  4. Select Triggers tab and enable Continuous Integration 选择“触发器”选项卡并启用“持续集成
  5. Specify repository and branch filters 指定存储库和分支过滤器

After that, the build will be triggered if you push changes to target branch. 之后,如果将更改推送到目标分支,将触发构建。 Related article: Define a continuous integration build for your Node.js app 相关文章: 为Node.js应用程序定义持续集成构建

Regarding run command for nodejs, you can refer to this thread by using kudu API: Include node modules in azure deployment via VSTS . 关于nodejs的run命令,您可以使用kudu API来引用此线程: 通过VSTS在azure部署中包含节点模块

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM