Deployment on Azure

Topics: Installing Orchard
Apr 28, 2013 at 11:10 PM
Hi,

I'm newbie on the orchard's deployment.

I created a website on windows Azure and got the publication profile.
Imported it and use it associated to Orchard.Web.
I have two questions :

When I choose Publish in debugMode.
I obtain the error :
Error 2 Could not open Source file: Could not find a part of the path 'C:\Orchard\Orchard.Source.1.6\src\Orchard.Web\Media\web.config;Media\web.config'. 0 0 Orchard.Web
So the website can't be deploy.

And
When can i defined the connection string used by the azure website?

Best regads,
Alexandre
Coordinator
Apr 29, 2013 at 12:23 AM
What are you publishing from?

The connection string can be entered when you run through setup.
Apr 29, 2013 at 1:08 PM
Edited Apr 29, 2013 at 1:09 PM
I also got this pb with 1.6 but I was thinking it has been corrected, may be after the 1.6 release.
The easier way I have found proceeding if deploying from VS2012 is to click on The Preview, then when finished, go to the line refering the 'C:\Orchard\Orchard.Source.1.6\src\Orchard.Web\Media\web.config;Media\web.config' and uncheck it, then do the final deploy
Apr 29, 2013 at 7:50 PM
Edited Apr 29, 2013 at 8:15 PM
Hi,

I try to publish by using visual studio 2012. I have selected the project Orchard.Web to publish.
The result is preview Failed
"Could not open Source file: Could not find a part of the path 'C:\Orchard\Orchard.Source.1.6\src\Orchard.Web\Media\web.config;Media\web.config'."
the "C:\Orchard\Orchard.Source.1.6\src\Orchard.Web\Media\web.config" exists but I dont know why I can see Media\web.config.

I can't select any file, because preview failed.
I try to use the command ClickToBuildAzurePackage.cmd.

Package-Zip:
Creating directory "C:\Orchard\Orchard.Source.1.6\artifacts\Azure".
Creating zip file "C:\Orchard\Orchard.Source.1.6\artifacts\Azure\AzurePackage
.zip".
added "ServiceConfiguration.cscfg".
added "Orchard.Azure.Web.cspkg".
Created zip file "C:\Orchard\Orchard.Source.1.6\artifacts\Azure\AzurePackage.
zip" successfully.

I continu to search I will find :)

I try to use Microsoft WebMatric but in that case 1293 Mo to upload :(
Hum a publish previex from
May 1, 2013 at 12:53 PM
Bertrand:

I have the same problem. Here is what I'm doing:
  1. First I created a web site (not a web role) in Azure by choosing Orchard CMS from the web site gallery. I chose to set up the default web site with SQL Compact database.
  2. Then I downloaded the Orchard 1.6 source code in .zip file and built the project in Visual Studio 2012. (I applied the 1.6.1 patch to fix security vulnerability, and my goal now is to deploy the patch to Azure.)
  3. From Azure, I downloaded my Azure publish profile (MySite.azurewebsites.net.PublishSettings) and added it to Publish properties of the Azure.Web project in Visual Studio.
  4. Tried to publish to Azure from Visual Studio, and encountered the errors described by Alexander above.
Is this scenario even supported? If not, how does one go about publishing from Visual Studio to an Azure web site? (The Azure instructions in the Orchard documentation are out of date, since they don't take into account the pre-build Orchard CMS site in the Azure gallery.)
Developer
May 1, 2013 at 2:55 PM
If it's not working from Visual Studio, try the following:
  1. Build your package using the ClickToBuild.cmd file. This will generate a "build\Stage" folder with your site, modules and themes.
  2. Copy over your Media items and other things that you want to deploy to Azure.
  3. Open the "Stage" folder with WebMatrix and make sure the site works locally.
  4. Publish from WebMatrix using the Azure publish profile you downloaded.
May 1, 2013 at 3:09 PM
Edited May 1, 2013 at 3:10 PM
It seems that the error was in the Orchard.Web.csproj file. Go to line 198 and in       <_CustomFiles Include="Media\**\*;App_Data\**\*;Modules\**\*;Themes\**\*;Core\**\*" Exclude="**\obj\**;**\bin\*.xml;**\.hgignore;**\.hgtags;**\.hg\**;@(Orchard-Web-Bins -> '**\%(Filename)%(Extension)');**\*.csproj.user;" />
remove Media\**\*; then save the file reload it in VS and redeploy.
May 1, 2013 at 4:02 PM
That worked! Thanks :)
May 31, 2013 at 7:07 AM
Thanks Aponcele: Your solution worked for me too.
Jul 26, 2013 at 12:10 AM
If you remove the Media**; part it tells vs to ignore all files in the Media folder. (Except for the two that are in the project). If you want to deploy files from the Media folder you should change Media**; to Media****;

The problem occurs because there are files in the Media folder that are part of the project (i.e. they are in the solution explorer). These files are already known by web deploy and adding them again causes the problem. Using the above change instead tells web deploy to only include files from sub folders of Media. The two known files are in the root and since they are known the will be part of the deploy.