Sitecore Azure: Walkthrough – Installation to Deployment

by Max Slabyak

My tweet from 5 days ago:

You, too, can weep tears of joy after seeing exactly how magical this process is. I did bang my head against the wall a couple of times, but the wonderful support staff @ Sitecore, including Jesper Ravnsgaard, Product Manager for Sitecore, did help me reach the finish line.

First thing is first – you have to make sure you have met all the prerequisites and read the known issues from my previous post. The second thing you want to do is download the Windows Azure SDK from here. The third thing is download the latest version of Sitecore Azure from here, which is currently at version 1.0.4. If you read my previous post, you should have already sent out a request for and received a Sitecore Azure environment file. You cannot proceed without it. So don’t try. Seriously. Don’t.

Install The Certificate

You know the “10% inspiration/90% perspiration” shpiel? Getting the certificate to work correctly was the 90% perspiration part me. You have to follow each step verbatim, otherwise you will lose valuable time going through logs and emailing support. If you get stuck and this post does not help you, the latest version of the Troubleshooting Guide should help you pass this hurdle; otherwise, there is always Sitecore Support. My problem during this is that I was working on Sitecore Azure v1.0.4, while my guide was v1.0.3. Small detail that cost me 2 days. No biggie.

To install the certificate, there are a couple of steps:

  1. Make sure you are on v1.0.4. You will have to generate the certificate as Administrator. The most full-proof way is via command prompt.
  2. Open command prompt up as Administrator
  3. cd to {your sitecore install directory}/sitecore/shell/Applications/azure. I know that the documentation states to do it from /sitecore/admin/azure, but I was getting System.IO.FileNotFound exceptions until Sitecore Support pointed out that for v1.0.4 you need to be doing this from the former directory.
  4. Type MakeCert.bat to generate and install the certificate.
  5. The certificate will need read rights by the account under which the App Pool is running. In IIS7, there is a user group called IIS_IUSRS. Make sure to grant it, along with NETWORK SERVICE read rights. You would do this in the Certificates Snap-In under mmc.exe. Screenshots and directions are located on page 5 of the Troubleshooting Guide.

Know Your Rights

The way Sitecore Azure deploys your files is by copying the all your web files from the website root ({sitecore install path}\{website path}) to a WebRole directory under the $data folder of your installation. Therefore, you will need to grant read access to the NETWORK SERVICE user and IIS_IUSRS user group to the entire website root directory and its subdirectory. In some cases, you may see that both will need write access to your web.config. You can skip that if you are reluctant to do that, but your log files will immediately tell you if there is a problem with updating the web.config.

“To The Cloud”

azure firewallBefore we can proceed, part of deploying to the cloud is creating the core and web databases in your Azure account. It won’t be able to do so until you have allowed it access via firewall rules. You will need add to the external IP of the server you are deploying this from into the firewall rules. You can do that by navigating to the “Databases” section of your Azure portal, selecting your database, and clicking Firewall Rules.

At this point, your certificate is installed and your permissions are set up, and your SQL Azurefirewall rules are set. You are ready for flight takeoff. You can now click the Sitecore “start” button and navigate to Azure. If this is your first time running it, it will ask you to upload the environment file you received from Sitecore. Next, if it doesn’t hang or give you any certificate errors, congratulations. You are quite good at following directions. If not, try again from the top.

Clicking the green button will start the process that will copy your website files to the data folder and deploy them to the cloud. This process will typically take 2-5 minutes. If you are at this point, you can breathe easy. The rest is a piece of cake. After the transitioning is complete, you will get a long URL where your app is hosted (something.cloudapp.net). If you are like me, you will probably click it before you even finish reading this sentence and find nothing. Why is this the case, you ask?

Your files are deployed, but your databases are blank. Luckily, it’s an easy step – we just publish the entire site to the azure target.

Note: I ran into some issues here. For some reason, when clicking “publish,” I got an error that the connection string for the azure target was missing. I contacted Sitecore Support and they said it may have been a fluke, but in case this happens to you, just insert it manually into your /App_Config/ConnectionStrings.config file. The exact connecting string can be found in Sitecore’s Content Manager under /System/Azure if you navigate down to the database.

After it publishes, you can click on the hostname in the top Windows Azure icon which will end with cloudapp.net.

That’s it. Quite an easy process if you follow the directions step by step. It gets a little more complicated if you have additional databases, which you will have to create through SQL Azure, but other than that, this is a very straight-forward approach.

Do not hesitate to reach out to me with any questions or comments about this.

Share

Leave a Reply

Your email address will not be published. Required fields are marked *