Latest news about Bitcoin and all cryptocurrencies. Your daily crypto news habit.
A couple of days ago Azure announced that they in preview added a new way to do app services deployments called Run-From-Zip, which lets you deploy using a zip file.
Deploying using a zip file as been possible before, the difference with this new method is that the file isn’t extracted into the “wwwroot” directory, but instead the zip file mounted read only as “wwwroot”.
The zip file can either be hosted externally from the site or in a special folder on the app service itself, and the latter is now what the “Kudu Client” Cake addin now supports — enabling you to use this new method of deployment in your Cake build scripts.
Prerequisites
To enable Run-From-Zip deployments you’ll first need to set an application setting called WEBSITE_USE_ZIP, you either set this to an url when deploying from an external source, or in this case just set it to 1.
ZipRunFromDirectory
Naming things is hard, but the addin now has a method called ZipRunFromDirectory, which will do all the “heavy lifting” and deploy a local directory.
Example usage
So deploying a site using this new method just becomes a couple of lines of code
The file path returned, is the zip file deployed to the app service.
Behind the curtain
So what does actually happen here? In a nutshell the method will:
- In memory zip source directory
- Push that zip to d:\home\data\SitePackages to a unique date stamped file name
- Push the filename of the zip to d:\home\data\SitePackages\siteversion.txt
- Via Kudu API call the site to ensure it’s up and right version deployed (a file called KuduClientZipRunFromDirectoryVersion.txt is included in deployed zip for this purpose)
- Return the remote path of the deployed zip
Closing thoughts
I’ve tried this for a couple of days now, and have found deployments to be very stable and quick. But really need some more testing to see what the implications of running this in production, how existing apps behave in a read only mode, etc.
This is a shiny new feature still in preview, general guidance and tooling support isn’t quite there yet, but as you seen with this post the primitives are in place to build upon and refine the experience in the future!
“Run-From-Zip” with Cake Kudu Client was originally published in Hacker Noon on Medium, where people are continuing the conversation by highlighting and responding to this story.
Disclaimer
The views and opinions expressed in this article are solely those of the authors and do not reflect the views of Bitcoin Insider. Every investment and trading move involves risk - this is especially true for cryptocurrencies given their volatility. We strongly advise our readers to conduct their own research when making a decision.