Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
482 views
in Technique[技术] by (71.8m points)

.net - Determine if app is running in azure or not

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 fabric or cloud) or if it is being run as standard web app under iis.

How can I tell if it is running in cloud?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Think I found it:

Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment.IsAvailable

Thanks

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...