0

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

1 Answer 1

2

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

Sign up to request clarification or add additional context in comments.

4 Comments

Thanks Chris. I tried the Kudu REST API with PowerShell, and it sort of worked, but got an error: Invoke-RestMethod : The operation has timed out. From the Azure site cmd console, I can see contents from the Zip, so something must have worked here, but not sure if the entire process completed because of the time out error.
BTW: I've also looked at some of the Azure PowerShell cmdlets, and one in particular looked like it had potential: Publish-AzureWebsiteProject. However, this cmdlet requires the Select-AzureSubscription cmdlet, which does not show me my Azure subscriptions. However, Select-AzureRmSubscription does show me my subscriptions, but this cmdlet does not work with Publish-AzureWebsiteProject. Any ideas here? Is there a publish cmdlet for AzureRm?
For the Kudu REST API Invoke-RestMethod, I added the following to help with the time out error: -TimeoutSec 240. This seems to work so I'll go with Kudu for now. Thanks again!
@keith the reason Kudu process is timing out is because it tries to restore all your packages through npm restore. You could use webpack to resolve this but it's still in beta/preview and not sure it will work in this case.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.