The Accelerator project and Web roles

Nov 4, 2010 at 3:32 PM

While Using the Accelerator to set up Umbraco on Azure, the project contains one worker role. Does the Accelerator project need a Web role?

Nov 4, 2010 at 4:34 PM

The Accelerator engine will start Umbraco inside the worker role.  For Umbraco, the engine uses a hostable web core (HWC) approach; essentially the same method used by Web Roles until the most current Azure SDK. Running inside a worker role we are able to delay the spin up of IIS until we have a mounted cloud drive.   (Of course you could also move an Umbraco site from an uploaded solution package, or blob storage, to a local storage area using the Accelerator engine, and forgo cloud drives).   Let me know if you have any problems or other questions.  Happy to help.  

//i| Ryan 

Nov 5, 2010 at 2:28 PM
Edited Nov 5, 2010 at 6:58 PM

I was able to build the Accelerator project successfully, upload the  Blob to Azure and build the service package. I then deployed it to an Azure Hosted Service

The status of the AcceleratorWorkerRole: Ready 1

When I go to the website url,  I get “500 – Internal server error”

Any ideas?

 



Accelerator Worker Role Settings
For the AcceleratorConnectionString I have
DefaultEndpointsProtocol=http;AccountName=<storage_account_name>;AccountKey=<storage_account_key_from_portal>
For the AcceleratorApplication I have Umbraco, 4.x

I am pointing to an umbraco instance in IIS (c:\inetpub\wwwroot\umbraco)

I set the LocalSitePath  property in the AcceleratorWorkerRole configuration to point to the umbraco instance in IIS. (which is c:\inetpub\wwwroot\umbraco)

The Umbraco.config looks like below:

<application name="Umbraco" version="4.x" description="Umbraco CMS v. 4.x">

  <params>

    <param key="UmbracoHome"    value="$(IisSiteHome)\umbraco" />

    <param key="UmbracoAppPath" value="/umbraco" />

    <param key="IisDriveUri"    value="$(AcceleratorDrivePageBlobUri)" />

</params>

    <dependencies>

        <applications>

            <application name="IIS" version="7.5" />

        </applications>

        <validation>

            <fileValidation path="$(UmbracoHome)\install\steps\detect.ascx" 

                            checkAccess="false" 

                            required="true" />

        </validation>

    </dependencies>

    <configuration>

        <files>

            <file path="$(UmbracoHome)\install\steps\detect.ascx">

                <regex pattern="(?i)(?s)(&lt;asp:ListItem\s+?Value=&quot;MySql&quot;[\s\S]+?/&gt;)" 

                       replacement="$1&lt;asp:ListItem Value=&quot;VistaDB,VistaDB For Umbraco&quot; Text=&quot;Embedded database (VistaDB)&quot; /&gt;" />

            </file>

            <file path="$(UmbracoHome)\web.config">

              <regex pattern="(?s)(?&lt;open&gt;&lt;sessionState\s.*?mode=&quot;)(?&lt;mode&gt;.+?)(?&lt;close&gt;&quot;.*?/&gt;)"

                     replacement="${open}InProc${close}"

                     evalVariablesInPattern="true"

                     evalVariablesInReplacement="true" />

            </file>

        </files>

    </configuration>

    <runtime>

        <onStart>

            <webServer>

                <application applicationPath="$(UmbracoAppPath)"

                             virtualDirectory="/" 

                             physicalPath="$(UmbracoHome)"

                             />

            </webServer>

        </onStart>

    </runtime>

</application>


<!--EndFragment-->

Nov 7, 2010 at 4:27 AM

I'm having the same problem as iggym...http 500 ... not sure how to troubleshoot it.

The records in WADLogsTable seem to indicate that the clouddrive was mounted properly and the HWC was started.

Any ideas?

Nov 10, 2010 at 5:20 AM
Edited Nov 10, 2010 at 5:21 AM

I've seen the server 500 issue on a number of rollouts, and the two most common issues are: 

1)  Database Access.   Are you able to verify access to SQL Azure (or whichever database platform is supporting your installation)?  If SQL Azure, the portal allows for firewall configuration, which has hit us on a couple of rollouts (often in the local dev fabric, see below). 

2)  Missing Assemblies.  Assemblies which exist on the local Umbraco server; but are not part of the default environment supplied by WIndows Azure or in the bin folder of your uploaded site.  The solution for this is to simply move any required assemblies into the bin folder of your uploaded site.  Another way to test this quickly if you used AccelCon.exe to publish your web site as a cloud drive it will have left a copy of the .vhd file in the publish directory.  You can mount this file using the Disk Management mmc tool on any Windows 7 or Server 2008 R2 system.  Preferrably on a system that would only have the base assemblies and not the same system (with the same GAC).  Once the drive is mounted, use IIS manager to point to the root of the web site on that disk and see if everything works.  This is even better if done in the Azure dev fabric (see below).

3)  AcceleratorApplication Setting:  The third item for Umbraco, would be to make certain that the Service Configuration specifies the correct version of to load.  3.x or 4.x.  The 3.x definition requires that ASP.NET classic mode pipleline be defined, so a server 500 error will result if the incorrect definition is specified (for 4.x using 3.x; and 3.x using 4.x).

Those three issues aside the best tactic for validating a solution is running it in the local dev fabric first.  I'm working on a post for this to add to the Documentation section.  Its somewhat raw, but it may be useful so I'm adding it here:

Note:  a system prerequisite required by the Accelerator/Azure applicationHost in the local dev environment is to install Rewrite 2.0 for IIS.  This is defined in the base configuration files, and will already exist up on Azure, but will tank any site running in the local Azure fabric sans the dll in the GAC.  It can be installed (and often already is) using the WPI or directly from  http://www.iis.net/download/URLRewrite.

Accelerator Debugging in the Local DevFabric

1

Open the Accelerators solution.

Start Visual Studio 2010 as an Administrator, navigate to the folder with the Accelerator solution code, and open the Accelerators.2010.sln solution file.

2

Configure your application.

Perform or verify that the accelerator configuration settings match your application or service requirements. Refer to the appropriate guide sections for detailed information on updating the ServiceConfiguration.cscfg, ServiceDefinition.csdef and application definition files.

3

Start Debugging (F5)

Visual Studio will build your solution and then start it up in the debugger. It might appear as if nothing is happening.

Monitoring the Accelerator in Visual Studio

The accelerator will write the startup trace log to this window each time it is run in the development fabric.

1.   In the Visual Studio menu, click View.

2.   Select Output.

Monitoring the Accelerator in the Development Fabric UI

The accelerator engine trace information can also be viewed in the Development Fabric UI. The Development Fabric UI provides access to various operations which may be performed on application running in the development fabric. In this case, clicking on a running instance of the Accelerator’s worker role will provide a view of the trace information being written.

1.   Right-click on the Windows Azure notification icon in the task bar.

2.   Select Show Development Fabric UI.

4

Open the Development Storage UI.

To display the UI, when the development fabric is running, right-click the Windows Azure icon in the task bar and choose Show Development Storage UI.

5

Open the local Azure Drive Folder.

In the Development Storage UI, click the File menu and choose Open Azure Drive Folder in Windows Explorer.

6

Navigate to the local Accelerator Drive Folder

In the Windows Explorer window, click to navigate to the child folder corresponding to Accelerator configuration. This folder will be created the very first time you run your Accelerator configuration in the local development fabric. (It should still be running from Step 3…)

7

Copy your Application Files.

Use Windows Explorer to copy all of the files necessary for your site into this folder. The root of this folder will be seen as the root of the hard drive when the Accelerator starts your application in the local development fabric. You should simulate the exact structure of the application files and folder layout of the cloud drive the Accelerator will mount and use live on Windows Azure.

8

Restart Visual Studio Debugging

Stop the Visual Studio debugger session which has been hosting the Accelerator, (Shift-F5), wait a few moments, then restart a new debug session, (F5).

View the Accelerator start up output and the simulated cloud drive should now be working in your local development fabric.

This process only has to be performed the first time you use a new cloud drive. A cloud drive is referenced by the value in the AcceleratorDrivePageBlobUri configuration setting. If this setting is changed, the steps will need to be performed again to create the application content on the simulation drive. If you wish to have multiple different application drives for scenario testing, simply change the configuration string to provision new drives, or to switch between existing. A restart of the debug session will be required to unmount and mount a new simulation drive.)

9

Determine Local Site Address

The final step is to look at the Accelerator output and locate the simulation address/port of the site on your local system. This should be at the end after all the processing and trace information stops scrolling. There should be a line with information similar to 127.0.0.1:5001. This is what you can put into your browser to test connect to and using your application in the development fabric. The port will change each time a new debug session is started; so the manual lookup of the port assigned by the development fabric is necessary.

 

Please let me know if any of this is confusing, or where I can add more detail.   It would be great to add the feedback and then make republish to the general documentation area.

Best Regards,

//i| Ryan 

Nov 10, 2010 at 5:29 PM

Hi Ryan,

I was able to get the site to show up on my localhost by following the above instructions (Accelerator Debugging in the Local DevFabric), Should i then upload to Azure using AccelCon?

I also had questions based on your above reply about the following:

1)  Database Access.   Where do I specify  access to SQL Azure? Do I need to migrate my umbraco data from my local database to SQL Azure?

2) I started the Disk Management tool (run  compmgmt.msc), mounted the  .vhd file and was able to create a new website in IIS pointing to the mounted drive. I was able to view the site and the admin dashboard. I am assuming that means that the vhd has all the content for the site. Is that correct? When i run the site in Visual Studio, I do not see the media items (jpgs, gifs etc.)

3)  For the AcceleratorApplication I have Umbraco, 4.x, I am using Umbraco 4.5.2 for .NET 4 with SQL Express. Is that the correct setting?

Thanks for the help.

Iggy

 

Nov 11, 2010 at 5:04 PM
Edited Nov 11, 2010 at 5:04 PM

I am not sure where I should specify my SQL Azure access information. On my local instance I am using SQLExpress. 

Do I need to migrate my SQLExpress data into SQL Azure? 

 

Nov 11, 2010 at 6:13 PM

I am struggeling with the same issues.

When trying to run in dev fabric it gives me exceptions that claims that the webcore dll does not exist. But it very well does.

Also in Azure I get error 500...

any clues?

Nov 11, 2010 at 10:20 PM
Edited Nov 12, 2010 at 2:27 PM

For SQL Server, I migrated my SQL Express data to SQL Azure using SQL Azure Migration Wizard v3.4.I changed my connection information in the web config to point to the SQL Azure database.
i.e. Changed

<add key="umbracoDbDSN" value="server=.\SQLExpress;database=umbraco452;user id=xxx;password=xxx" />

with this:

<add key="umbracoDbDSN" value="server=tcp:<<youraccountname>>.database.windows.net;database=<your_umbraco_db>;user id=<<youruser>>@<<youraccount>>;password=<<yourpassword>>" />

Still no success but at least now am sure the data has been migrated to SQL Azure.


Useful Links:

  • SQL Azure Migration Wizard v3.4 -- http://sqlazuremw.codeplex.com/
  • humphrey sheil's blog -- http://humphreysheil.blogspot.com/2010/08/umbraco-cms-complete-install-on-windows.html
  • Using SQL Server Management Studio R2 with SQL Azure -- http://geekswithblogs.net/iupdateable/archive/2009/11/13/using-sql-server-management-studio-r2-with-sql-azure.aspx 
  • The Project Code-Named Houston in  the SQL Aure Labs (http://www.sqlazurelabs.com/) -- http://www.sqlazurelabs.com/map_landing.htm
Nov 12, 2010 at 2:39 PM
iggym wrote:

I am not sure where I should specify my SQL Azure access information. On my local instance I am using SQLExpress. 

Do I need to migrate my SQLExpress data into SQL Azure? 

 

The Accelerator documentation does not cover this, but to use SQL Azure with your Azure Hosted Umbraco instance, You need to migrate your data with SQL Azure Migration Wizard or SQL Management Studio, and then change your umbracoDbDSN property to point to your SQL Azure database. (see below)

For SQL Server, I migrated my SQL Express data to SQL Azure using SQL Azure Migration Wizard v3.4.I changed my connection information in the web config to point to the SQL Azure database.
i.e. Changed

<add key="umbracoDbDSN" value="server=.\SQLExpress;database=umbraco452;user id=xxx;password=xxx" />

with this:

<add key="umbracoDbDSN" value="server=tcp:<<youraccountname>>.database.windows.net;database=<your_umbraco_db>;user id=<<youruser>>@<<youraccount>>;password=<<yourpassword>>" />

Still no success but at least now am sure the data has been migrated to SQL Azure.


Useful Links:

  • SQL Azure Migration Wizard v3.4 -- http://sqlazuremw.codeplex.com/
  • humphrey sheil's blog -- http://humphreysheil.blogspot.com/2010/08/umbraco-cms-complete-install-on-windows.html
  • Using SQL Server Management Studio R2 with SQL Azure -- http://geekswithblogs.net/iupdateable/archive/2009/11/13/using-sql-server-management-studio-r2-with-sql-azure.aspx 
  • The Project Code-Named Houston in  the SQL Aure Labs (http://www.sqlazurelabs.com/) -- http://www.sqlazurelabs.com/map_landing.htm
Jan 18, 2011 at 6:03 AM

Hey Iggy, Borge -

That is definitly the right track--the database must also be migrated such that your Umbraco instance on Azure will be able to connect given its configuration. 

Iggy's post does a great job of hitting the resources for a database to SQL Azure migration.  I'm including here a sanitized version of the procedures from the Umbraco community.

Best Regards,

Ryan 

SQL Azure

 

From: http://our.umbraco.org/wiki/install-and-setup/how-to-install-umbraco-on-windows-server-2008/installing-umbraco-to-sql-azure

Step 1:

Install Umbraco 4.5 using a local instance of SQL (e.g. SQL Express).

Step 2:

Open SQL Management Studio 2008 RC2.

Step 3:

Add primary key to umbracoUserLogins table composed of the contextID and userID columns.

Step 4:

Right-click on the Umbraco database.

Step 5:

Select Tasks Extract Data-tier Application.

Step 6:

Save and note location of .dacpac file.

Step 7:

Right-click on Umbraco database.

Step 8:

Select Tasks Generate Scripts.

Step 9:

Select only tables.

Step 10:

Click Next Advanced.

Step 11:

Find "Types of data to script" and select "Data Only"

Step 12:

Click Ok and note location of .sql file.

Step 13:

Click Next Next.

Step 14:

Connect to your SQL Azure database in Management Studio.

Step 15:

Right-click server node.

Step 16:

Select Tasks  Deploy Data-tier Application.

Step 17:

Select the .dacpac file previously saved in step 6.

Step 18:

After deployment, click on the new database to select it.

Step 19:

Select from Management Studio menu, File Open  File...

Step 20:

Select the .sql file saved in step 12.

Step 21:

Select the new database in the drop-down list.

Step 22:

Click Execute to add data to new database.

Step 23:

Edit your web.config to point to the SQL Azure database.

SQL Azure (alternative)

 

From: http://our.umbraco.org/forum/core/general/6038-Umbraco-in-WindowsSQL-Azure

 

Step 1

Ensure tables have a clustered index.  (umbracoUserLogins, may already contain the required index)

Step 2

Using SQL Management Studio, export a full SQL script for the database.  (Ensure that data is included in the export.)

Step 3

Download "SQL Azure Migration Wizard 3.3" (http://sqlazuremw.codeplex.com/)

Step 4

Open exported TSQL script in SQLAzureMW

Step 5

Point SQLAzureMW to your SQL Azure database

Step 6

Run the script against the database.

Step 7

Finished.

Ryan D. Marshall

Jan 18, 2011 at 8:57 AM
Edited Jan 18, 2011 at 8:58 AM

Hi all,

With regards to deploying to SQL Azure and Azure Hosted Service I recommend you take a look at these two blog posts:

Umbraco on Azure Series: SQL Azure

Umbraco on Azure Series: Deploying to Azure with Accelerator

- Morten Christensen