Skip to content

Orchard 1.7.1中Windows Azure的新增功能-What's New for Windows Azure in Orchard 1.7.1

The Windows Azure integration and deployment in Orchard have undergone a complete overhaul for version 1.7.1. This topic describes what's changed and the benefits of some of the new capabilities.

Orchard中的Windows Azure集成和部署已经过1.7.1版的彻底改造。本主题描述了已更改的内容以及某些新功能的优势。

Visual Studio tooling

Visual Studio工具

Prior to version 1.7.1, packaging and deploying to Windows Azure had to be done from the command line, outside of Visual Studio. The external custom MSBuild file AzurePackage.proj that was used to do this is no longer needed (but retained for people whose established build processes depend on it). The cloud service deployment configuration has been redesigned to work fully and seamlessly within Visual Studio Tools for Windows Azure. This has a number of benefits:

在1.7.1版之前,必须从Visual Studio外部的命令行完成打包和部署到Windows Azure。不再需要用于执行此操作的外部自定义MSBuild文件AzurePackage.proj(但保留给已建立的构建过程依赖于它的人员)。云服务部署配置经过重新设计,可在 Visual Studio Tools for Windows Azure 中完全无缝地工作。这有很多好处:

  • We now have one-click publishing to Windows Azure from directly within Visual Studio, like the Azure gods intended.

  • 我们现在可以直接在Visual Studio中对Windows Azure进行一键式发布**,就像Azure众神一样。

  • Newer releases of the Visual Studio Tools for Windows Azure automate things like creating and connecting to a Windows Azure subscription, creating and provisioning the necessary certificates, and downloading subscription IDs and access keys. This functionality can now be utilized seamlessly. With the old deployment solution this had to be done manually.

  • 较新版本的Windows Azure Visual Studio工具**可自动完成诸如创建和连接到Windows Azure订阅,创建和配置必要的证书以及下载订阅ID和访问密钥等内容。现在可以无缝地使用此功能。使用旧的部署解决方案,必须手动完成。

  • Newer SDK features such as role content folders can now be utilized.

  • 较新的 SDK功能,如[角色内容文件夹](http://blogs.msdn.com/b/philliphoff/archive/2012/06/08/add-files-to-your-windows-azure-package现在可以使用-using-role-content-folders.aspx)。

  • Adding more roles to your deployment besides Orchard.Azure.Web is now as easy as right-clicking and selecting "Add New Role" in Solution Explorer. Before, they also had to be carefully worked into the AzurePackage.proj file which was far from trivial.

  • 为部署添加更多角色除了Orchard.Azure.Web之外,现在就像在解决方案资源管理器中右键单击并选择“添加新角色”一样简单。之前,他们还必须仔细研究AzurePackage.proj文件,这个文件远非微不足道。

  • Publish can now be done for either Debug or Release build configurations. Previous hard coded assumptions no longer apply. This can be very useful for things like collecting IntelliTrace logs from your cloud service deployment, or to simply get line numbers in exception stack traces.

  • 现在可以对 Debug或Release构建配置进行发布。以前的硬编码假设不再适用。这对于从云服务部署收集IntelliTrace日志或简单地获取异常堆栈跟踪中的行号等内容非常有用。

  • Continuous deployment from TFS to Windows Azure should now "just work" although this has not yet been tested.

  • 从TFS到Windows Azure的持续部署现在应该“正常工作”,尽管尚未经过测试。

Additionally, when building and publishing using Release build configuration, configuration file transformations are now used instead of custom MSBuild logic. Configuration transform files are visible and editable directly in Solution Explorer (visualized as child items of the Web.config, Host.config and Log4net.config files) and therefore much more discoverable and maintainable.

此外,在使用Release构建配置构建和发布时,配置文件转换现在使用而不是自定义MSBuild逻辑。配置转换文件在Solution Explorer中直接可见并可编辑(可视化为Web.configHost.configLog4net.config文件的子项),因此更易于发现和维护。

See the topic Deploying Orchard to Windows Azure topic for more information.

有关详细信息,请参阅[将Orchard部署到Windows Azure](部署-Orchard-to-Windows-Azure)主题。

Windows Azure SDK 2.1

Windows Azure SDK 2.1

All Azure-specific solution and project files have been migrated to Windows Azure SDK 2.1. You will need to install Windows Azure SDK for .NET (VS 2012) - 2.1 using Web Platform Installer to open the Orchard.Azure.sln solution and to package and publish Orchard to Windows Azure.

所有特定于Azure的解决方案和项目文件都已迁移到Windows Azure SDK 2.1。您将需要使用Web Platform Installer安装 Windows Azure SDK for .NET(VS 2012) - 2.1 以打开Orchard.Azure.sln解决方案并将Orchard打包并发布到Windows Azure。

All code that reads settings from Azure role configuration has been updated to use the new platform-agnostic CloudConfigurationManager class, so settings are now read from either Windows Azure Cloud Service role configuration, Windows Azure Web Site configuration settings, or the Web.config <appSettings> element.

从Azure角色配置中读取设置的所有代码都已更新为使用新的平台无关[CloudConfigurationManager](http://msdn.microsoft.com/en-us/library/microsoft.windowsazure.cloudconfigurationmanager.aspx)类,因此现在可以从Windows Azure云服务角色配置,Windows Azure网站配置设置或Web.config“”元素中读取设置。

All code that uses Windows Azure Blob Storage has been migrated to use version 2.0 of the Windows Azure Storage Client.

所有使用Windows Azure Blob存储的代码都已迁移到使用Windows Azure存储客户端2.0版。

The Azure-specific solution Orchard.Azure.sln has been brought up to date with main solution Orchard.sln in terms of project structure etc.

特定于Azure的解决方案“Orchard.Azure.sln”在项目结构等方面与主要解决方案“Orchard.sln”保持同步。

All referenced assemblies from Windows Azure SDK has been placed in the lib folder, and are now referenced from there. This avoids having to install Windows Azure SDK just to compile and run Orchard from the main solution Orchard.sln.

来自Windows Azure SDK的所有引用程序集都放在lib文件夹中,现在从那里引用。这避免了必须安装Windows Azure SDK才能从主解决方案“Orchard.sln”编译和运行Orchard。

New module Orchard.Azure

新模块Orchard.Azure

A new module Orchard.Azure has been added. All Azure-specific functionality has been consolidated into this module. Some functionality is enabled automatically by configuration when publishing to a Windows Azure Cloud Service, while other functionality is packaged as features which can be enabled regardless of hosting. The module contains the following features:

新增了一个模块 Orchard.Azure 。所有特定于Azure的功能都已合并到此模块中。发布到Windows Azure云服务时,某些功能由配置自动启用,而其他功能则打包为可以启用的功能,无论托管如何。该模块包含以下功能:

  • Windows Azure Media Storage: Provides an Orchard media storage provider that targets Windows Azure Blob Storage.

  • Windows Azure媒体存储:提供面向Windows Azure Blob存储的Orchard媒体存储提供程序。

  • Windows Azure Output Cache: Provides an Orchard output cache provider that targets Windows Azure Cache.

  • Windows Azure输出缓存:提供面向Windows Azure缓存的Orchard输出缓存提供程序。

  • Windows Azure Database Cache: Provides an NHibernate second-level cache provider that targets Windows Azure Cache.

  • Windows Azure数据库缓存:提供面向Windows Azure缓存的NHibernate二级缓存提供程序。

These features are completely portable and can be used from any hosting environment, i.e. Windows Azure Cloud Services, Windows Azure Web Sites or some other hosting option.

这些功能完全可移植,可以在任何托管环境中使用,即Windows Azure云服务,Windows Azure网站或其他一些托管选项。

As you might guess from above, as part of this work two new native providers for Windows Azure Cache have been written and are shipped built-in with Orchard. No more need to add the memcached shim to your deployment, and no more need to install custom modules with third-party memcached providers in order to use Windows Azure Cache (which also means better performance as the memcached compatibility layer is not used). The new native providers have been designed and tested to work with both Windows Azure Role-based Cache and the newly released Windows Azure Cache Service.

正如您可能从上面猜到的那样,作为此工作的一部分,已经编写了两个用于Windows Azure Cache 的新本机提供程序,并随Orchard一起内置。不再需要将 memcached shim 添加到您的部署中,不再需要使用第三方 memcached 提供程序安装自定义模块以使用Windows Azure Cache(这也意味着 memcached 兼容性层具有更好的性能)未使用)。新的本机提供程序经过设计和测试,可与Windows Azure基于角色的缓存和新发布的Windows Azure缓存服务一起使用。

See the following topics for more information:

有关更多信息,请参阅以下主题:

Cloud services and web sites

云服务和网站

As far as possible we now have feature parity between Windows Azure Cloud Services and Windows Azure Web Sites. Things like media storage and output caching have been reimplemented and packaged as features in the Orchard.Azure module that can be enabled from either environment. Also, automated publishing from within Visual Studio has been overhauled and is supported for both target environments.

我们现在尽可能在Windows Azure云服务和Windows Azure网站之间具有功能。诸如媒体存储和输出缓存之类的东西已经重新实现并打包为Orchard.Azure模块中的功能,可以从任一环境启用。此外,Visual Studio中的自动发布已经过彻底检查,并且对两个目标环境都支持。

Fully loaded by default

默认情况下完全加载

Orchard is now pre-configured for Windows Azure Cache when deploying to a Windows Azure Cloud Service. If you scale out your deployment to more than one role instance, you can take advantage of this to keep your instances in sync.

在部署到Windows Azure云服务时,Orchard现在已针对Windows Azure Cache **进行了预配置。如果将部署扩展到多个角色实例,则可以利用此功能使实例保持同步。

By default the cloud service project is configured for co-located role-based caching with 30% of the role instance memory allowed for cache usage. Three named caches OutputCache, DatabaseCache and SessionStateCache are configured by default. Windows Azure Output Cache and Windows Azure Database Cache have to be enabled as features in the dashboard post-deployment, while the ASP.NET Session State Provider for Windows Azure Cache is configured and enabled by default in Web.config.

默认情况下,云服务项目配置为共存的基于角色的缓存,其中30%的角色实例内存允许缓存使用。默认配置三个命名的缓存OutputCacheDatabaseCacheSessionStateCache。必须在部署后的仪表板中启用Windows Azure输出缓存和Windows Azure数据库缓存,而在Web.config中默认配置并启用Windows Azure缓存的ASP.NET会话状态提供程序。

Windows Azure Diagnostics is now fully configured by default when deploying Orchard to a Windows Azure Cloud Service. The Windows Azure Diagnostics appender is configured by default in the cloud service web role. You can use Server Explorer to download and examine diagnostics data from within your deployment. Additionally, the Windows Azure Diagnostics appender has been improved and now logs messages with their correct severity level (prior to 1.7.1 all Log4net entries were logged to Windows Azure Diagnostics as verbose messages).

现在,在将Orchard部署到Windows Azure云服务时,Windows Azure诊断现在已完全配置。默认情况下,云服务Web角色中配置了Windows Azure诊断程序附加程序。您可以使用服务器资源管理器从部署中下载和检查诊断数据。此外,Windows Azure Diagnostics appender已得到改进,现在以正确的严重性级别记录消息(在1.7.1之前,所有Log4net条目都作为详细消息记录到Windows Azure诊断中)。

As before, when deploying to a Windows Azure Cloud Service, Orchard is pre-configured to use Windows Azure Blob Storage as the underlying file system implementation for shell settings (the Settings.txt file). Unlike before, using Windows Azure Blob Storage for media storage is not preconfigured, but easily activated by enabling the new Windows Azure Media Storage feature. Storage account credentials for these providers need to be specified in the cloud service project before deployment (Visual Studio will display warning messages if you don't). As before, containers are created automatically in the storage service if they don't already exist.

与以前一样,在部署到Windows Azure云服务时,Orchard已预先配置为使用Windows Azure Blob存储作为shell设置的基础文件系统实现(“Settings.txt”文件)。与以前不同,使用Windows Azure Blob Storage进行媒体存储不是预配置,而是通过启用新的 Windows Azure Media Storage 功能轻松激活。在部署之前,需要在云服务项目中指定这些提供程序的存储帐户凭据(如果不这样,Visual Studio将显示警告消息)。和以前一样,如果存储服务尚不存在,则会在存储服务中自动创建容器。