Kudu Key Bindings Explained
Introduction to Kudu Console
The Secret Engine Room
Every Azure App Service has a companion site, a sort of backstage area, called Kudu. It's the engine that handles deployments when you push code using Git, and it also provides a powerful suite of tools for managing and debugging your live application. Think of it as a direct command line and file explorer for your web server, all accessible through your browser.
Kudu gives you a level of access that’s incredibly useful for troubleshooting issues you can't replicate on your local machine.
Accessing the Console
Getting to the Kudu console is straightforward. You have two main options.
First, you can go directly by URL. If your app's address is https://my-awesome-app.azurewebsites.net, then your Kudu service is running at https://my-awesome-app.scm.azurewebsites.net.
Just add
scmto the domain name, right beforeazurewebsites.net. You'll use the same credentials you use to deploy your app.
Alternatively, you can navigate there from the Azure Portal. Go to your App Service, and in the left-hand menu under "Development Tools," select "Advanced Tools." Clicking "Go" will open the Kudu dashboard in a new tab.
Navigating the Dashboard
Once you're in, you'll see a clean interface with several key areas. The main page provides information about your environment, including system info, app settings, and connection strings. This is a great place to verify that your configuration is loaded correctly.
The top menu bar contains the most important tools:
- Environment: The default page, showing your application's configuration.
- Debug console: A powerful combination of a command-line interface and a file explorer. You can choose between CMD and PowerShell.
- Process Explorer: A live view of all processes running in your App Service plan. You can see CPU usage and even kill processes.
- Tools: A dropdown with other utilities like downloading diagnostic dumps, accessing log streams, and more.
Basic Operations
The Debug console is where you'll likely spend most of your time. It's split into two parts: a file explorer on top and a command line at the bottom. These two views are linked. As you cd into a directory in the console, the file explorer updates to show that directory's contents.
Your application's code and deployed files live under D:\home\site\wwwroot. This is the root directory for your web app.
PS D:\home> cd site\wwwroot
PS D:\home\site\wwwroot> ls
Directory: D:\home\site\wwwroot
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---- 5/10/2024 3:15 PM 1894 appsettings.json
-a---- 5/10/2024 3:15 PM 268 Global.asax
-a---- 5/10/2024 3:15 PM 6432 Web.config
You can perform basic file management directly in the browser. You can click the pencil icon to edit a text file, the minus icon to delete a file, or simply drag and drop files from your desktop into the file explorer to upload them. This is incredibly handy for making quick configuration changes or uploading a missing file without a full redeployment.
The Process Explorer is your go-to for performance issues. If your app is running slow or is unresponsive, you can check here to see if a specific process is consuming too much memory or CPU. You can right-click any process to view its properties or terminate it if necessary.
Finally, under Tools, the Log stream option is a lifesaver. It opens a real-time feed of your application's console logs as they are being written. When you're trying to debug an issue that only happens in the live environment, watching the log stream while you reproduce the error is one of the fastest ways to find the cause.
What is the primary role of the Kudu service in an Azure App Service?
If your web app's URL is https://my-cool-app.azurewebsites.net, what is the direct URL for its Kudu service?
Now that you've seen what Kudu can do, you have another powerful tool for managing your Azure applications.
