Connecting to Azure Database from Local Instance

Jason Ellison asked on June 12, 2019 22:52

I have a Kentico 12 MVC implementation in Azure (the Admin and MVC applications are running as separate App Services). With setting the Web Farm Mode: Automatic, everything seems to work well(as far as synchronization), until I connect to the same database from a local machine instance of either the Admin or the MVC applications. That seems to reset the entire web farm servers to just whatever local instance I ran (which breaks all synchronization in Azure).

Is there a way around this issue without using Web Farm Mode: Manual or creating a local instance of the database?

Recent Answers

Dmitry Bastron answered on June 13, 2019 01:15

Hi Jason,

Could you please explain why do you need to connect your local instance of Kentico application to Azure database working with Azure solution?

Is it for testing, debug or to deal with the content somehow? Because the system reacts automatically as expected.

0 votesVote for this answer Mark as a Correct answer

Zach Perry answered on June 13, 2019 16:59

I would imagine when you connect from your local it is registering a new server in the web farm, and then probably over your limit of number of servers.

You can set your web farm to manual, then in the web config(or azure app settings) of the MVC and Admin sites, add this setting:

<add key="CMSWebFarmServerName" value="Admin" />

Then you just need to create the servers under that name in the web farm app. If your local instances have different names in the web config, they shouldn't register.

0 votesVote for this answer Mark as a Correct answer

Jason Ellison answered on June 13, 2019 23:02

Hi Dmitry. Testing and debugging are the reasons I connect to an Azure database from a local instance (more so, from the MVC application than the Admin application). Having to set up and maintain a local database (or remote debugging) for every single project just adds a lot of unnecessary overhead. Some applications, it's a lot more convenient to share the local/dev database in azure.

In Web Farm Mode: Automatic, when I start up a local instance of the MVC application, why does it also remove existing instances, when it adds my local instance to the web farm?

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.