简体   繁体   中英

How to deploy NodeJS project to Azure websites?

We have a NodeJs project we are building with TeamCity, then using FTP, uploading the built files to our Azure web app (.azurewebsites). The project contains thousands of files, so the FTP upload times are very slow (takes a very long time). We would prefer to package the build as a ZIP file, then upload the ZIP with FTP (much faster). However, how do we unzip the ZIP file on Azure using script?

Or is there a better way to deploy our build to our Azure web app?

NOTES :

  • This is an Azure web app service, does not live on a VM
  • Our process needs to be automated with script to support CI/CD
  • Deployments with Git and other repos are not feasible

You can use the Kudu API or MsBuild to deploy an app (web app or Function) to Azure App service. The deployment is usually done in 2 parts:

  1. Deploy the app service using ARM templates
  2. Deploy the code/App using one of these methods

If you're using VSTS, there are templates for both steps and make it a 2min process to setup. If you're not using VSTS, the Kudu API is he best way to solve the problem.

You can find more information here : https://github.com/projectkudu/kudu/wiki/REST-API

You can also use the Azure PowerShell Management cmdlets to achieve the same. However, this is at the moment only supported on Windows

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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