London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!

Henrik Fransas
Jul 1, 2014
  4014
(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
Content Compliance Without the Chaos: How Optimizely CMP Empowers Financial Services Marketers

In financial services, content isn’t just about telling your story — it’s about telling it right. Every blog post, product update, or social post i...

abritt | May 22, 2025 |

Opal – Optimizely’s AI-Powered Marketing Assistant

Overview Opal is Optimizely’s AI assistant designed to accelerate and enhance the entire marketing workflow. Integrated natively across...

abritt | May 22, 2025 |

Integrating Address Validation in Optimizely Using Smarty

Address validation is a crucial component of any ecommerce platform. It ensures accurate customer data, reduces shipping errors, and improves the...

PuneetGarg | May 21, 2025

The London Dev Meetup is TOMORROW!!

The rescheduled London Dev Meetup is happening tomorrow, Wednesday, 21st May, at 6pm! This meetup will be Candyspace 's first, and the first one he...

Gavin_M | May 20, 2025

From Agentic Theory to Practicality: Using Optimizely Opal’s Instructions Feature

A practical look at Optimizely Opal’s Instructions feature — from built-in agents to creating and managing custom instruction workflows. Ideal for...

Andy Blyth | May 19, 2025 |

Common Mistakes in Headless Projects with Optimizely

Adopting a headless architecture with Optimizely is a major shift from the traditional MVC-based development that has been the standard for years....

Szymon Uryga | May 19, 2025