Azure Deployment fails - Server Error in '/' Application

Topics: Installing Orchard
Aug 27, 2012 at 8:38 PM

Hi

We're haven some problems to deploy our Orchard site to Windows Azure. We build up a new Site with Orchard 1.5.1 and would like to publish it to Windows Azure. Da Database already exists as an SQL Azure Database.

We downloaded the Orchard 1.5.1 Source-Code, added the additional modules and our theme to the solution and started the deployment. If we access the site on Windows Azure, we simply get the "Server Error in '/' Application (originating exception: System.Web.HttpException (Path '/' was not found) ). If we are running the Site in the Azure Emulator, it works.

We are using Visual Studio 2012 and the newest Azure SDK. 

Since the website is already build, we cannot start from scratch (restart with an empty database). Any help is welcome! Thank you!

Cheers

Marc

Coordinator
Aug 27, 2012 at 10:20 PM

If you have an already setup database, I would suggest that you first setup a new one, pointing to a new database, which will create the necessary configuration files in the blob storage, then use a blog storage explorer, and change the settings file to point to your running database.

Aug 28, 2012 at 6:26 AM

Hi sebastienros

Thank you for your feedback. We setup the  blob storage as you discribed by running Orchard in Azure Emulator (with connetion to our productive Blob storage and SQL Azure database). We than copied the content of the existing settings to the blob. If we are using Orchard in the Azure Emulator with the producitve blob storage and SQL Azure database, it works. Only if the application gets deployed on the web role, we receive the mentioned error. Any ideas how to get more Information about this error?

Cheers

Marc

Aug 28, 2012 at 11:15 AM

Hi there

Having a look at the IntelliTrace log, there are several DependencyResolutionExceptions before the HttpException is thrown.

Thrown: "None of the constructors found with 'Orchard.Environment.AutofacUtil.DynamicProxy2.ConstructorFinderWrapper' on type 'Orchard.Settings.CurrentSiteWorkContext' can be invoked with the available services and parameters:
Cannot resolve parameter 'Orchard.Settings.ISiteService siteService' of constructor 'Void .ctor(Orchard.Settings.ISiteService)'." (Autofac.Core.DependencyResolutionException) Exception Message = "None of the constructors found with 'Orchard.Environment.AutofacUtil.DynamicProxy2.ConstructorFinderWrapper' on type 'Orchard.Settings.CurrentSiteWorkContext' can be invoked with the available services and parameters:\r\nCannot resolve parameter 'Orchard.Settings.ISiteService siteService' of constructor 'Void .ctor(Orchard.Settings.ISiteService)'.", Exception Type = "Autofac.Core.DependencyResolutionException", Exception WinRT Data = "" 

Any ideas for the root cause? Did we miss something to be published to Windows Azure?

Cheers

Marc

Aug 29, 2012 at 8:27 PM
Edited Aug 29, 2012 at 8:28 PM

Hello

We now solved the issue. I'll just post a short description about the solution for anybody else having the same errors. The problem is that we did not packaged the azure package correctly. We directly build the solution from within VS and deployed it from VS.

We noticed in ClickToBuildAzurePackage.cmd respectively AzurePackage.proj that there are extra actions taken which will not be executed with the Standard VS solution. The content of our template was not published correctly.

<ItemGroup>
      <!-- filter to exclude any binary from a folder -->
      <Excluded Include="$(SrcFolder)\**\bin\**\*;$(SrcFolder)\**\obj\**\*;$(SrcFolder)\**\*.user;" />
   
      <!-- list of files from Themes, Core and Modules to export -->
      <Stage-Themes Include="$(SrcFolder)\Orchard.Web\Themes\**\*" Exclude="@(Excluded)" />
      <Stage-Core Include="$(SrcFolder)\Orchard.Web\Core\**\*" Exclude="@(Excluded)" />
      <Stage-Modules Include="$(SrcFolder)\Orchard.Web\Modules\**\*" Exclude="@(Excluded)" />
    </ItemGroup>

    <Copy SourceFiles="@(Stage-Themes)" DestinationFolder="$(MsDeployFolder)\Themes\%(RecursiveDir)" />
    <Copy SourceFiles="@(Stage-Core)" DestinationFolder="$(MsDeployFolder)\Core\%(RecursiveDir)" />
    <Copy SourceFiles="@(Stage-Modules)" DestinationFolder="$(MsDeployFolder)\Modules\%(RecursiveDir)" />

Cheers
Marc

Coordinator
Aug 30, 2012 at 5:42 PM

Which explains the symptoms ... 

By the way you should take a look at the doc: http://docs.orchardproject.net/Documentation/Deploying-Orchard-to-Windows-Azure

And this blog post: http://ooiks.com/blog/how-to-2/step-by-step-deploying-orchard-to-windows-azure

Oct 3, 2012 at 11:44 PM
Edited Oct 4, 2012 at 11:45 PM

Just ran into this problem myself (v1.5.1). As discussed the error is packaging Orchard for Azure needs to include the Core; Themes and Modules folders.

This might help others wishing to build the Azure package from VS. Just add these folders to the Orchard.Azure.Web.proj as content items. An easy solution is to insert a new item group into the project; past the following into the project:

<ItemGroup>
    <!-- list of files from Themes, Core and Modules to export -->
    <Content Include="Themes\**\*"  Exclude="**\bin\**\*;**\obj\**\*;**\*.user" />
    <Content Include="Core\**\*"    Exclude="**\bin\**\*;**\obj\**\*;**\*.user" />
    <Content Include="Modules\**\*" Exclude="**\bin\**\*;**\obj\**\*;**\*.user" />
  </ItemGroup>

hth

Edit: changed exclude to match the set from AzurePackage.proj to fix a problem with contentpicker and make it consistent.

Oct 4, 2012 at 4:10 PM
Edited Oct 4, 2012 at 4:13 PM

Where is Orchard.Azure.Web.proj? I don't see it in my enlistment.

Oct 4, 2012 at 11:48 PM
TheMonarch wrote:

Where is Orchard.Azure.Web.proj? I don't see it in my enlistment.

src/Orchard.Azure/Orchard.Azure.Web/Orchard.Azure.Web.csproj

 

hth