Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Both production and staging server running same cron in Azure

I have created an ASP.NET application which is deployed on Azure.

Every time whenever I want to publish it on Azure, I make use of a staging server to deploy and after testing everything on staging, I just swap both of them.

But there is a problem, I have some startup tasks that create some scheduled tasks for cron jobs. So, these task are also copied to production server from staging and cron jobs are run two times one on production and second in staging. But I want them only to run on production not on staging.

How can I prevent this duplicated cron job problem? Please give me some suggestions.

like image 633
atul Avatar asked Mar 28 '13 06:03

atul


People also ask

What is staging mode in Azure AD Connect?

This architecture allows the staging mode server to be located in a different datacenter. To apply this method, follow these steps: Install Azure AD Connect, select staging mode, and unselect start synchronization on the last page in the installation wizard. This mode allows you to run the sync engine manually.

How to compare the primary server configuration with the staging server?

If you have made custom changes to the primary server and want to compare the configuration with the staging server, then use Azure AD Connect configuration documenter. Select Connectors, and select the first Connector with the type Active Directory Domain Services. Click Run, select Full import, and OK.

How to configure Azure AD synchronization service?

Sign off/sign in and from the start menu select Synchronization Service. If you have made custom changes to the primary server and want to compare the configuration with the staging server, then use Azure AD Connect configuration documenter. Select Connectors, and select the first Connector with the type Active Directory Domain Services.

What happens when I clone configuration from another deployment slot?

When you clone configuration from another deployment slot, the cloned configuration is editable. Some configuration elements follow the content across a swap (not slot specific), whereas other configuration elements stay in the same slot after a swap (slot specific). The following lists show the settings that change when you swap slots.


1 Answers

There is no easy way in order to distuinguish staging and production environments. If I do remember correctly, you could use the Server Management REST Api to get more details about the current deployment. You just need to get the RoleEnvironment.DeploymentId and communicate with the REST Api by providing a valid X509 Certificate.

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

like image 124
emp Avatar answered Oct 19 '22 20:10

emp