How can I create a site for my Azure web application with my own database?

I have an MVC website that is connected to an azure web application and has continuous deployment to a custom website. It works great! After I sign up, a successful build is automatically deployed to the intermediate slot of my webapp. After I verified that this stage looks good, I can swap the two slots to make prod onto the stage and vice versa.

I recently decided that I want production and intermediate slots to connect to various databases so that I can enter test data on an intermediate site without cluttering the prod database.

I am naive, although I could have done this by editing the connection strings in the configuration for the staging site to point to the new database. It seemed like it worked, but the next time I changed the configuration after deployment, I realized that the connection strings are swapped in the process. This is not what I was striving for.

Does anyone know how I can have two deployment slots point to different databases and support these connections after the exchange? Is there any other way that I should think about this?

+5
source share
1 answer

Azure provides the answer here . I copied their text below.

Some configuration items will track content through a swap (not), while other configuration items will remain in the same slot after swap (a certain interval).

Fortunately, connection strings can be configured to use the slot. to configure the connection string to stick to the slot (not replaceable), access the Application Settings for a specific slot, then select in the Slot field > for the configuration items that you want to insert a slot.

enter image description here

+3
source

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


All Articles