Upgrading Azure solutions to SDK 2.0

--HG--
branch : 1.x
extra : rebase_source : 9268657065fe85a15a09c4cab0b5edbacee0e6a1
This commit is contained in:
Sebastien Ros 2013-06-07 16:04:44 -07:00
parent cd125b2e86
commit 8dc40af2d3
12 changed files with 82 additions and 30 deletions

View File

@ -16,8 +16,9 @@
</PropertyGroup> </PropertyGroup>
<Import Project="$(LibFolder)\msbuild\MSBuild.Community.Tasks.Targets"/> <Import Project="$(LibFolder)\msbuild\MSBuild.Community.Tasks.Targets"/>
<Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v10.0\Windows Azure Tools\1.8\Microsoft.WindowsAzure.targets" Condition="exists('$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v10.0\Windows Azure Tools\1.8\Microsoft.WindowsAzure.targets')"/> <!-- look for C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\Windows Azure Tools -->
<Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v11.0\Windows Azure Tools\1.8\Microsoft.WindowsAzure.targets" Condition="exists('$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v11.0\Windows Azure Tools\1.8\Microsoft.WindowsAzure.targets')"/> <Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v10.0\Windows Azure Tools\2.0\Microsoft.WindowsAzure.targets" Condition="exists('$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v10.0\Windows Azure Tools\2.0\Microsoft.WindowsAzure.targets')"/>
<Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v11.0\Windows Azure Tools\2.0\Microsoft.WindowsAzure.targets" Condition="exists('$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v11.0\Windows Azure Tools\2.0\Microsoft.WindowsAzure.targets')"/>
<!-- Coordinating Targets --> <!-- Coordinating Targets -->

View File

@ -53,7 +53,6 @@
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="Microsoft.WindowsAzure.Diagnostics, Version=1.8.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
<Reference Include="Microsoft.WindowsAzure.ServiceRuntime, Version=1.8.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> <Reference Include="Microsoft.WindowsAzure.ServiceRuntime, Version=1.8.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Private>True</Private> <Private>True</Private>
</Reference> </Reference>

View File

@ -17,8 +17,8 @@ namespace Orchard.Azure {
public string ContainerName { get; protected set; } public string ContainerName { get; protected set; }
private readonly CloudStorageAccount _storageAccount; private readonly CloudStorageAccount _storageAccount;
private readonly string _root; protected readonly string _root;
private readonly string _absoluteRoot; protected readonly string _absoluteRoot;
public CloudBlobClient BlobClient { get; private set; } public CloudBlobClient BlobClient { get; private set; }
public CloudBlobContainer Container { get; private set; } public CloudBlobContainer Container { get; private set; }

View File

@ -38,5 +38,23 @@ namespace Orchard.Azure.FileSystems.Media {
} }
} }
} }
/// <summary>
/// Retrieves the local path for a given url within the storage provider.
/// </summary>
/// <param name="url">The public url of the media.</param>
/// <returns>The local path.</returns>
public string GetLocalPath(string url) {
if (url.StartsWith(_absoluteRoot)) {
return url.Substring(_absoluteRoot.Length);
}
return url;
}
public string GetRelativePath(string path) {
return GetPublicUrl(path);
}
} }
} }

View File

@ -1,7 +1,5 @@
using System; using System;
using Microsoft.WindowsAzure; using Microsoft.WindowsAzure.Diagnostics;
using Microsoft.WindowsAzure.Diagnostics.Management;
using Microsoft.WindowsAzure.ServiceRuntime;
using log4net.Appender; using log4net.Appender;
using log4net.Core; using log4net.Core;
@ -13,21 +11,16 @@ namespace Orchard.Azure.Logging {
/// </summary> /// </summary>
public class AzureAppender : AppenderSkeleton { public class AzureAppender : AppenderSkeleton {
private const string WadConnectionString = "Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString"; private const string WadConnectionString = "Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString";
public AzureAppender() { public AzureAppender() {
var cloudStorageAccount = CloudStorageAccount.Parse(RoleEnvironment.GetConfigurationSettingValue(WadConnectionString)); var defaultDiagnostics = DiagnosticMonitor.GetDefaultInitialConfiguration();
var period = TimeSpan.FromMinutes(1d);
defaultDiagnostics.Directories.ScheduledTransferPeriod = period;
defaultDiagnostics.Logs.ScheduledTransferPeriod = period;
defaultDiagnostics.WindowsEventLog.ScheduledTransferPeriod = period;
var roleInstanceDiagnosticManager = cloudStorageAccount.CreateRoleInstanceDiagnosticManager( DiagnosticMonitor.Start(WadConnectionString, defaultDiagnostics);
RoleEnvironment.DeploymentId,
RoleEnvironment.CurrentRoleInstance.Role.Name,
RoleEnvironment.CurrentRoleInstance.Id);
var diagnosticMonitorConfiguration = roleInstanceDiagnosticManager.GetCurrentConfiguration();
diagnosticMonitorConfiguration.Directories.ScheduledTransferPeriod = TimeSpan.FromMinutes(1d);
diagnosticMonitorConfiguration.Logs.ScheduledTransferPeriod = TimeSpan.FromMinutes(1d);
roleInstanceDiagnosticManager.SetCurrentConfiguration(diagnosticMonitorConfiguration);
} }
protected override void Append(LoggingEvent loggingEvent) { protected override void Append(LoggingEvent loggingEvent) {

View File

@ -4,7 +4,7 @@
<PropertyGroup> <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>1.8</ProductVersion> <ProductVersion>2.0</ProductVersion>
<ProjectGuid>{03c5327d-4e8e-45a7-acd1-e18e7caa3c4a}</ProjectGuid> <ProjectGuid>{03c5327d-4e8e-45a7-acd1-e18e7caa3c4a}</ProjectGuid>
<OutputType>Library</OutputType> <OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
@ -54,7 +54,7 @@
<!-- Import the target files for this project template --> <!-- Import the target files for this project template -->
<PropertyGroup> <PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion> <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
<CloudExtensionsDir Condition=" '$(CloudExtensionsDir)' == '' ">$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\Windows Azure Tools\1.8\</CloudExtensionsDir> <CloudExtensionsDir Condition=" '$(CloudExtensionsDir)' == '' ">$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\Windows Azure Tools\2.0\</CloudExtensionsDir>
</PropertyGroup> </PropertyGroup>
<Import Project="$(CloudExtensionsDir)Microsoft.WindowsAzure.targets" /> <Import Project="$(CloudExtensionsDir)Microsoft.WindowsAzure.targets" />
</Project> </Project>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<ServiceConfiguration serviceName="OrchardCloudService" osFamily="3" osVersion="*" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceConfiguration" schemaVersion="2012-10.1.8"> <ServiceConfiguration serviceName="OrchardCloudService" osFamily="3" osVersion="*" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceConfiguration" schemaVersion="2013-03.2.0">
<Role name="Orchard.Azure.Web"> <Role name="Orchard.Azure.Web">
<Instances count="1" /> <Instances count="1" />
<ConfigurationSettings> <ConfigurationSettings>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<ServiceDefinition name="OrchardCloudService" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition" schemaVersion="2012-10.1.8"> <ServiceDefinition name="OrchardCloudService" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition" schemaVersion="2013-03.2.0">
<WebRole name="Orchard.Azure.Web"> <WebRole name="Orchard.Azure.Web">
<Sites> <Sites>
<Site name="Web"> <Site name="Web">

View File

@ -65,13 +65,13 @@
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files\Microsoft SDKs\Windows Azure\.NET SDK\2012-10\ref\Microsoft.WindowsAzure.Configuration.dll</HintPath> <HintPath>C:\Program Files\Microsoft SDKs\Windows Azure\.NET SDK\2012-10\ref\Microsoft.WindowsAzure.Configuration.dll</HintPath>
</Reference> </Reference>
<Reference Include="Microsoft.WindowsAzure.Diagnostics, Version=1.8.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> <Reference Include="Microsoft.WindowsAzure.Diagnostics, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files\Microsoft SDKs\Windows Azure\.NET SDK\2012-10\ref\Microsoft.WindowsAzure.Diagnostics.dll</HintPath> <HintPath>C:\Program Files\Microsoft SDKs\Windows Azure\.NET SDK\2012-10\ref\Microsoft.WindowsAzure.Diagnostics.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAzure.ServiceRuntime, Version=1.8.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Private>True</Private> <Private>True</Private>
</Reference> </Reference>
<Reference Include="Microsoft.WindowsAzure.ServiceRuntime, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.WindowsAzure.StorageClient, Version=1.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" /> <Reference Include="Microsoft.WindowsAzure.StorageClient, Version=1.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
<Reference Include="Newtonsoft.Json"> <Reference Include="Newtonsoft.Json">
<HintPath>..\..\..\lib\newtonsoft.json\Newtonsoft.Json.dll</HintPath> <HintPath>..\..\..\lib\newtonsoft.json\Newtonsoft.Json.dll</HintPath>
@ -267,6 +267,10 @@
<Project>{642A49D7-8752-4177-80D6-BFBBCFAD3DE0}</Project> <Project>{642A49D7-8752-4177-80D6-BFBBCFAD3DE0}</Project>
<Name>Orchard.Forms</Name> <Name>Orchard.Forms</Name>
</ProjectReference> </ProjectReference>
<ProjectReference Include="..\..\Orchard.Web\Modules\Orchard.ImageEditor\Orchard.ImageEditor.csproj">
<Project>{1f0b6b85-8b0b-47ca-899d-f25b4f1b52c3}</Project>
<Name>Orchard.ImageEditor</Name>
</ProjectReference>
<ProjectReference Include="..\..\Orchard.Web\Modules\Orchard.ImportExport\Orchard.ImportExport.csproj"> <ProjectReference Include="..\..\Orchard.Web\Modules\Orchard.ImportExport\Orchard.ImportExport.csproj">
<Project>{fe5c5947-d2d5-42c5-992a-13d672946135}</Project> <Project>{fe5c5947-d2d5-42c5-992a-13d672946135}</Project>
<Name>Orchard.ImportExport</Name> <Name>Orchard.ImportExport</Name>

View File

@ -42,7 +42,7 @@
<system.diagnostics> <system.diagnostics>
<trace> <trace>
<listeners> <listeners>
<add type="Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics, Version=1.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" <add type="Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
name="AzureDiagnostics"> name="AzureDiagnostics">
<filter type="" /> <filter type="" />
</add> </add>

View File

@ -112,7 +112,9 @@
<Install>true</Install> <Install>true</Install>
</BootstrapperPackage> </BootstrapperPackage>
</ItemGroup> </ItemGroup>
<ItemGroup /> <ItemGroup>
<WCFMetadata Include="Service References\" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets. Other similar extension points exist, see Microsoft.Common.targets.

View File

@ -119,6 +119,16 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SysCache", "..\Orchard.Web\
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UpgradeTo16", "..\Orchard.Web\Modules\UpgradeTo16\UpgradeTo16.csproj", "{8A9FDB57-342D-49C2-BAFC-D885AAE5CC7C}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UpgradeTo16", "..\Orchard.Web\Modules\UpgradeTo16\UpgradeTo16.csproj", "{8A9FDB57-342D-49C2-BAFC-D885AAE5CC7C}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.ImageEditor", "..\Orchard.Web\Modules\Orchard.ImageEditor\Orchard.ImageEditor.csproj", "{1F0B6B85-8B0B-47CA-899D-F25B4F1B52C3}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.MediaProcessing", "..\Orchard.Web\Modules\Orchard.MediaProcessing\Orchard.MediaProcessing.csproj", "{08191FCD-7258-4F19-95FB-AEC3DE77B2EB}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.MediaLibrary", "..\Orchard.Web\Modules\Orchard.MediaLibrary\Orchard.MediaLibrary.csproj", "{73A7688A-5BD3-4F7E-ADFA-CE36C5A10E3B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.OutputCache", "..\Orchard.Web\Modules\Orchard.OutputCache\Orchard.OutputCache.csproj", "{6E444FF1-A47C-4CF6-BB3F-507C8EBD776D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Workflows", "..\Orchard.Web\Modules\Orchard.Workflows\Orchard.Workflows.csproj", "{7059493C-8251-4764-9C1E-2368B8B485BC}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
@ -349,6 +359,26 @@ Global
{8A9FDB57-342D-49C2-BAFC-D885AAE5CC7C}.Debug|Any CPU.Build.0 = Debug|Any CPU {8A9FDB57-342D-49C2-BAFC-D885AAE5CC7C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8A9FDB57-342D-49C2-BAFC-D885AAE5CC7C}.Release|Any CPU.ActiveCfg = Release|Any CPU {8A9FDB57-342D-49C2-BAFC-D885AAE5CC7C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8A9FDB57-342D-49C2-BAFC-D885AAE5CC7C}.Release|Any CPU.Build.0 = Release|Any CPU {8A9FDB57-342D-49C2-BAFC-D885AAE5CC7C}.Release|Any CPU.Build.0 = Release|Any CPU
{1F0B6B85-8B0B-47CA-899D-F25B4F1B52C3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1F0B6B85-8B0B-47CA-899D-F25B4F1B52C3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1F0B6B85-8B0B-47CA-899D-F25B4F1B52C3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1F0B6B85-8B0B-47CA-899D-F25B4F1B52C3}.Release|Any CPU.Build.0 = Release|Any CPU
{08191FCD-7258-4F19-95FB-AEC3DE77B2EB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{08191FCD-7258-4F19-95FB-AEC3DE77B2EB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{08191FCD-7258-4F19-95FB-AEC3DE77B2EB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{08191FCD-7258-4F19-95FB-AEC3DE77B2EB}.Release|Any CPU.Build.0 = Release|Any CPU
{73A7688A-5BD3-4F7E-ADFA-CE36C5A10E3B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{73A7688A-5BD3-4F7E-ADFA-CE36C5A10E3B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{73A7688A-5BD3-4F7E-ADFA-CE36C5A10E3B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{73A7688A-5BD3-4F7E-ADFA-CE36C5A10E3B}.Release|Any CPU.Build.0 = Release|Any CPU
{6E444FF1-A47C-4CF6-BB3F-507C8EBD776D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6E444FF1-A47C-4CF6-BB3F-507C8EBD776D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6E444FF1-A47C-4CF6-BB3F-507C8EBD776D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6E444FF1-A47C-4CF6-BB3F-507C8EBD776D}.Release|Any CPU.Build.0 = Release|Any CPU
{7059493C-8251-4764-9C1E-2368B8B485BC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7059493C-8251-4764-9C1E-2368B8B485BC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7059493C-8251-4764-9C1E-2368B8B485BC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7059493C-8251-4764-9C1E-2368B8B485BC}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
@ -403,6 +433,11 @@ Global
{9CD5C81F-5828-4384-8474-2E2BE71D5EDD} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} {9CD5C81F-5828-4384-8474-2E2BE71D5EDD} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D}
{3BD22132-D538-48C6-8854-F71333C798EB} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} {3BD22132-D538-48C6-8854-F71333C798EB} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D}
{8A9FDB57-342D-49C2-BAFC-D885AAE5CC7C} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} {8A9FDB57-342D-49C2-BAFC-D885AAE5CC7C} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D}
{1F0B6B85-8B0B-47CA-899D-F25B4F1B52C3} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D}
{08191FCD-7258-4F19-95FB-AEC3DE77B2EB} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D}
{73A7688A-5BD3-4F7E-ADFA-CE36C5A10E3B} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D}
{6E444FF1-A47C-4CF6-BB3F-507C8EBD776D} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D}
{7059493C-8251-4764-9C1E-2368B8B485BC} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D}
{33B1BC8D-E292-4972-A363-22056B207156} = {75E7476C-C05B-4C41-8E38-081D3EB55659} {33B1BC8D-E292-4972-A363-22056B207156} = {75E7476C-C05B-4C41-8E38-081D3EB55659}
{CB70A642-8CEC-4DDE-8C9F-AD08900EC98D} = {84650275-884D-4CBB-9CC0-67553996E211} {CB70A642-8CEC-4DDE-8C9F-AD08900EC98D} = {84650275-884D-4CBB-9CC0-67553996E211}
EndGlobalSection EndGlobalSection