For Web applications, Windows Azure provides caching capabilities to provide high-speed access, scale, and high availability to application data. The
AppFabric
service "
AppFabricCachingService
" runs to accommodate the caching and session management infrastructure. The Cache cluster can be started using the powershell.
In order to validate that the service is up and running, the following test can be performed.
namespace AppFabricServiceTest
{
internal static class Program
{
private static void Main(string[] args)
{
IsServiceRunning();
}
private static bool IsServiceRunning()
{
bool status = false;
var sc = new System.ServiceProcess.ServiceController("AppFabricCachingService");
if (sc.Status == System.ServiceProcess.ServiceControllerStatus.Stopped)
status = false;
else
status = true;
return status;
}
}
}
You would need
System.ServiceProcess
assembly reference in your project to invoke
ServiceController
and check the status, i.e.,
ServiceControllerStatus
. This enumeration provides various members including
ContinuePending
,
Pause
,
PausePending
,
Running
,
StartPending
,
Stopped
and
StopPending
.
Adnan Masood works as a Sr. Software Engineer / Technical Lead in a Monrovia based financial institution where he develops middle tier architectures, distributed systems and web applications using Microsoft .NET framework. He holds various professional memberships (ACM, BCS, and ACS) and several technical certifications including MCSD.NET, MCAD.NET and SCJP-II. Adnan is attributed and published in print media and on the web and holds a Masters Degree in Computer Science from Nova Southeastern University, FL and is currently pursuing his doctoral studies in Machine Learning. Adnan has taught WCF courses at University of California at San Diego and regularly present at local code camps. He is actively involved in the .NET community as co-founder and president of San Gabriel Valley .NET Developers group. His blog can be found at www.AdnanMasood.com and he can be reached via email at adnanmasood at acm.org