开发者

Get RoleEnvironment info from Azure Web Role Accelerator

开发者 https://www.devze.com 2023-04-11 02:01 出处:网络
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:

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号