Create
an Affinity Group
An
affinity group allows you to keep your database
and web site hosted in the same data center.
This is very important for performance reasons
because Ban Man Pro is a database-intensive
application.
To create an
Affinity Group, click Affinity Groups then click
New Affinity Group.
Name the
Affinity Group and choose a datacenter location
then click OK.

Create
a SQL Azure database
To create a SQL
Azure database, choose Database then Create a
new SQL Azure Database

Choose either
an existing SQL server or create a new one.

Choose the same
region you set for your affinity group.

Enter a
username and password for the database.

Next, in order
to access your database remotely you must allow
your company IP addresses to access the SQL
server. Enter the range of IP's as shown
below.


Enter a
database name and choose a size.

Click Finish to
complete the database creation.
Update
the Ban Man Pro configuration file to set the
database connection.
In the
downloaded Ban Man Pro files, find the file
called
ServiceConfiguration.cscfg and open in a text
editor such as notepad.
On the line
shown below, enter your database server, user
login and database name. The server is the
Fully Qualified Server Name.
<Setting
name="DBConnectionString" value="server=y8rrefclib.database.windows.net;UID=BanManProAzure;PWD=yourpass;DATABASE=BanManProAzure"
/>

Create
a storage account to hold uploaded images
To create a
storage account, click Hosted Services, Storage
Accounts then New Storage Account.

Enter a prefix
for the URL and choose the affinity group.
Then click Create.

Now view the
details of the storage account and copy the
Primary Access Key and note the account name.

Enter this
information in two locations in the
ServiceConfiguration.cscfg file then save the
file.
<Setting name="Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString"
value="DefaultEndpointsProtocol=https;AccountName=XXXXX;AccountKey=YYYYYYY"
/>
<Setting name="StorageBlobConnectionsString"
value="DefaultEndpointsProtocol=http;AccountName=XXXXX;AccountKey=YYYYYYY"
/>
Create
a hosted service.
To create a new
hosted service, click Hosted Services then New
Hosted Service.

Now enter a
name and URL prefix for the service.
Choose the Affinity Group option and select the
proper affinity group.
Choose whether
you want to deploy to staging or production.
Enter a deployment name.
Now choose the
package location and configuration file found in
the location where you unzipped the Ban Man Pro
download file. Click OK once finished.

To deploy the database you
must have SQL Management Studio 2008 R2.
When the Connect to Server
dialog box appears, enter the SQL Azure Fully
Qualified Server Name. Chose SQL Server
Authentication and enter the username and
password.
Click connect.
Click File, Open File and
choose the banmanproSQL11_Azure.sql script.

On the SQL management studio
toolbar, choose your database.

Now click Execute.

When complete, a message of
Query Executed Successfully will appear at the
bottom.
