Getting windows azure accelerator for web roles to work
“The Windows Azure Accelerator for Web Roles makes it quick and easy for you to deploy one or more websites across multiple Web Role instances using Web Deploy.”
That’s how the git hub project page describes the project.
Kristofer Liljeblad from Microsoft showed me a demo of this on a conference (Øredev) we both attended.
Really awesome stuff, this project makes it possible to deploy one or multiple sites within one web role.
I intend to use this for a number of small sites, mostly WCF projects for my windows phone apps.
It should be noted that perhaps it is not the best option for really large sites.
The project is available on github:
What I noticed when installing this is that the VSIX files (providing Visual studio templates) no longer where included and the setup file for version 1.1 where missing, and since the project now looks to be completely different, any guides currently available won’t do the trick.
There are a few thing you’ll need to have on your computer to be able to use Azure.
I’m quite new to Azure so I needed to install them.
1. Windows Azure SDK
Download and install from http://www.windowsazure.com/develop/downloads/
and click on the .net link.
This will download and open Web platform installer with Azure already selected.
Click install and let the installer do its magic.
2. SQL Server
To be able to debug your Windows Azure apps you’ll need SQL server (express is enough) on your machine.
It is possible to connect to an SQL server on another machine but it will have to know about your user (i.e connected to the same domain), since I’m not connected to a domain it was less work to install SQL server.
Setting up the project
1. Download the source
The latest source should be available from here:
2. Extract the zip
and open the AzureMultiTenantApp.sln in Visual Studio
The solution contains three projects
First open the AzureMultiTenantApp.Web located under AzureMultiTanantApp.Cloud\Roles.
Here we can setup the configuration, in my case I only want one instance and a small VM.
You probably want to change the AdminUserPassword to something a bit more tricky =)
storage and Connectionstring
Create a new storage in the Azure management portal.
Storage accounts –> new storage account
Let us call it “storagename” and select the region where you want your data stored.
Now it is time to construct a connectionstring, a connectionstring to azurestorage looks like this:
The key can be found in the Azure management portal, select the storage and to the right side you will find it.
You can use either one of them.
We need to add this connectionstring in two places
First we need to add a new connectionstring in the file ServiceConfiguration.Cloud.cscfg
<Setting name="Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString" value="DefaultEndpointsProtocol=https;AccountName=NAME;AccountKey=KEY" />
Secondly add the same connectionstring to the DataConnectionString-setting in the same file.
In the ServiceDefinition.csdef file under the Imports tag add:
<Import moduleName="Diagnostics" />
Finally time to publish =)
Right click on AzureMultiTenantApp.Cloud and select publish
Select Sign in to download credentials
Sign in with your live ID and follow the instructions
Select a subscription end press next
Enter a name for your Hosted Service and choose the location.
Make sure that the storage name we created before is selected.
Check the Enable remote desktop for all roles and then click on settings, enter name and password and make sure the expiration date is set to something far away.
Also check the Enable Web Deploy for all web roles checkbox.
Click next, read the summary and then publish.
Publishing will take approximately 15-20 min
And we are done, now you can surf to YOURHOSTEDSERVICENAME.cloudapp.net and login to your new portal =)