Check Windows Azure Roles instance running in Emulator?

SDK :  Windows Azure SDK 1.5

In Build Windows Azure SDK 1.5 got announced. Windows Azure SDK 1.5 allows us to check whether Roles are running in emulator or not?

Static method IsEmulated returns Boolean value after checking whether Role instance is running in emulator or not.


Signature of IsEmulated is as below and it is part of the class RoleEnvironment


You can check running instance is in emulator or not as below,

bool isRunningInEmulator = RoleEnvironment.IsEmulated;
if (isRunningInEmulator)
Label1.Text = "Running in Emulator";
Label1.Text = "Hey you are on Cloud";


I hope this post was useful. Thanks for reading  Smile

If you find my posts useful you may like to follow me on twitter or may like Facebook page of my blog If you want to see post on a particular topic please do write on FB page or tweet me about that, I would love to help you.

Published by

Dhananjay Kumar

Dhananjay Kumar is Developer Evangelist for Infragistics. He is a 8 times Microsoft MVP and well respected Developer Advocate in India.He is the author of 900+ Blog Posts, and can often be found speaking around India at conferences and hosting free workshops for programmers across the country. So far, he has hosted 60 free workshops on various topics like JavaScript, Angular, WCF, ASP.NET MVC, C#, Azure etc. Follow him on twitter @debug_mode for all the updates about his blog posts and workshops. You can send him email at debugmode [at] outlook [dot] com

2 thoughts on “Check Windows Azure Roles instance running in Emulator?”

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s