简体   繁体   English

Azure云中的Umbraco 7作为Web角色

[英]Umbraco 7 in Azure cloud as web roles

I have been trying to get Umbraco working in a web role environment (web services) in Azure, but the site errors when you try and access it, saying that config/trees.config is not accessible. 我一直试图让Umbraco在Azure的Web角色环境(Web服务)中工作,但是尝试访问它时出现站点错误,并指出config / trees.config无法访问。

These are the steps i carried out: 这些是我执行的步骤:

  1. Create a new empty MVC4 project in Visual Studio 2013 在Visual Studio 2013中创建一个新的空MVC4项目
  2. Install Umbraco v7.1.8 from nuget 从nuget安装Umbraco v7.1.8
  3. Run up and configure using a new azure SQL database. 使用新的Azure SQL数据库运行并配置。
  4. Added in the umbraco folders to the solution. 在umbraco文件夹中添加到解决方案。
  5. Added an azure web services project to the solution. 在解决方案中添加了一个Azure Web服务项目。
  6. Added the existing MVC umbraco project to the azure role profiles. 将现有的MVC umbraco项目添加到了Azure角色配置文件中。
  7. Published to Azure staging area. 发布到Azure临时区域。

The site starts up with the usual 'Looks like there is still work to do' screen in the full Azure emulator in visual studio with multiple role instances. 该站点在具有多个角色实例的Visual Studio的完整Azure模拟器中以通常的“看起来仍有待完成”屏幕启动。 However fails to run up when hosted in Azure. 但是,在Azure中托管时无法运行。

I am currently assuming that the issue is that the site root does not have write access when hosted in Azure, so the IIS worker process cannot write to the trees.config file. 我目前假设问题是在Azure中承载站点根目录时没有写访问权限,因此IIS工作进程无法写入tree.config文件。

I found an article where you can add a 'startup.bat' file, with the following: 我找到了一篇文章,您可以在其中添加“ startup.bat”文件,内容如下:

echo "starting startup task" >> log.txt
%windir%\system32\Icacls.exe .. \* /T /grant "Network Service":(F) > log.txt

But this stops the role instances for starting up at all in both the emulator and when hosting in azure. 但是,这将停止角色实例在模拟器中以及在Azure中托管时都无法启动。

Any suggestions would be gratefully appreciated 任何建议将不胜感激

I would suggest using a VM instead of a web role for hosting Umbraco in Azure , particularly since Umbraco is needing local write access to persist. 我建议使用VM代替Web角色在Azure中托管Umbraco ,尤其是因为Umbraco需要本地写访问权限才能持久。

Web roles expect your application to be stateless, meaning no writing or persisting anything to the actual file system. Web角色希望您的应用程序是无状态的,这意味着不向实际文件系统写入或保留任何内容。 This guarantee allows Azure to make certain assumptions so that it can load balance and scale the application correctly (it basically saves a master copy and then re-deploys it fresh as it scales up or makes updates, etc. This works great for web apps that were created with this in mind, but if not, then a VMs allows you to scale UP without worrying about your app needing to work a certain way to properly scale OUT under a load balancer (which is what web roles are made to help you do). 此保证允许Azure做出某些假设,以便它可以负载平衡并正确缩放应用程序(它基本上会保存一个主副本,然后在它扩展或进行更新时将其重新部署为新文件,等等。这对于那些正是出于这一考虑而创建的,但是如果不是这样,那么VM可以让您向上扩展,而不必担心您的应用程序需要以某种方式工作以在负载均衡器下正确地扩展OUT(这是通过网络角色来帮助您完成的)。

So, basically I would suggest installing to a Virtual Machine. 因此,基本上我建议安装到虚拟机。 It's still in the cloud, and you get all the cloud benefits of on-demand scaling of the infrastructure. 它仍然在云中,您将获得按需扩展基础架构的所有云优势。 In addition, I would expect Virtual Machines to be a supported install of Umbraco, where a web role install would not . 另外, 我希望虚拟机成为Umbraco的受支持安装,而Web角色安装不会 Hope that helps! 希望有帮助!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM