How to Drag-n-Drop hotfixes with Kudu

Nowadays, CI/CD are embedded in almost every modern software solution which brings lots of benefits of course.

However, sometimes you may need to skip CI/CD steps just to try something directly on one of your environments. In such cases, you may not be interested in things like (unit testing, security testing, resources creation, full deployment, etc.). Rather you want to quickly test few code changes in couple of binaries. If you face such situation regularly while deploying to Azure services, then Kudu is what are you looking for

If you are not familiar with Kudu, you can check the Further References section first.

Although, you can use Kudu to do full deployment just like other deployment approaches available on Azure, the special thing about Kudu is that it allows you to deploy small hot fixes because it gives you full access to your packages on Azure.

There is just a small trick that I think is not well-documented somewhere. So, I decided to explain it here.

Kudu Drag-N-Drop Constraints

To upload your package to Kudu, you simply drag your files from your local machine and drop them to Kudu page of your Azure service. But you should keep in mind the following 2 constraints:

  1. You can upload Zip files only
  2. You can upload to wwwroot folder only
Kudu allows only Zip files and allows them to be uploaded only to wwwroot folder

Deploying Hotfixes to App Service

If you are deploying a hotfix to Azure Apps Service, your binaries will be located in the root directory (wwwroot). So, all you need is to zip your modified binaries in a single *.zip file (without putting them into any folder) then drag-n-drop that zip file to the Kudu wwwroot directory. For example, if you need to deploy 2 dlls (x.dll and y.dll) do not put them in a folder before zipping as this will change the application directory structure. Rather, zip them directly.

Deploying Hotfixes to Function Apps

Unfortunately, the above solution does not work with Function Apps for 2 reasons

  1. Uploading any zip file to Azure Functions through Kudu deletes all existing files before extracting the zip file
  2. The folder structure for Azure Function Apps is different as it sores binaries under a sub-directory which is wwwroot/bin

So, in case of Azure function app, if you have lots of local changes but want to deploy 1 or 2 dlls only, you need do the following

  1. Download the deployed package
  2. Replace the desired dlls
  3. Zip the package
  4. Drag-n-drop the modified package

Further References

What is Kudu? – Video by Scott Hanselman and David Ebbo

Kudu service overview

Using Kudu and deploying apps into Azure

Project Kudu on GitHub

Leave a Reply