Both the production and the intermediate server are running on the same cron in Azure

I created an ASP.NET application that deploys to Azure.

Every time I want to publish it to Azure, I use an intermediate server for deployment and after testing everything at the stage, I just replace both of them.

But there is a problem, I have some startup tasks that create some scheduled tasks for cron jobs. Thus, these tasks are also copied to the production server from interns, and cron jobs are run twice in production and the second in the formulation stage. But I want them to work only in production and not in production.

How can I prevent this problem with cron duplication? Please give me some advice.

+7
source share
1 answer

There is no easy way to distract the production and production environment. If I remember correctly, you can use REST Api Server Management to get more detailed information about the current deployment. You just need to get RoleEnvironment.DeploymentId and contact REST Api by providing a valid X509 certificate.

http://msdn.microsoft.com/en-us/library/windowsazure/ee460806.aspx

+1
source

All Articles