Get mojoPortal and Set Your Connection String for SqlAzure

2. Right click the downloaded zip file and choose Extract All. The contents of the wwwroot folder are the needed files, you can discard the other files and rename the wwwroot folder as myAzureFile or whatever you want, but should probably give it a meaningful name so that you will know what the folder is later on. When you upgrade you should deploy the upgraded files into the same folder so that you have a local copy of exactly what is deployed.

3. Rename the user.config.sample file in the root to user.config and enter the connection string for your SqlAzure database

there.

4. Rename the Web.config file to Web.mediumtrust.config, and rename the Web.fulltrust.config file to Web.config

Disable the Lucene.NET Search Index

Also add this in user.config because the built in Lucene.NET search engine does not currently work in Azure:

<add key="DisableSearchIndex" value="true"/>

You can enable Bing or Google for site search in Site Settings after your site is up and running.

Generate a Custom Machine Key

Generate a custom machine key and replace the machine key in Web.config with the one you generated. Note that when you upgrade, you'll need to make sure you copy this machine key into the new Web.config file that comes in whatever version of mojoPortal you upgrade to. Once you have established a custom machine key it should never change, if it does then you won't be able to login if using encrypted passwords because the encryption uses the machine key.

Tip: You can skip this step for now and then use mojoPortal to generate a new machine key. It just means you will need to edit and re-upload your Web.config after the site is up and running. Just don't change to encrypted password until you have configured a custom machine key.

Configure Email

Configure SMTP settings for email by adding these in user.config and editing them with settings to an smtp server that you have access to.

Note that "mojotest1" in the example above is the namespace, so you would replace that with your own namespace, and you would replace the AzureCacheAuthorizationInfo value with your own. Once your cache is active, you can scroll down the Properties on the right hand side of the page and click the view button next to Authentication Token.

Click the "Copy to Clipboard" button then you can paste the value into the Cache:AzureCacheAuthorizationInfo setting.

It is very important to use SSL because cached items are serialized and sent across the wire, so we want to make sure they are encrypted during transport.

Although we don't make much use of session state in mojoPortal, we might as well configure session state and web output caching to also use the AppFabric Cache. If you have any custom features that rely on session state they will need to have a shared session state so that the session variables can be access correctly no matter which web role node is handling the request.

In the Windows Azure Platform Portal, click on your cahce and then click the "View Client Configuration" button in the toolbar.

Configure NeatUpload

​You'll note that we chose to use the full trust web.config file above. The only difference between the full trust and medium trust web.config files is that the full trust one has NeatUpload enabled. NeatUpload is an upload control that provides a progress bar during uploads but it doesn't work in Medium Trust hosting. However for web farm environments such as Windows Azure it does require some additional configuration steps. Basically you wan to find this in your Web.config file:

Note that the decryption key is just a random Guid with the dashes removed, it would be a good idea to generate your own guid and replace that one with your own, but don't forget to remove the dashes.

Configure the mojoPortal System Log to Use the Database

Edit the log4net.config file in the root to enable logging to the database and disable logging to the file system. We don't want to log to the file system because then each web role instance will be logging to its own copy of the log file and they would all being trying to sync changes to that file in blob storage and we don't want that happening.