Capturing Dumps of Windows Azure Web Sites

July 1, 2013

no comments

Among the hundreds of new feature announcements at Build, one gem is hidden in plain sight: an improvement to the Kudu platform (Windows Azure Web Sites) which enables you to capture a dump file of your website’s process across the wire. No more remoting into the destination VM, fiddling around with tool downloads, and putting the dumps in a shared FTP folder. You can now generate a minidump – or even a full dump if you need to – by hitting a diagnostics endpoint on your website.

Specifically, if you set up a Windows Azure Web Site at foo.azurewebsites.net, you can hit foo.scm.azurewebsites.net/diagnostics/processes/0/dump and after providing your deployment credentials your download will be ready to go.

To test this, I created a simple ASP.NET MVC application that hangs in one of its controllers:

public class HomeController : Controller
{
    //
    // GET: /Home/

    public ActionResult Index()
    {
        Thread.Sleep(Timeout.Infinite);
        return View();
    }
}

I deployed the application to Windows Azure Web Sites, hit the offending controller, and while the browser was indefinitely waiting for a response, captured a dump file using the diagnostic endpoint.

You can then open these dump files in Visual Studio or WinDbg, or any other dump analysis tool of your choice. For example, when I opened the dump in Visual Studio, I could easily find the outstanding request and the call stack of the hung thread using the Parallel Stacks window.

To summarize, obtaining a dump file (even a minidump) of a running web sites is an extremely powerful capability, and having the ability to do so web sites running in Windows Azure is nothing short of incredible. Good luck debugging your own web sites with this trick!

Add comment
facebook linkedin twitter email

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

*