Get RoleEnvironment info from Azure Web Role Accelerator
Is it possible to gain开发者_如何学Go information about the web role from sites deployed onto the Web Role Accelerator? For example, I want to get the instance name that is being used:
RoleEnvironment.CurrentRoleInstance
Yes.
Under the covers there is nothing particularly special about the Web Role Accelerator -- it's really just a quick way to publish additional sites to a Web role that's already deployed.
RoleEnvironment.CurrentRoleInstance
is a static property that can be called from any application, and given that RoleEnvironment.IsAvailable
is true you should receive the value you're expecting.
精彩评论