
Kudu is a web-based interface that allows you to deploy and manage Azure web apps directly from the cloud. It's a powerful tool that simplifies the development and deployment process.
Kudu provides a simple and intuitive interface for managing Azure web apps, including deploying code, managing files, and monitoring logs. This makes it easy to get started with Azure development.
One of the key features of Kudu is its ability to provide a console for running shell commands, which is particularly useful for troubleshooting and debugging issues.
You might enjoy: Azure Development
Development and Deployment
You can deploy your Episerver site to Azure via Kudu by first producing a zipped up copy of the site code you want to deploy.
To set up a publish profile, look in the toolbar for "Publish" with a drop down next to it and select "New Custom Profile". Select Folder as the publish target type and provide the path to where you want to publish, making sure it ends with ".../wwwroot".
To deploy to Kudu, confirm you have the proper directory for the site selected, click on the app service for the site you are deploying to, and select "Advanced Tools" and then "Go" to open up Kudu in a new tab.
In Kudu, click on the "Debug Console" dropdown and select "CMD" to access a command line interface where you can upload your zipped site code and have it unzipped for you.
Debug Console
The Debug Console is a powerful tool that gives you a file explorer and graphical KuduExec experience. This allows you to run command line tools against your Web Site.
To use the Debug Console, you'll need to have Node.js installed as a prerequisite. This will enable you to access a wide range of command line tools and features.
One of the key benefits of the Debug Console is that it provides a sandboxed environment for command line access. This means you can experiment and test different tools and scripts without affecting your live Web Site.
If you're having trouble accessing the Debug Console, don't worry! There are a few other ways to get command line access to your Web Site. For example, you can use the KuduExec command line tool, which we'll cover in more detail later.
Notes
The scm service host name is always in the pattern above, regardless of custom host names in your site. You can access the scm site directly if you're already logged on to the Azure portal.
The scm site uses Single Sign On, which means you won't need to type additional credentials if you're already logged in.
If you prefer to use basic auth instead, you can visit http://mysite.scm.azurewebsites.net/basicauth (or https://myservice.scm.azure-mobile.net/basicauth for mobile services) to enter your credentials.
You can use either the user publishing credentials or the site level credentials for basic auth. See the Deployment-credentials section for more details.
The Kudu service root has links to various useful features, including getting the Kudu diagnostic dump, launching the diagnostic console, seeing info about the runtime environment, and navigating the REST API.
Readers also liked: Azure .net
Deploying Episerver Site
To deploy an Episerver site, you'll need to create a publish profile in Visual Studio.
First, open your solution in Visual Studio and look for the "Publish" dropdown in the toolbar. Click on it and select "New Custom Profile".
For another approach, see: Azure Data Studio vs Azure Data Explorer
Next, select Folder as the publish target type and choose a path that ends with ".../wwwroot".
Make sure the correct configuration is selected for the proper transforms to be applied.
Once you've saved your publish profile, press the publish button to create a zipped copy of your site code.
Zip up the wwwroot directory, which is what you'll provide to Kudu for deployment.
To access Kudu, log into the Azure portal and navigate to the Development Tools section of your app service.
Select "Advanced Tools" and then "Go" to open Kudu in a new tab.
In Kudu, click on the "Debug Console" dropdown and select "CMD" to access the command line.
Drop your zipped file into the wwwroot folder on the server, and Kudu will unzip it for you.
Open up the wwwroot folder to confirm that it contains your new code.
Private Build
You can run a private Kudu build on Azure to make changes to the Kudu service and test them outside of Azure.
To do this, you'll need to clone Kudu from https://github.com/projectkudu/kudu.git and make whatever changes you want to the sources.
Run build.cmd at the root of the repo to create an artifacts\debug\KuduService folder containing the built Kudu bits.
You can then use FTP to copy the KuduService folder to your Azure site, and add an 'app setting' with name/value USE_PRIVATE_KUDU=1 in the Azure portal.
This will allow you to use your very own git engine instead of the one that comes with Azure.
Note that this only affects one site at a time, so you'll need to set up each site individually if you have multiple sites.
Also, keep in mind that running your own git deployment engine puts you in unsupported territory, so don't call product support if something doesn't work – instead, reach out to the Kudu team on JabbR, MSDN forum, or github.
Developing Locally and on Azure
Developing Kudu locally is a great way to test and modify the git deployment engine. You can clone Kudu from https://github.com/projectkudu/kudu.git and run build.cmd at the root of the repo to create the built Kudu bits.
Running Kudu locally allows you to test your changes outside of Azure, which is a huge advantage. You can make whatever changes you want to the sources and then run build.cmd to see the results.
To run Kudu locally, you'll need to clone the repository and run build.cmd. This will create an artifacts\debug\KuduService folder that contains the built Kudu bits.
Here's a step-by-step guide to running Kudu locally:
- Clone Kudu from https://github.com/projectkudu/kudu.git
- Make whatever changes you want to the sources
- Run build.cmd at the root of the repo
- Verify that the artifacts\debug\KuduService folder is created
By running Kudu locally, you can test your changes before deploying them to Azure. This saves you time and ensures that your changes work as expected.
Frequently Asked Questions
How to find Kudu in Azure?
To access Kudu in Azure, navigate to your Web App dashboard, click on Advanced Tools, and select "Go". From there, you can access Kudu's features, such as capturing memory dumps and viewing deployment logs.
How do I access Kudu Azure function?
To access Kudu for your Azure function, navigate to https://your-function-app-name.scm.azurewebsites.net with your Azure credentials. Replace "your-function-app-name" with the actual name of your Function App.
How does Kudu work?
Kudu stores data by column, not row, allowing for efficient encoding and compression. This columnar storage approach enables fast and compact data storage.
What is Kudu console in Azure?
Kudu is a hidden service site in Azure Web Apps that provides advanced tools for troubleshooting and management, accessible through the Azure portal. Access Kudu through your Web App dashboard to capture memory dumps, view deployment logs, and more.
How to open Kudu in Azure?
To access Kudu in Azure, navigate to your app service in the Azure portal, then go to Development Tools > Advanced Tools > Go. Alternatively, access Kudu directly via [sitename].scm.azurewebsites.net/DebugConsole.
Sources
- https://techcommunity.microsoft.com/blog/educatordeveloperblog/using-kudu-and-deploying-apps-into-azure/378585
- https://world.optimizely.com/blogs/andrew-pohto/dates/2019/7/deploying-your-episerver-site-to-azure-via-kudu/
- https://joonasw.net/view/get-managed-identity-access-token-in-azure-app-service-through-kudu
- http://blog.davidebbo.com/2012/06/developing-kudu-locally-and-on-azure.html
- https://stackoverflow.com/questions/56035616/how-do-i-open-kudu-console-in-azure-functions-consumption-plan
Featured Images: pexels.com