Introducing Cake Kudu Client

Ship remotely to Azure App Services using Cake

Mattias Karlsson
Feb 8, 2018 · 2 min read
Image for post
Image for post

I’ve previously written how you on Azure App Services itself can build and deploy your web applications and functions utilizing Cake build scripts and the Cake.Kudu addin.

While it’s fairly easy to get going, just add a build script and connect it to your source code repository of choice, for some scenarios it makes more sense to ship your application prebuilt.

A few of those scenarios can be

  • Static web sites, where it requires more resources build, than to serve.
  • Multi region apps, where you deploy same bits to multiple sites and makes sense to just build it once.
  • Build requirements, by building on App services you’re limited to the tooling it has pre-installed or it’s environment supports.
  • Private resources, using private nugget feeds or other compile time sensitive information can be cumbersome, and might not be what you want to have lying around on your web site.

Cake Kudu Client to the rescue

Kudu the “engine” behind Azure web and function apps provides and http-based API, which deploy is one of the features it offers. And it’s this API the “Cake Kudu Client” provides a typed C# API which makes it close to a one-liner to deploy from a directory or zip file.

What the above does is essentially

  1. From environment variables gets Kudu endpoint for your App Service (i.e. https://{yoursite}.scm.azurewebsites.net), user name and password.
  2. Instantiate a new client using the KuduClient alias.
  3. Use the ZipDeployDirectory method which with zip that folder in memory and deploy it.

A real world example using this with the static site generator WYAM could look something like this:

Not just deployments

Deployments is only one of the features the Cake Kudu Client addin handles

  • Execute remote shell commands
  • Enumerate remote files and directories on
  • Upload files and directories to AppService
  • Download files and directories from AppService
  • Deploy to AppService from local folder or zip file

and more features are planned.

You can find the complete list of available methods with examples are available on the Cake web site at:
https://cakebuild.net/dsl/kudu/

HackerNoon.com

#BlackLivesMatter

By HackerNoon.com

how hackers start their afternoons. the real shit is on hackernoon.com. Take a look.

By signing up, you will create a Medium account if you don’t already have one. Review our Privacy Policy for more information about our privacy practices.

Check your inbox
Medium sent you an email at to complete your subscription.

Mattias Karlsson

Written by

Partner & Technical fellow at WCOM AB. Microsoft Azure & Developer Technologies MVP. Been coding since I 80’s (C128 & Amiga). Father of 2, husband of 1.

HackerNoon.com

Elijah McClain, George Floyd, Eric Garner, Breonna Taylor, Ahmaud Arbery, Michael Brown, Oscar Grant, Atatiana Jefferson, Tamir Rice, Bettie Jones, Botham Jean

Mattias Karlsson

Written by

Partner & Technical fellow at WCOM AB. Microsoft Azure & Developer Technologies MVP. Been coding since I 80’s (C128 & Amiga). Father of 2, husband of 1.

HackerNoon.com

Elijah McClain, George Floyd, Eric Garner, Breonna Taylor, Ahmaud Arbery, Michael Brown, Oscar Grant, Atatiana Jefferson, Tamir Rice, Bettie Jones, Botham Jean

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store