World is now on Opti ID! Learn more

Henrik Fransas
Jul 1, 2014
  4015
(0 votes)

Using Windows Azure Blob Storage in a local EPiServer site

Sometimes you might have the need of testing different versions of a site or for some other reason quickly put out a site. If you have a nice testing infrastructure with an expensive SAN or maybe complex DFS-replication for your VPP-directory this might be a bit of work, and maybe expensive to do. For us for example we can simply add another site in the IIS, but if we like to add another directory for the DFS replication we have to contact the infrastructure people. Because of this and because that EPiServer now support having your VPP-files (blob-storage) in Amazon or Windows Azure I decided to compare the performance of having the files in a local blob storage with having them in a Windows Azure blob storage. I did like this:

First I created two new EPiServer-projects in Visual Studio 2013 with the Alloy MVC template using the EPiServer extension from EPiServer and one Windows Azure Storage. After that I updated all EPiServer nuget package so to be up to date and for the one that are going to use Windows Azure blob storage I added two more packages, “EPiServer Azure 7.9.0” and “EPiCode.BlobConverter 1.0.0.1” (thanks BV Network AS for that one!). After that I run the both sites locally to be shore that EPiServer created the necessary blob files in the AppData folder (they are created on the first run of the site for the Alloy template) and after that I updated web.config for the Azure blob storage solution to use blob storage with the help of this article: http://world.episerver.com/Documentation/Items/Developers-Guide/EPiServer-CMS/75/Deployment/Deployment-scenarios/Deploying-to-Azure-websites/. When that is done I run the Azure blob storage site locally again and logged in to admin and run the job “Convert file blobs” to upload the blobs to Windows Azure. After verifying that they were there I deleted the blob-directory from the AppData folder.

Now I was done with all the necessary changes and on local run on the developer machine it all locked good so now it was time to deploy it to two different virtual machines in Windows Azure so you can try it out also. To do a deploy to a virtual machine in Windows Azure is very simple with Visual studio 2013, all you have to do is right click on the website and choose publish Web and choose Windows Azure Virtual Machine. After doing that you can select an existing or create a new one from here.

2014-07-01_2147

Because these machines does not support local db out of the box I choose to deploy my two databases to SQL Azure. Doing this is also very easy if you got SQL Server Management Studio on your computer, all you have to do is to add the databasefiles from the project to your local server (or any other) and then rightclick on the database and below tasks select Deploy Database To SQL Azure.
A note is that with current version of the EPiServer database there are two things you have to do to get this to work, this is:

1. Add a clustered index to the table: CompletedScope

2. Change the stored procedure InsertCompletedScope so it says
    “UPDATE [dbo].[CompletedScope] WITH(ROWLOCK, UPDLOCK)” instead of
    “UPDATE [dbo].[CompletedScope] WITH(ROWLOCK UPDLOCK)”

After doing all that I changed so the web.config was pointing to the SQL Azure database and did a new deploy to the virtual machine. When that was done, I went into the Azure portal and connected to these virtual machines with RDP and did a manual copy of the blob-directory to the one with local files and added a demo license to both of these.

To try out them just go to these address and bare in mind that I used the smallest possible version of virtual machine so my MSDN account will not run out of credits on day one so the sites might be a little slow.

Alloy site on Azure virtual machine with local blobs and SQL Azure database:
http://epilocalblob.cloudapp.net/
Alloy site on Azure virtual machine with Windows Azure blobs and SQL Azure database:
http://epiblobazure.cloudapp.net/

I think that it works pretty good to have the blobs in Windows Azure even when the sites are in your own environment for development and tests. What do you think?

Jul 01, 2014

Comments

Please login to comment.
Latest blogs
Make Global Assets Site- and Language-Aware at Indexing Time

I had a support case the other day with a question around search on global assets on a multisite. This is the result of that investigation. This co...

dada | Jun 26, 2025

The remote server returned an error: (400) Bad Request – when configuring Azure Storage for an older Optimizely CMS site

How to fix a strange issue that occurred when I moved editor-uploaded files for some old Optimizely CMS 11 solutions to Azure Storage.

Tomas Hensrud Gulla | Jun 26, 2025 |

Enable Opal AI for your Optimizely products

Learn how to enable Opal AI, and meet your infinite workforce.

Tomas Hensrud Gulla | Jun 25, 2025 |

Deploying to Optimizely Frontend Hosting: A Practical Guide

Optimizely Frontend Hosting is a cloud-based solution for deploying headless frontend applications - currently supporting only Next.js projects. It...

Szymon Uryga | Jun 25, 2025

World on Opti ID

We're excited to announce that world.optimizely.com is now integrated with Opti ID! What does this mean for you? New Users:  You can now log in wit...

Patrick Lam | Jun 22, 2025

Avoid Scandinavian Letters in File Names in Optimizely CMS

Discover how Scandinavian letters in file names can break media in Optimizely CMS—and learn a simple code fix to automatically sanitize uploads for...

Henning Sjørbotten | Jun 19, 2025 |