title: Can I detect if my code is executing in an Azure worker role?
body: <p>I have some shared assemblies/projects that are used within Winforms apps, windows services and now Azure worker roles.</p>
  
  <p>Is there any way that I can detect at runtime if I am running in an Azure role.</p>
  
  <p>I have found how you can detect if running Azure emulator or not:</p>
  
  <pre><code> Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment.IsEmulated
  </code></pre>
  
  <p>But this does not do what I want.  I would also prefer not to have to add references to any of the Azure assemblies in my shared assemblies.</p>
  
  <p>Ideally I would like something similar to what I use to detect if running as a console vs a service:</p>
  
  <pre><code>System.Environment.UserInteractive
  </code></pre>
  
  <p>Is there anything that gives me this logic?</p>