Determine if app is running in azure or not

前端 未结 2 1932
失恋的感觉
失恋的感觉 2020-12-17 10:27

I have an asp.net mvc app that is built to run as standard web app in iis or in the cloud.

I need to be able to determine if the app is being hosted in azure(dev fab

2条回答
  •  时光说笑
    2020-12-17 11:17

    Think I found it:

    Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment.IsAvailable
    

    Thanks

    @Wheat: Thanks for such a quick response, makes stackoverflow.com a great resource.

提交回复
热议问题