Windows Azure - Worker Role - Environment Discovery

Does anyone know how to determine if a work role works in a production or staging environment?

My work role sends daily bulletins by email, but if I have a code in progress, the email is duplicated because I have two workers.

Thoughts?

+4
source share
1 answer

The staticEnvironment static class is available to find out the current deployId. Using the current deployment, you can query the Diagnostics Management API to find out whether the deployment type is 0 or 1. I believe that β€œ0” is production, and β€œ1” is stage.

Hope this helps.

+8
source

Source: https://habr.com/ru/post/1335293/


All Articles