How to check if code is running on Azure Websites
I knew that we can use RoleEnvironment.IsAvailable to check if code is running in Web/Worker Role. How about Azure Websites ? I tried the above RoleEnvironment code but it always returns false. I need to run some configuration code in Application_Start so I cannot depend on the request stuff. Any help is appreciated. This is actually very easy simply check for existence of this environment variable: WEBSITE_SITE_NAME . !String.IsNullOrEmpty(Environment.GetEnvironmentVariable("WEBSITE_SITE_NAME")) The content for this will be the name of your site. To see more environment variable that you have