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:
- You can upload Zip files only
- You can upload to wwwroot folder only
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
- Uploading any zip file to Azure Functions through Kudu deletes all existing files before extracting the zip file
- 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
- Download the deployed package
- Replace the desired dlls
- Zip the package
- Drag-n-drop the modified package
What is Kudu? – Video by Scott Hanselman and David Ebbo
Using Kudu and deploying apps into Azure
You must log in to post a comment.