1. In Microsoft Visual Studio, modify the web.config file in the following way: a. In the configSection section add or uncomment the following declaration:
<sectionGroup name="telerik">
<section name="sitefinity" type="Telerik.Sitefinity.Configuration.SectionHandler, Telerik.Sitefinity" requirePermission="false" />
</sectionGroup>
b. To set the environment to Windows Azure and to enable the database configuration storage mode, add or uncomment the following: <telerik> <sitefinity> <environment platform="WindowsAzure" /> <sitefinityConfig storageMode="Database" /> </sitefinity> </telerik>
NOTE: The database configuration storage mode allows having shared storage (SQL Azure database) for all configuration changes, which is visible by all web role instances. Thus, changes made by one instance are automatically synchronized to all other instances. Backing up your database also backs up your configuration changes.
c. Ensure that the system.serviceModel/serviceHostingEnvironment element has the multipleSiteBindingsEnabled set to true:
<system.serviceModel> ...
<serviceHostingEnvironment ... multipleSiteBindingsEnabled="true" /> 2. Verify project’s references in the following way:
a. In the Solution Explorer, expand SitefinityWebAppReferences.
b. Make sure that all assemblies, which are referenced from SitefinityWebApp, including references to your custom libraries, have property Copy Local set to True, except the following:
.NET framework assemblies, which start with System, except System.Windows, which must have Copy Local set to True
Microsoft.WindowsAzure.ServiceRuntime MySql.Data and Telerik.OpenAccess.MySql.Data Interop.DexterLib
To view the properties of an assembly reference, select it and press ALT+ENTER.
3. Add the configuration and license files to the SitefinityWebApp project in the following way: a. In the Solution Explorer, select SitefinityWebAppApp_Data.
b. Click Show All Files button on top of the Solution Explorer window. c. Expand the Sitefinity folder.
d. In the context menu of folder Configuration, click Include in Project.
e. Include also the license file (having a .lic file name extensions), which is under the Sitefinity folder. If needed, refresh the Solution Explorer.
f. Edit the properties of the newly added license file by selecting it in the Solution Explorer and pressing ALT+ENTER. g. Change the value of the Build Action property from None to Content.
h. Include any customized resources (labels) from the Sitefinity\Resourcesfolder. This is also valid for Sitefinity installations, which have language packs imported. 4. Add a new Windows Azure Project to the solution.
a. In the context menu of your solution, click Add New Project… Add New Project window appears.
b. In the left pane, expand Visual C# and select Cloud. c. In the center pane, select Windows Azure Project. d. Enter a name for the project and click OK.
e. In the window that appears, do not create any roles and click OK. The wizard closes.
5. Add SitefinityWebApp as a web role.
a. Under the newly created project, open the context menu of Roles. b. Click Add Web Role Project in solution.
c. Select SitefinityWebApp and click OK. 6. Configure the web role.
a. Double-click on the newly added web role.
b. On the Configuration tab specify the Instance count.
This is the number of role instances that the Windows Azure Platform will create and run. You can change this number while the role is deployed and running.
c. Specify the storage account credentials for the Diagnostics results in the following way:
i. Get the storage account key by selecting the storage account in the Management Portal and in the Properties section on the right, under the Primary access key, click View.
ii. Click Copy to Clipboard button on the right.
If a popup appears, asking to permit clipboard access to the Silverlight plugin, click Yes. iii. Under Specify the storage account credentials for the Diagnostics results, click …
The Storage Account Connection String dialog box appears. iv. Select Enter storage account credentials radio button.
v. Enter the account name and paste the key, you have copied.
d. Go to the Endpoints tab and add an internal endpoint, using the HTTP protocol and name it
SitefinityInternalEndpoint.
Do not set the Public/Private Port and SSL Certificate Name settings. Sitefinity relies on the existence and naming of this endpoint to synchronize the running instances of your web role.
The following screenshot displays the internal endpoint:
NOTE: When you add an internal HTTP endpoint, Visual Studio automatically adds a binding of the web role site to that endpoint. Sitefinity relies on this to synchronize the communication among role instances (cache invalidation, etc.). e. Open the Local Storage tab and click Add Locale Storage.
f. Add a 1024MBstorage and name it LibrariesTemp . Make the storage to be cleaned on role recycle.
| Deploying Sitefinity Projects to Windows Azure | Deployment | Table of contents |
MIGRATE YOUR DATABASE TO SQLAZURE
1. Configure the SQL Azure firewall.
To be able to access your SQL Azure database server from your local machine, add a firewall rule for your IP: a. Log to the Management Portal and click Database in the lower-left pane.
b. In the tree on the left, expand your subscription and select your database server.
c. In the right, expand the list of firewall rules and select Allow other Windows Azure services to access this server checkbox. This adds a special rule named MicrosoftServices.
d. In the bottom of the list, click Add and enter a name for the rule.
e. Copy Your current IP address (shown at the bottom of the dialog) and paste it in IP range start and IP range end input fields.
f. Click OK.
2. Migrate your local database to SQL Azure.
If you use SQL Express data file, you must first attach it to a running SQL Server instance. a. Download and run the SQL Azure Migration Wizard.
b. On the Select Process step, select Analyze and Migrate SQL Database. c. Provide connection information to your local database.
No changes to the default settings are required until the script generation is completed on Results Summary screen. d. On the next step, provide connection information for your SQL Azure database server.
In Server, enter the SQL Azure Server fully qualified DNS name.
The name must have the following format: <yourservername>.database.windows.net. You can find the fully qualified DNS name in the following way:
i. In the Management Portal of Windows Azure Platform, click Database. ii. Select your database instance and expand Properties pane in the right. iii. The name appears in Fully Qualified DNS Name field.
e. Select an empty the database you have already created for this deployment or create a new one. To create a new database, click Create Database button, enter name and size, and confirm.
f. Click Next and confirm the execution of the previously generated migration SQL script against this database. g. When you are finished, click Exit to close the Migration Wizard.
3. Change the connection string in the DataConfig.config file of your project to point to the SQL Azure instance, where you have migrated your database.
The format of the connection string element is the following: <add dbType="SqlAzure" name="Sitefinity"
connectionString="Server=<serverName>.database.windows.net;User
ID=<userName>@<serverName>;Password=<password>;Database=<databaseName>;
NOTE: In order Sitefinity to function normally with SQL Azure, set the dbType attribute is to SqlAzure.
RECOMMENDATION: We recommend that you keep the Visual Studio solution for future purposes, such as upgrade. | Deploying Sitefinity Projects to Windows Azure | Deployment | Table of contents |