Skip to content

Environment API

Colin Scott edited this page Aug 23, 2014 · 2 revisions

The Environment API provides the capability to determine what hosting environment the code is currently running in. It is analogous to RoleEnvironment.IsEmulated but provides more than a binary indication. The environments are specified in the AzureEnvironment enumeration. The environments recognised by LightBlue are:

  • LightBlue The code is running inside a worker role in the LightBlue host or a web role started by the LightBlue web host. It will be provided with the Standalone implementation of the LightBlue APIs.
  • Emulator The code is running inside the Azure emulator. It will be provided with the Hosted implementation of the LightBlue APIs.
  • ActualAzure The code is running on an actual Azure server somewhere in the cloud. It will be provided with the Hosted implementation of the LightBlue APIs.

The current AzureEnvironment can be obtained from the IAzureEnvironmentSource interface. This provides the CurrentEnvironment property for determining the environment the code is running in. It is also available from the static LightBlueContext.AzureEnvironment property.

Clone this wiki locally