MVC Forum on Azure

If you want to host your MVC Forum on Azure as a webrole, you'll need to adjust the configuration of MVC Forum slightly. You could run it like on any other hosting platform, but when you run it on 2 or more instances, the attachments and search indexes would exist per instance. Not a good idea!

First you need to tell MVC Forum to use another storage provider, so locate the storageBuilder node in the configuration and replace it with this:

<storageBuilder type="MvcForum.Hosting.Azure.StorageBuilder, MvcForum.Hosting.Azure" />


The same goes for the Lucene searchBuilder, locate the regular one and replace it with this:

<add name="Lucene" type="MvcForum.Hosting.Azure.SearchBuilder, MvcForum.Hosting.Azure" />


So now MVC Forum will store attachments and search indexes in central storage, that way it's shared amongst the instances you're running.

Just two more things to do.

First off, MVC Forum needs to know which storage account to use, so when you create the webrole, open up the Roles node and select properties on your application's role. Find the "Settings" tab, and add a setting. This setting should be named "MvcForum.StorageConnection" and should contain the connection information for the storage account on Azure.

With the release of MVC Forum on Azure version 1.1.1, you can run MVC Forum on Azure web sites by creating a regular connection string node in the web.config file, call it "MvcForum.StorageConnection" and put in the storage account connection information here instead.

Secondly you'll need to tell MVC Forum the names of the containers that should be used for storing attachments and search indexes. Add this to the web.config file, under the appSettings node:

		<add key="AzureLuceneCatalog" value="[WhateverNameYouWantForLucene]" />
		<add key="AzureStorageCatalog" value="[WhateverNameYouWantForAttachments]" />


Please do not use the same name for the 2 containers, as the attachment container will have public access, and the Lucene container will not!

Last edited Sep 29, 2013 at 10:16 AM by steentottrup, version 2

Comments

No comments yet.