Freigeben über


Viewing Process Information for Microsoft Azure Web Sites.

Hello, I’m Finbar Ryan and I am a Senior Escalation Engineer in Microsoft Support. I help customers resolve issues on the Microsoft Web Stack which includes Azure WebSites.
I’m interested in troubleshooting, helping customers, and the world of Open Source Software.

Today, I’d like to talk to you about how you can understand what’s going in Process terms when you host your application in Azure WebSites.

As you all know Azure WebSites runs as a Platform as a Service (or PaaS) and so Microsoft hosts your application on a virtual machine in the data-centre.

For traditional web applications we are used to being able to connect to the server and use Performance Monitor and\or Task Manager to understand what’s going on on the server.

We have enabled monitoring functionality in the Portal and this is discussed in this article.

“How to monitor Websites”

However as developers and site administrators sometimes we’d like more information on what is happening on the site.

I’d like to show you three ways that you can access more information about your processes for your Azure WebSite.
These are via the Rest API, the Process Explorer or the new Azure Portal.

Process Information in Site Configuration Manager

As most of you are probably aware you get an additional site as part of your Azure WebSites hosting.

This is known as the SCM site or Kudu to give it’s code name.
I’ll link to the source code for Kudu below in the references section of this article.
(It’s also one of the open source projects that is part of the .Net Foundation).

You can access SCM by typing .scm.azurewebsites.net">.scm.azurewebsites.net">.scm.azurewebsites.net">https://<InsertYourWebsiteName> .scm. azurewebsites.net

The .scm bit is what gives you access to the Kudu site and you authenticate using your Microsoft or Organizational account or you can also use your publishing profile.

image

 

When you’ve signed in you’ll see a number of tabs along the top like this.

image

 

On the main Kudu page there’s a REST API Section and so the first way you can get access to your processes is via a call to https://<InsertYourWebsitename.scm.azurewebsites.net/api/diagnostics/processes .

This will return a JSON Document something like this.

[ { "id": 4684, "name": "w3wp", "href": https://<InsertYourWebSiteName>..scm.azurewebsites.net/api/diagnostics/processes/4684 } ]

This output may vary depending on the number of processes executing on your site and this will include Web Jobs.

The second way in SCM is to use the Process Explorer tab.

If you click on this you’ll get an output like this one.

image

 

You’ll see that in this instance I have a web job running the Diagnostics as a Service Site Extension which I’ll link to in the references section of the article.

For those of you un-familiar with IIS it hosts the application code in a worker process which is called w3wp.exe. This is an instance of an application.
You will have one of these each in general for each of the websites under a specific Web Hosting Plan.

You’ll also notice that I only have one W3WP.exe worker process running and this is for the SCM site.
I really like how the Processes are labelled so you understand what each process is responsible for.

Let’s send some requests to the site and see what has changed.

image

 

Now, I have 2 additional processes which are the W3WP.exe process for the site and it’s related Node.exe process as this is as a Node.Js site.

I’d also like to draw your attention to the fact that this also shows the Parent Child relationship of processes like Task Manager or Sysinternals Process Explorer.

We can click on the properties for each process to get even more information.

image

 

The Modules, Handles, Threads, and Environment variables tables give you even more insight.

Process Information in the new Azure Portal.

The new Azure Portal has a wealth of information including much more detailed process information.

If you navigate to https://portal.azure.com and sign in then you can select one of your Web Sites.

On the Blade for that Web Site you will see an Operations area and this contains the processes option.

image

 

Clicking on the Processes will add another blade with the process information. (Please note the warning)

image

I can then click on each process and get another blade with even more information.

image

 

And I can continue to click into Handles, Modules, Threads etc.

 

References

Kudu Github Home Page
https://github.com/projectkudu/kudu 

Processes Endpoint information from Kudu
https://github.com/projectkudu/kudu/wiki/Process-Threads-list-and-minidump-gcdump-diagsession

Diagnostics as A Service for Azure WebSites
https://azure.microsoft.com/blog/2014/07/08/daas/

Manage your Azure Websites directly with Websites Process Explorer
https://azure.microsoft.com/en-us/updates/manage-your-azure-websites-directly-with-websites-process-explorer/

Comments