How to deploy Orchard CMS in Windows Azure?

前端 未结 4 1864
半阙折子戏
半阙折子戏 2020-12-31 23:06

Experts,

Is there any of you guys who has successfully built and deployed Orchard CMS (1.1 and above) in Azure?

I\'ve tried to build the source codes (pulled

相关标签:
4条回答
  • 2020-12-31 23:28

    I've done that about a dozen times without a problem. About ClickTobuild, did you do that from a Visual Studio command prompt?

    0 讨论(0)
  • 2020-12-31 23:36

    Since June 2012 there's also the possibility to easily host Orchard on Windows Azure Web Sites.

    Here's an how to guide: How to setup Orchard CMS on Windows Azure Web Sites with a Windows Azure SQL Database.

    This is an alternative approach which didn't exist at the time of the original question but might still be interesting for future readers who want to easily deploy Orchard CMS on Windows Azure.

    0 讨论(0)
  • 2020-12-31 23:46

    I didn't get ClickToBuildToAcure.cmd script to work and that is why I wrote my own one, that Stuart helped linking to. My blog http://litemedia.info is running on Azure and those blog posts describes how I did it.

    Some pointers

    1. My Global.asax.cs looks a bit different on Azure compared to running local.

      public class AzureApplication : HttpApplication
      {
          public static void RegisterRoutes(RouteCollection routes)
          {
              routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
          }
      
          protected void Application_Start()
          {
              CloudStorageAccount.SetConfigurationSettingPublisher(
                  (configName, configSetter) =>
                      configSetter(RoleEnvironment.GetConfigurationSettingValue(configName))
                  );
      
              // For information on handling configuration changes
              // see the MSDN topic at http://go.microsoft.com/fwlink/?LinkId=166357.
              RoleEnvironment.Changing += (sender, e) =>
              {
                  // If a configuration setting is changing
                  if (e.Changes.Any(change => change is RoleEnvironmentConfigurationSettingChange))
                  {
                      // Set e.Cancel to true to restart this role instance
                      e.Cancel = true;
                  }
              };
      
              RegisterRoutes(RouteTable.Routes);
              Starter.LaunchStartupThread(MvcSingletons);
          }
      
          protected void Application_BeginRequest()
          {
              Context.Items["originalHttpContext"] = Context;
              Starter.OnBeginRequest(Context, MvcSingletons);
          }
      
          protected void Application_EndRequest()
          {
              Starter.OnEndRequest();
          }
      
          static void MvcSingletons(ContainerBuilder builder)
          {
              builder.Register(ctx => RouteTable.Routes).SingleInstance();
              builder.Register(ctx => ModelBinders.Binders).SingleInstance();
              builder.Register(ctx => ViewEngines.Engines).SingleInstance();
          }
      }
      
    2. I had problems deploying with sites in /App_Data/ directory. Make sure that it is empty when you upload your package to Azure.

    3. You need to tell Autofac to use some Azure specific classes for settings and blog storage. You'll find these in /Config/Host.config and /Config/Sites.config. Go to my blog post above to see how I set them up.

    4. I spent several hours hunting down assemblies that was not copied to the Azure package. Make sure that all references are "Copy Local", even the MVC3 ones.

    5. Really make sure that you have the correct DataConnectionString setup in ServiceConfiguration.cscfg. I was banging my head against the wall for a long time because I had put a connection string for another account there.

    6. If you intend to deploy from a script you need to setup a certificate that will be used for the deployment. I used Visual Studio to create the certificate, and then only reference it from my script.

    Good luck!

    0 讨论(0)
  • 2020-12-31 23:47

    I've not done this myself.

    But I've read a few blog posts about deploying Orchard to Azure - e.g. see http://litemedia.info/automate-deploy-of-your-orchard-cms-to-azure - so I believe it can be done.

    On the specific yellow screen of death issue - make sure you've used NuGet to resolve the AutoFac dependencies - see http://litemedia.info/deploy-orchard-cms-to-azure

    0 讨论(0)
提交回复
热议问题