Azure websites RoleEnvironment.IsAvailable equivalent [duplicate]

久未见 提交于 2019-12-09 00:34:31

There are many ways to differentiate running on Azure Websites of in a development environment.

If it's in the context of a request then I would go with checking the host if it's localhost vs mysite.com for example.

Another option is to check any of the Environment Variables that Azure websites injects in your site. You can find a list in here https://<yourSiteName>.scm.azurewebsites.net/Env

Finally you can define your own AppSetting in Azure Portal for the site, then check it's existence to know which environment you are running on.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!