Intranoggin

Blither, Blather, Web Content Management.
Blog » Kentico on Azure: Copy Production to the Development Slot

Kentico on Azure: Copy Production to the Development Slot

Now there may be quite a few updates you’ll want to make to the production site before we consider it our baseline. Maybe you want to edit the content of pages or make some css changes. Most likely you will want to update some values in the sites and settings applications. By the time it’s ready, you’ll have put in quite a bit of effort and we don’t want to just repeat that all again in the development slot. So here’s a shortcut.

1. First, go generate a new license to match your development slot URL.

a. Go to https://client.kentico.com/free-edition to generate a new key. For mine, my dev slot domain is intranogginkenticoapp-intranogginkenticodevapp.azurewebsites.net

2. In our Kentico site, open the Licenses application

Open Licenses Application

3. Click the New license button

4. Paste in your key and click save.

HINT: if you know you’re eventually going to be using a friendly URL for your site, now is a good time to generate that key as well and add it in. We’ll end up with all the prod & dev keys entered in all the prod & dev slots, but the extra environment keys won’t hurt anything.

5. Open the Sites Application

Open Sites Application

6. Click the edit button for your site, in my case, it’s the Personal Site

Edit Site

7. On the Domain aliases tab, add a new domain alias for your development slot. This will match the URL for the additional license you added above.

Add Domain Alias

8. Now open your Azure Portal (portal.azure.com) and navigate to your SQL databases (not your SQL Servers)

9. If you already have your dev database created from earlier, that was good practice, but now we’re going to delete it. In my case, I misspelled it the first time around like an idiot, so I’ll be deleting that one.

Azure DB Listing

b. Click on your development instance of the database.

c. Then click Delete at the top of the overview blade.

Delete Dev DB

e. You’ll have to confirm it of course.

NOTE: if it asks you to enter the name of the server, you’re in the wrong spot – you went to your SQL Servers listing instead of your SQL Database listing. Deleting your server will earn you a ticket to repeat most of what you’ve done up to this point.

10. Now open your production database

Production DB

11. And click Copy at the top of its overview.

Copy Database

12. Change its name to match the one you used in your development slot connection string. Select the Target Server to match the same server as your production server. Change the pricing tier if desired – I use S0 for development databases.

Copy Database Settings

New DB Listing

13. Once you click OK, it will only take a minute or two to create the copy. Once it’s complete, move on to the next step.

Now we’re going to use Visual Studio to publish our files to the development slot. It’s almost identical to the deployment we did before, but with a couple small changes.

14. If you don’t still have it open, open the WebApp.sln file I Visual Studio

15. Right click on the CMSApp project and select Publish

Visual Studio Publish

16. On the profile tab, Select Microsoft Azure App Service

Select Profile

17. If you’re not signed in already, you’ll need to enter your Azure credentials. Then expand the web app you created earlier, select the development slot, and click OK

Choose Deployment Slot

18. After you hit OK, it will send you on to the Connection tab. Click back onto the Profile tab and click the Manage profiles button.

Manage Profiles

19. Select the development slot profile we just created and click Rename.

Rename Publish Profile

20. Remove the redundant portion of the name and click close.

Adjust Text

21. Jump over the Connection tab to the settings tab.

22. Again, ensure the configuration is set to Release, and Check to remove additional files at destination. Click next.

Publish Settings

23. Preview if you want, otherwise, just click Publish. It will take a few minutes to push all the files up and then it will launch the site for you in your browser.

24. This time when the site launches, the database has already been fully populated and configured with all of the work you did on your production slot. You should be able to sign in to the /admin page with the same administrator password you set up in production.


Posted: 1/31/2017 5:50:00 AM by Ryan Miller | with 0 comments
Filed under: Azure, Install, Kentico