Initial commit, source used to build version 1.0.0 23/06/2015

This commit is contained in:
Holger Kenn 2015-06-23 12:24:21 +00:00
Родитель aaf3729449
Коммит b734a02f98
65 изменённых файлов: 7504 добавлений и 17 удалений

196
.gitignore поставляемый Normal file
Просмотреть файл

@ -0,0 +1,196 @@
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
# User-specific files
*.suo
*.user
*.userosscache
*.sln.docstates
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
build/
bld/
[Bb]in/
[Oo]bj/
# Visual Studo 2015 cache/options directory
.vs/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
# NUNIT
*.VisualState.xml
TestResult.xml
# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c
*_i.c
*_p.c
*_i.h
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc
# Chutzpah Test files
_Chutzpah*
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opensdf
*.sdf
*.cachefile
# Visual Studio profiler
*.psess
*.vsp
*.vspx
# TFS 2012 Local Workspace
$tf/
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
# JustCode is a .NET coding addin-in
.JustCode
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# NCrunch
_NCrunch_*
.*crunch*.local.xml
# MightyMoose
*.mm.*
AutoTest.Net/
# Web workbench (sass)
.sass-cache/
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# TODO: Comment the next line if you want to checkin your web deploy settings
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj
# NuGet Packages
*.nupkg
# The packages folder can be ignored because of Package Restore
**/packages/*
# except build/, which is used as an MSBuild target.
!**/packages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/packages/repositories.config
# Windows Azure Build Output
csx/
*.build.csdef
# Windows Store app package directory
AppPackages/
# Others
*.[Cc]ache
ClientBin/
[Ss]tyle[Cc]op.*
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.pfx
*.publishsettings
node_modules/
bower_components/
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
# SQL Server files
*.mdf
*.ldf
# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
# Microsoft Fakes
FakesAssemblies/
# Node.js Tools for Visual Studio
.ntvs_analysis.dat
# Visual Studio 6 build log
*.plg
# Visual Studio 6 workspace options file
*.opt

34
LICENSE
Просмотреть файл

@ -1,22 +1,26 @@
The MIT License (MIT)
Copyright (c) 2015 Microsoft
Microsoft Deployment Accelerator for hybris on Azure
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
Copyright (c) Microsoft Corporation
All rights reserved.
MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the ""Software""), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Просмотреть файл

@ -0,0 +1,141 @@
// Microsoft Deployment Accelerator for hybris on Azure - sample code
// Copyright (c) Microsoft Corporation
// see LICENSE.txt for license information
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using tangible.Azure.AdditionalConfiguration;
using tangible.Azure.Base;
using tangible.Azure.IIS;
using tangible.Azure.Tracing;
namespace MicrosoftDXGermany.hybrisOnAzure.ArrRole
{
/// <summary>
/// This plugin runs on a separate thread and monitors changes made to the environment
/// that e.g. put this instance into maintenance mode.
/// </summary>
public class ArrPlugin : IAzurePlugin
{
public static string TRACESOURCE = "ArrPlugin";
public bool Initialize()
{
this.Status = AzurePluginStatus.Initializing;
this.StatusMessage = "Initializing";
#region handle additional changes
// Hook up to the AdditionalConfigurationChanged event
AdditionalConfigurationManager.Instance.AdditionalConfigurationChanged += AdditionalConfiguration_Changed;
try
{
// set up the last known configuration
AdditionalConfigurationManager.Instance.ProcessConfiguration();
this.Status = AzurePluginStatus.NotStarted;
this.StatusMessage = "Not started.";
}
catch (Exception ex)
{
Trace.TraceAndLogError(TRACESOURCE, "Error processing initial AdditionalConfiguration:" + ex.ToString());
this.Status = AzurePluginStatus.ErrorInitializing;
this.StatusMessage = "Error processing initial AdditionalConfiguration:" + ex.ToString();
}
#endregion
this.IsAlive = false;
return true;
}
/// <summary>
/// Handles changes made to the additional configuration
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
void AdditionalConfiguration_Changed(object sender, ConfigurationItemChangedEventArgs e)
{
Trace.TraceInformation(TRACESOURCE + ":AdditionalConfiguration: " + e.Name + " (" + e.ChangeType.ToString() + ")" + " New = " + e.NewValue ?? "NULL" + " | " + "Old = " + e.OldValue ?? "NULL");
if (e.Name == "IsInMaintenance")
{
// this instance is told to change it's maintenance mode
var stringValue = (e.ChangeType == ChangeType.Added | e.ChangeType == ChangeType.Modified) ? e.NewValue : e.OldValue;
bool newValue;
if (bool.TryParse(stringValue, out newValue))
{
// enable or disable the Routing rule to the maintenance page
CommonIISHelper.ChangeArrRuleEnabled("IsInMaintenance", newValue);
}
}
SetStatus();
}
public bool IsAlive
{
get;
private set;
}
public bool Start()
{
this.Status = AzurePluginStatus.Starting;
this.StatusMessage = "Starting";
SetStatus();
this.IsAlive = true;
return true;
}
public void SendStop()
{
this.Status = AzurePluginStatus.Stopped;
this.StatusMessage = String.Empty;
}
private void SetStatus()
{
try
{
var inMaintenance = CommonIISHelper.GetArrRuleEnabled("IsInMaintenance");
if (inMaintenance == null || !inMaintenance.HasValue)
{
throw new Exception("Error retrieving 'IsInMaintenance' ArrRule.");
}
else if (inMaintenance.Value)
{
// this instance is in maintenance mode
this.Status = AzurePluginStatus.Warning;
this.StatusMessage = "Maintenance";
}
else
{
this.Status = AzurePluginStatus.Healthy;
this.StatusMessage = "Running";
}
}
catch (Exception ex)
{
this.Status = AzurePluginStatus.Error;
this.StatusMessage = ex.Message;
}
}
private AzurePluginStatus _Status;
public AzurePluginStatus Status
{
get { return _Status; }
set { _Status = value; }
}
private string _StatusMessage;
public string StatusMessage
{
get { return _StatusMessage; }
set { _StatusMessage = value; }
}
}
}

Просмотреть файл

@ -0,0 +1,111 @@
// Microsoft Deployment Accelerator for hybris on Azure - sample code
// Copyright (c) Microsoft Corporation
// see LICENSE.txt for license information
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.WindowsAzure;
using Microsoft.WindowsAzure.Diagnostics;
using Microsoft.WindowsAzure.ServiceRuntime;
using tangible.Azure.Base;
using tangible.Azure.Downloader;
using tangible.Azure.Tracing;
using tangible.Azure.StartupScripts;
using tangible.Azure.IIS;
using tangible.Azure.AdditionalConfiguration;
namespace MicrosoftDXGermany.hybrisOnAzure.ArrRole
{
/// <summary>
/// This class represents the ARR Role.
/// On Starting it downloads neccessary components and executes scripts as defined in the .cscfg file
/// There may be run multiple Plugins on this role. There is only the ArrPlugin running which handles Setting an instance in Maintenance mode.
/// </summary>
public class ArrServer : AzureComponentBase
{
static string TRACESOURCE = "ArrServer";
/// <summary>
/// Is executed before the "OnStart" method is called.
/// Here all configuration takes place.
/// </summary>
/// <returns></returns>
public override bool BeforeOnStart()
{
var onStartSuccessful = true;
System.Net.ServicePointManager.DefaultConnectionLimit = 64;
#region create plugins
this.AddPlugin<ArrPlugin>(null);
#endregion
#region Download stuff from storage
// download files from storage to this computer
try
{
Trace.TraceInformation(TRACESOURCE + ": BeforeOnStart: Starting DownloadHelper.");
DownloadHelper.Download();
}
catch (Exception ex)
{
Trace.TraceAndLogError(TRACESOURCE, "BeforeOnStart: ERROR while executing DownloadHelper. Message: " + ex.Message);
onStartSuccessful = false;
}
#endregion
#region PatchFiles
// patch files
try
{
Trace.TraceInformation(TRACESOURCE + ": BeforeOnStart: Starting PatchFiles.");
PatchFileHelper.PatchAllFilesFromConfig();
}
catch (Exception ex)
{
Trace.TraceAndLogError(TRACESOURCE, "BeforeOnStart: ERROR while executing PatchFileHelper. Message: " + ex.Message, ex);
onStartSuccessful = false;
}
#endregion
#region Run Commandlets
// execute setup via configurable commandlets.
try
{
Trace.TraceInformation(TRACESOURCE + ": BeforeOnStart: Starting SetupHelper.");
new StartupScriptHelper().ExecuteScripts();
}
catch (Exception ex)
{
Trace.TraceAndLogError(TRACESOURCE, "BeforeOnStart: ERROR while executing SetupHelper. Message: " + ex.Message, ex);
onStartSuccessful = false;
}
#endregion
#region Configure ARR
Trace.TraceInformation("WebServer - OnStart: Configuring ARR HealthMonitoring.");
onStartSuccessful = (!IISHelper.ConfigureHealthMonitoring()) ? false : onStartSuccessful;
Trace.TraceInformation("WebServer - OnStart: Configure WebFarm");
onStartSuccessful = (!IISHelper.ConfigureWebFarm()) ? false : onStartSuccessful;
#endregion
#region handle role environment changes
RoleEnvironment.Changed += RoleEnvironment_Changed;
#endregion
return onStartSuccessful;
}
void RoleEnvironment_Changed(object sender, RoleEnvironmentChangedEventArgs e)
{
// On Topology Changes to the FrontendWorkerRole --> Configure AzureWebFarm
if (e.Changes.Any(c => c is RoleEnvironmentTopologyChange))
{
Trace.TraceAndLogInformation(TRACESOURCE + ":TopologyChange", "The topology has changed. Reconfiguring webfarm.");
ClixOnAzure.WebFarmHostManager.ConfigureAzureWebFarm();
Trace.TraceInformation(TRACESOURCE + ":TopologyChange: Azure Web Farm has been reconfigured.");
}
}
}
}

Просмотреть файл

@ -0,0 +1,46 @@
// Microsoft Deployment Accelerator for hybris on Azure - sample code
// Copyright (c) Microsoft Corporation
// see LICENSE.txt for license information
using Microsoft.WindowsAzure.ServiceRuntime;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Mail;
using System.Text;
using System.Web;
using tangible.Azure.Base;
using tangible.Azure.Tracing;
namespace MicrosoftDXGermany.hybrisOnAzure.ArrRole
{
/// <summary>
/// This class represents the entry point for Windows Azure.
/// It may hold multiple Components (a component is usually run on one role, but they may be consolidated to run on one machine).
/// In this case it hosts only the ArrServer component.
/// </summary>
public class ArrWebRole : AzurePluginHost
{
public ArrWebRole()
: base()
{
this.UnhandledException += new UnhandledExceptionEventHandler(WebRole_UnhandledException);
}
void WebRole_UnhandledException(object sender, UnhandledExceptionEventArgs e)
{
Trace.TraceAndLogError("ArrWebRole", "Unhandled exception " + ((e.ExceptionObject != null) ? e.ExceptionObject.ToString() : "No information"));
}
public override bool BeforeOnStart()
{
// Note: (2) We attach also to a local file on disk
if (System.IO.File.Exists("C:\\AzureWebRoleLog.txt")) System.IO.File.Delete("C:\\AzureWebRoleLog.txt");
System.Diagnostics.Trace.Listeners.Add(new System.Diagnostics.TextWriterTraceListener("C:\\AzureWebRoleLog.txt"));
this.AddComponent(new ArrServer());
return true;
}
}
}

Просмотреть файл

@ -0,0 +1,229 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>
</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{78814B2B-8552-40CA-A30F-FA4E938BEE77}</ProjectGuid>
<ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>MicrosoftDXGermany.hybrisOnAzure.ArrRole</RootNamespace>
<AssemblyName>tangible.HybrisOnAzure.ArrRole</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<UseIISExpress>true</UseIISExpress>
<IISExpressSSLPort />
<IISExpressAnonymousAuthentication />
<IISExpressWindowsAuthentication />
<IISExpressUseClassicPipelineMode />
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
<RestorePackages>true</RestorePackages>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Ionic.Zip, Version=1.9.1.8, Culture=neutral, PublicKeyToken=edbe51ad942a3f5c, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\tangible.HybrisOnAzure.Toolbox.1.0.0\lib\Ionic.Zip.dll</HintPath>
</Reference>
<Reference Include="Microsoft.CSharp" />
<Reference Include="Microsoft.Data.Edm, Version=5.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Data.Edm.5.6.0\lib\net40\Microsoft.Data.Edm.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Data.OData, Version=5.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Data.OData.5.6.0\lib\net40\Microsoft.Data.OData.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Data.Services.Client, Version=5.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Data.Services.Client.5.6.0\lib\net40\Microsoft.Data.Services.Client.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ServiceBus, Version=2.4.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\WindowsAzure.ServiceBus.2.4.2.0\lib\net40-full\Microsoft.ServiceBus.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Web.Administration, Version=7.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\tangible.HybrisOnAzure.Toolbox.1.0.0\lib\Microsoft.Web.Administration.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAzure.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Microsoft.WindowsAzure.ConfigurationManager.2.0.3\lib\net40\Microsoft.WindowsAzure.Configuration.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAzure.Diagnostics, Version=2.4.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
<Reference Include="Microsoft.WindowsAzure.ServiceRuntime, Version=2.4.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
<Reference Include="Microsoft.WindowsAzure.Storage, Version=4.2.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\WindowsAzure.Storage.4.2.1\lib\net40\Microsoft.WindowsAzure.Storage.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Newtonsoft.Json.6.0.3\lib\net40\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="SendGrid.SmtpApi, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\SendGrid.SmtpApiPlus.1.0.1\lib\portable-net4+sl5+wp8+win8+wpa81+monotouch+monoandroid\SendGrid.SmtpApi.dll</HintPath>
</Reference>
<Reference Include="SendGridPlus, Version=3.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\SendGridPlus.4.1\lib\net40\SendGridPlus.dll</HintPath>
</Reference>
<Reference Include="System.IO">
<HintPath>..\packages\Microsoft.Bcl.1.1.8\lib\net40\System.IO.dll</HintPath>
</Reference>
<Reference Include="System.Net.Http, Version=2.2.20.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Microsoft.Net.Http.2.2.20\lib\net40\System.Net.Http.dll</HintPath>
</Reference>
<Reference Include="System.Net.Http.Extensions, Version=2.2.20.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Microsoft.Net.Http.2.2.20\lib\net40\System.Net.Http.Extensions.dll</HintPath>
</Reference>
<Reference Include="System.Net.Http.Primitives, Version=2.2.20.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Microsoft.Net.Http.2.2.20\lib\net40\System.Net.Http.Primitives.dll</HintPath>
</Reference>
<Reference Include="System.Net.Http.WebRequest, Version=2.2.20.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Microsoft.Net.Http.2.2.20\lib\net40\System.Net.Http.WebRequest.dll</HintPath>
</Reference>
<Reference Include="System.Runtime">
<HintPath>..\packages\Microsoft.Bcl.1.1.8\lib\net40\System.Runtime.dll</HintPath>
</Reference>
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.Spatial, Version=5.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\System.Spatial.5.6.0\lib\net40\System.Spatial.dll</HintPath>
</Reference>
<Reference Include="System.Threading.Tasks">
<HintPath>..\packages\Microsoft.Bcl.1.1.8\lib\net40\System.Threading.Tasks.dll</HintPath>
</Reference>
<Reference Include="System.Web.DynamicData" />
<Reference Include="System.Web.Entity" />
<Reference Include="System.Web.ApplicationServices" />
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Web.Extensions" />
<Reference Include="System.Web" />
<Reference Include="System.Xml" />
<Reference Include="System.Configuration" />
<Reference Include="System.Web.Services" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.ServiceModel" />
<Reference Include="tangible.Azure.AdditionalConfiguration, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\tangible.HybrisOnAzure.Toolbox.1.0.0\lib\tangible.Azure.AdditionalConfiguration.dll</HintPath>
</Reference>
<Reference Include="tangible.Azure.Auxiliary, Version=1.0.0.3335, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\tangible.HybrisOnAzure.Toolbox.1.0.0\lib\tangible.Azure.Auxiliary.dll</HintPath>
</Reference>
<Reference Include="tangible.Azure.Base, Version=1.0.0.3276, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\tangible.HybrisOnAzure.Toolbox.1.0.0\lib\tangible.Azure.Base.dll</HintPath>
</Reference>
<Reference Include="tangible.Azure.Downloader, Version=1.0.0.3335, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\tangible.HybrisOnAzure.Toolbox.1.0.0\lib\tangible.Azure.Downloader.dll</HintPath>
</Reference>
<Reference Include="tangible.Azure.IIS, Version=1.0.0.3335, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\tangible.HybrisOnAzure.Toolbox.1.0.0\lib\tangible.Azure.IIS.dll</HintPath>
</Reference>
<Reference Include="tangible.Azure.Management">
<HintPath>..\packages\tangible.HybrisOnAzure.Toolbox.1.0.0\lib\tangible.Azure.Management.dll</HintPath>
</Reference>
<Reference Include="tangible.Azure.StartupScripts, Version=1.0.0.3357, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\tangible.HybrisOnAzure.Toolbox.1.0.0\lib\tangible.Azure.StartupScripts.dll</HintPath>
</Reference>
<Reference Include="tangible.Azure.Storage, Version=1.0.0.3276, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\tangible.HybrisOnAzure.Toolbox.1.0.0\lib\tangible.Azure.Storage.dll</HintPath>
</Reference>
<Reference Include="tangible.Azure.Tracing, Version=1.0.0.3276, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\tangible.HybrisOnAzure.Toolbox.1.0.0\lib\tangible.Azure.Tracing.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Content Include="maintenance.html" />
<Content Include="packages.config" />
<None Include="Web.Debug.config">
<DependentUpon>Web.config</DependentUpon>
</None>
<None Include="Web.Release.config">
<DependentUpon>Web.config</DependentUpon>
</None>
</ItemGroup>
<ItemGroup>
<Content Include="Web.config" />
</ItemGroup>
<ItemGroup>
<Compile Include="ArrPlugin.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="ArrServer.cs" />
<Compile Include="ArrWebRole.cs" />
</ItemGroup>
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" Condition="false" />
<ProjectExtensions>
<VisualStudio>
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
<WebProjectProperties>
<UseIIS>True</UseIIS>
<AutoAssignPort>True</AutoAssignPort>
<DevelopmentServerPort>51181</DevelopmentServerPort>
<DevelopmentServerVPath>/</DevelopmentServerVPath>
<IISUrl>http://localhost:51181/</IISUrl>
<NTLMAuthentication>False</NTLMAuthentication>
<UseCustomServer>False</UseCustomServer>
<CustomServerUrl>
</CustomServerUrl>
<SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
</WebProjectProperties>
</FlavorProperties>
</VisualStudio>
</ProjectExtensions>
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
</Target>
<Import Project="..\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets" Condition="Exists('..\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets')" />
<Target Name="EnsureBclBuildImported" BeforeTargets="BeforeBuild" Condition="'$(BclBuildImported)' == ''">
<Error Condition="!Exists('..\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets')" Text="This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=317567." HelpKeyword="BCLBUILD2001" />
<Error Condition="Exists('..\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets')" Text="The build restored NuGet packages. Build the project again to include these packages in the build. For more information, see http://go.microsoft.com/fwlink/?LinkID=317568." HelpKeyword="BCLBUILD2002" />
</Target>
<!-- 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.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

Просмотреть файл

@ -0,0 +1,35 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("tangible.HybrisOnAzure.ArrRole")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft")]
[assembly: AssemblyProduct("tangible.HybrisOnAzure.ArrRole")]
[assembly: AssemblyCopyright("Copyright © Microsoft 2014")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("f2dbaea7-e4b7-493a-ad43-74831ca121f8")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

Просмотреть файл

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- For more information on using web.config transformation visit http://go.microsoft.com/fwlink/?LinkId=125889 -->
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<!--
In the example below, the "SetAttributes" transform will change the value of
"connectionString" to use "ReleaseSQLServer" only when the "Match" locator
finds an attribute "name" that has a value of "MyDB".
<connectionStrings>
<add name="MyDB"
connectionString="Data Source=ReleaseSQLServer;Initial Catalog=MyReleaseDB;Integrated Security=True"
xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
</connectionStrings>
-->
<system.web>
<!--
In the example below, the "Replace" transform will replace the entire
<customErrors> section of your web.config file.
Note that because there is only one customErrors section under the
<system.web> node, there is no need to use the "xdt:Locator" attribute.
<customErrors defaultRedirect="GenericError.htm"
mode="RemoteOnly" xdt:Transform="Replace">
<error statusCode="500" redirect="InternalError.htm"/>
</customErrors>
-->
</system.web>
</configuration>

Просмотреть файл

@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- For more information on using web.config transformation visit http://go.microsoft.com/fwlink/?LinkId=125889 -->
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<!--
In the example below, the "SetAttributes" transform will change the value of
"connectionString" to use "ReleaseSQLServer" only when the "Match" locator
finds an attribute "name" that has a value of "MyDB".
<connectionStrings>
<add name="MyDB"
connectionString="Data Source=ReleaseSQLServer;Initial Catalog=MyReleaseDB;Integrated Security=True"
xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
</connectionStrings>
-->
<system.web>
<compilation xdt:Transform="RemoveAttributes(debug)" />
<!--
In the example below, the "Replace" transform will replace the entire
<customErrors> section of your web.config file.
Note that because there is only one customErrors section under the
<system.web> node, there is no need to use the "xdt:Locator" attribute.
<customErrors defaultRedirect="GenericError.htm"
mode="RemoteOnly" xdt:Transform="Replace">
<error statusCode="500" redirect="InternalError.htm"/>
</customErrors>
-->
</system.web>
</configuration>

Просмотреть файл

@ -0,0 +1,151 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<system.diagnostics>
<trace>
<listeners>
<add type="Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics, Version=2.4.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" name="AzureDiagnostics">
<filter type="" />
</add>
</listeners>
</trace>
</system.diagnostics>
<system.web>
<compilation debug="true" targetFramework="4.0" />
<httpRuntime />
</system.web>
<system.webServer>
<!-- Rules for Application Request routing -->
<rewrite>
<rules>
<!-- Deliver Maintenance Page directly -->
<rule name="MaintenancePage" stopProcessing="true" enabled="true">
<match url="^maintenance.html$" />
<action type="None" />
</rule>
<!-- create a rule for each additional custom maintenance page files -->
<!--<rule name="MaintenancePage" stopProcessing="true" enabled="true">
<match url="^myfile.ext$" />
<action type="None" />
</rule>-->
<!-- Rule to redirect all traffic to the maintenance page -->
<rule name="IsInMaintenance" stopProcessing="true" enabled="false">
<match url="(.*)" />
<action type="Rewrite" url="/maintenance.html" redirectType="Temporary" />
</rule>
<!-- Rules to deny access to cockpit urls -->
<rule name="Block_AdminCockpit" stopProcessing="true" enabled="true">
<match url="^admincockpit($|/.*)" />
<action type="CustomResponse" statusCode="403" statusReason="Forbidden: Access is denied." statusDescription="You do not have permission to view this directory or page using the credentials that you supplied." />
</rule>
<rule name="Block_CmsCockpit" stopProcessing="true" enabled="true">
<match url="^cmscockpit($|/.*)" />
<action type="CustomResponse" statusCode="403" statusReason="Forbidden: Access is denied." statusDescription="You do not have permission to view this directory or page using the credentials that you supplied." />
</rule>
<rule name="Block_CmsCockpitRegular" stopProcessing="true" enabled="true">
<match url="^cmscockpitRegular($|/.*)" />
<action type="CustomResponse" statusCode="403" statusReason="Forbidden: Access is denied." statusDescription="You do not have permission to view this directory or page using the credentials that you supplied." />
</rule>
<rule name="Block_AcceleratorServices" stopProcessing="true" enabled="true">
<match url="^acceleratorservices($|/.*)" />
<action type="CustomResponse" statusCode="403" statusReason="Forbidden: Access is denied." statusDescription="You do not have permission to view this directory or page using the credentials that you supplied." />
</rule>
<rule name="Block_CsCockpit" stopProcessing="true" enabled="true">
<match url="^cscockpit($|/.*)" />
<action type="CustomResponse" statusCode="403" statusReason="Forbidden: Access is denied." statusDescription="You do not have permission to view this directory or page using the credentials that you supplied." />
</rule>
<rule name="Block_hac" stopProcessing="true" enabled="true">
<match url="^hac($|/.*)" />
<action type="CustomResponse" statusCode="403" statusReason="Forbidden: Access is denied." statusDescription="You do not have permission to view this directory or page using the credentials that you supplied." />
</rule>
<rule name="Block_hmc" stopProcessing="true" enabled="true">
<match url="^hmc($|/.*)" />
<action type="CustomResponse" statusCode="403" statusReason="Forbidden: Access is denied." statusDescription="You do not have permission to view this directory or page using the credentials that you supplied." />
</rule>
<rule name="Block_instore" stopProcessing="true" enabled="true">
<match url="^instore($|/.*)" />
<action type="CustomResponse" statusCode="403" statusReason="Forbidden: Access is denied." statusDescription="You do not have permission to view this directory or page using the credentials that you supplied." />
</rule>
<rule name="Block_mcc" stopProcessing="true" enabled="true">
<match url="^mcc($|/.*)" />
<action type="CustomResponse" statusCode="403" statusReason="Forbidden: Access is denied." statusDescription="You do not have permission to view this directory or page using the credentials that you supplied." />
</rule>
<rule name="Block_ws410" stopProcessing="true" enabled="true">
<match url="^ws410($|/.*)" />
<action type="CustomResponse" statusCode="403" statusReason="Forbidden: Access is denied." statusDescription="You do not have permission to view this directory or page using the credentials that you supplied." />
</rule>
<rule name="Block_ProductCockpit" stopProcessing="true" enabled="true">
<match url="^productcockpit($|/.*)" />
<action type="CustomResponse" statusCode="403" statusReason="Forbidden: Access is denied." statusDescription="You do not have permission to view this directory or page using the credentials that you supplied." />
</rule>
<rule name="Block_ReportCockpit" stopProcessing="true" enabled="true">
<match url="^reportcockpit($|/.*)" />
<action type="CustomResponse" statusCode="403" statusReason="Forbidden: Access is denied." statusDescription="You do not have permission to view this directory or page using the credentials that you supplied." />
</rule>
<rule name="Block_SolrFacetSearch" stopProcessing="true" enabled="true">
<match url="^solrfacetsearch($|/.*)" />
<action type="CustomResponse" statusCode="403" statusReason="Forbidden: Access is denied." statusDescription="You do not have permission to view this directory or page using the credentials that you supplied." />
</rule>
<rule name="Block_VirtualJDBC" stopProcessing="true" enabled="true">
<match url="^virtualjdbc($|/.*)" />
<action type="CustomResponse" statusCode="403" statusReason="Forbidden: Access is denied." statusDescription="You do not have permission to view this directory or page using the credentials that you supplied." />
</rule>
<rule name="Block_Test" stopProcessing="true" enabled="true">
<match url="^test($|/.*)" />
<action type="CustomResponse" statusCode="403" statusReason="Forbidden: Access is denied." statusDescription="You do not have permission to view this directory or page using the credentials that you supplied." />
</rule>
<!-- Rule to redirect all traffic to the webfarm -->
<rule name="WebFarm" stopProcessing="true">
<match url="(.*)" />
<action type="Rewrite" url="http://AzureWebFarm/{R:0}" />
</rule>
</rules>
</rewrite>
</system.webServer>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Net.Http" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.2.20.0" newVersion="2.2.20.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<system.serviceModel>
<extensions>
<!-- In this extension section we are introducing all known service bus extensions. User can remove the ones they don't need. -->
<behaviorExtensions>
<add name="connectionStatusBehavior" type="Microsoft.ServiceBus.Configuration.ConnectionStatusElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="transportClientEndpointBehavior" type="Microsoft.ServiceBus.Configuration.TransportClientEndpointBehaviorElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="serviceRegistrySettings" type="Microsoft.ServiceBus.Configuration.ServiceRegistrySettingsElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</behaviorExtensions>
<bindingElementExtensions>
<add name="netMessagingTransport" type="Microsoft.ServiceBus.Messaging.Configuration.NetMessagingTransportExtensionElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="tcpRelayTransport" type="Microsoft.ServiceBus.Configuration.TcpRelayTransportElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="httpRelayTransport" type="Microsoft.ServiceBus.Configuration.HttpRelayTransportElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="httpsRelayTransport" type="Microsoft.ServiceBus.Configuration.HttpsRelayTransportElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="onewayRelayTransport" type="Microsoft.ServiceBus.Configuration.RelayedOnewayTransportElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</bindingElementExtensions>
<bindingExtensions>
<add name="basicHttpRelayBinding" type="Microsoft.ServiceBus.Configuration.BasicHttpRelayBindingCollectionElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="webHttpRelayBinding" type="Microsoft.ServiceBus.Configuration.WebHttpRelayBindingCollectionElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="ws2007HttpRelayBinding" type="Microsoft.ServiceBus.Configuration.WS2007HttpRelayBindingCollectionElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="netTcpRelayBinding" type="Microsoft.ServiceBus.Configuration.NetTcpRelayBindingCollectionElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="netOnewayRelayBinding" type="Microsoft.ServiceBus.Configuration.NetOnewayRelayBindingCollectionElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="netEventRelayBinding" type="Microsoft.ServiceBus.Configuration.NetEventRelayBindingCollectionElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="netMessagingBinding" type="Microsoft.ServiceBus.Messaging.Configuration.NetMessagingBindingCollectionElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</bindingExtensions>
</extensions>
</system.serviceModel><appSettings>
<!-- Service Bus specific app setings for messaging connections -->
<add key="Microsoft.ServiceBus.ConnectionString" value="Endpoint=sb://[your namespace].servicebus.windows.net;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=[your secret]" />
</appSettings></configuration>

Просмотреть файл

@ -0,0 +1,9 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
We're sorry. But this server is in maintenance mode. Please visit us again later.
</body>
</html>

Просмотреть файл

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.Bcl" version="1.1.8" targetFramework="net40" />
<package id="Microsoft.Bcl.Build" version="1.0.14" targetFramework="net40" />
<package id="Microsoft.Data.Edm" version="5.6.0" targetFramework="net40" />
<package id="Microsoft.Data.OData" version="5.6.0" targetFramework="net40" />
<package id="Microsoft.Data.Services.Client" version="5.6.0" targetFramework="net40" />
<package id="Microsoft.Net.Http" version="2.2.20" targetFramework="net40" />
<package id="Microsoft.WindowsAzure.ConfigurationManager" version="2.0.3" targetFramework="net40" />
<package id="Newtonsoft.Json" version="6.0.3" targetFramework="net40" />
<package id="SendGrid.SmtpApiPlus" version="1.0.1" targetFramework="net40" />
<package id="SendGridPlus" version="4.1" targetFramework="net40" />
<package id="System.Spatial" version="5.6.0" targetFramework="net40" />
<package id="tangible.HybrisOnAzure.Toolbox" version="1.0.0" targetFramework="net40" />
<package id="WindowsAzure.ServiceBus" version="2.4.2.0" targetFramework="net40" />
<package id="WindowsAzure.Storage" version="4.2.1" targetFramework="net40" />
</packages>

Просмотреть файл

@ -0,0 +1,169 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Admin.aspx.cs" Inherits="MicrosoftDXGermany.hybrisOnAzure.BackOfficeWorkerRole.Admin" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Hybris on Azure : Admin Page</title>
<style type="text/css">
body {
font-family:Verdana;
height:100%;
width:100%;
font-size:10pt;
}
h1 {
font-size:16pt;
}
h2 {
font-size:13pt;
}
div.centerFrame {
width:1000px;
display:block;
margin-left:auto;
margin-right:auto;
border:solid 1px black;
padding:5px;
}
div.default {
width:150px;
height:100px;
padding:5px;
background-color:lightblue;
}
div.healthy {
width:150px;
height:100px;
padding:5px;
background-color:green;
}
div.warning {
width:150px;
height:100px;
padding:5px;
background-color:orange;
}
div.error {
width:150px;
height:100px;
padding:5px;
background-color:red;
}
span.healthy {
color:green;
}
span.warning {
color:orange;
}
span.error {
color:red;
}
table.centerTable {
width:960px;
display:block;
margin-left:auto;
margin-right:auto;
}
table.instanceOptions {
margin-top:5px;
}
th {
font-weight:normal;
text-align:left;
width:150px;
vertical-align:top;
}
td {
text-align:left;
vertical-align:top;
}
div.pluginState {
vertical-align:top;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<table border="0">
<tr>
<td>
<h1>Administration Page</h1>
</td>
<td>
<a href="Admin.aspx">Refresh</a>
</td>
</tr>
</table>
<h2>Application Request Routing Tier</h2>
<div class="centerFrame">
<asp:Table ID="tblArr" runat="server" CssClass="centerTable" BorderColor="0" CellSpacing="5" />
<table class="centerTable" style="margin-top:10px;">
<tr>
<th>Instances:</th>
<td>
<asp:TextBox ID="txtArrInstanceCount" runat="server" Width="50px" MaxLength="2" TextMode="SingleLine" />
</td>
</tr>
</table>
</div>
<h2>Frontend Worker</h2>
<div class="centerFrame" runat="server">
<asp:Table ID="tblFrontend" runat="server" CssClass="centerTable" BorderColor="0" CellSpacing="5" />
<table class="centerTable" style="margin-top:10px;">
<tr>
<th>Instances:</th>
<td>
<asp:TextBox ID="txtFrontendInstanceCount" runat="server" Width="50px" MaxLength="2" TextMode="SingleLine" />
</td>
</tr>
</table>
</div>
<h2>BackOffice Worker</h2>
<div class="centerFrame">
<asp:Table ID="tblBackOffice" runat="server" CssClass="centerTable" BorderColor="0" CellSpacing="5" />
</div>
<h2>Deployment</h2>
<div class="centerFrame">
<table border="0" class="centerTable">
<tr>
<th>Java:</th>
<td>
<asp:TextBox ID="txtJavaPackage" runat="server" width="300" />
</td>
</tr>
<tr>
<th>Hybris:</th>
<td>
<asp:TextBox ID="txtHybrisPackage" runat="server" Width="300" />
</td>
</tr>
</table>
</div>
<hr />
<table border="0">
<tr>
<td colspan="2">
Benutzername: <asp:TextBox ID="txtUserName" runat="server" Width="250" />
</td>
</tr>
<tr>
<td>
<asp:Button Text="Submit changes" ID="cmdSubmit" runat="server" OnClick="cmdSubmit_Click" />
</td>
<td>
<asp:Label ID="lblMessage" runat="server" />
</td>
</tr>
</table>
<hr />
<h1>Deployment History</h1>
<asp:Table ID="tblDeploymentHistory" runat="server" />
</form>
</body>
</html>

Просмотреть файл

@ -0,0 +1,563 @@
using Microsoft.WindowsAzure.ServiceRuntime;
using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceModel;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using tangible.Azure.StatusService;
using System.Net;
using System.Text;
using Microsoft.WindowsAzure.Storage;
using tangible.Azure.Storage.Blob;
using Microsoft.WindowsAzure.Storage.Blob;
using System.IO;
using System.Xml.Linq;
using System.Xml.Serialization;
using AdditionalConfiguration = tangible.Azure.AdditionalConfiguration.AdditionalConfiguration;
namespace MicrosoftDXGermany.hybrisOnAzure.BackOfficeWorkerRole
{
public partial class Admin : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
try
{
if (!RoleEnvironment.IsAvailable) { Response.Write("Role environment not available."); return; }
// get currently active additional configuration
var additionalConfig = GetAdditionalConfiguration();
// display the current status of
DisplayArrStatus(additionalConfig);
// if there are instances of the frontend worker > display their status
if (RoleEnvironment.Roles.ContainsKey("tangible.HybrisOnAzure.FrontendWorkerRole"))
{
DisplayRoleStatus("tangible.HybrisOnAzure.FrontendWorkerRole", "FrontendWorkerServer", tblFrontend, additionalConfig);
if (!Page.IsPostBack)
txtFrontendInstanceCount.Text = RoleEnvironment.Roles["tangible.HybrisOnAzure.FrontendWorkerRole"].Instances.Count.ToString();
}
// if there are instances of the backend workder > display their status
if (RoleEnvironment.Roles.ContainsKey("tangible.HybrisOnAzure.BackOfficeWorkerRole"))
DisplayRoleStatus("tangible.HybrisOnAzure.BackOfficeWorkerRole", "BackOfficeWorkerServer", tblBackOffice, additionalConfig);
// display currently used hybris and java packages
if (!Page.IsPostBack)
{
var defaultConfig = additionalConfig.Roles.First(r => r.Name == "tangible.HybrisOnAzure.BackOfficeWorkerRole").Instances.First(i => i.Id == "default");
txtJavaPackage.Text = defaultConfig.Configurations.Any(c => c.Name == "JavaPackage") ? defaultConfig.Configurations.First(c => c.Name == "JavaPackage").Value : string.Empty;
txtHybrisPackage.Text = defaultConfig.Configurations.Any(c => c.Name == "HybrisPackage") ? defaultConfig.Configurations.First(c => c.Name == "HybrisPackage").Value : string.Empty;
}
// display DeploymentHistory
DisplayDeploymentHistory();
}
catch(Exception ex)
{
Response.Write("Error loading the Admin.aspx page: " + ex.ToString());
}
}
private void DisplayArrStatus(AdditionalConfiguration additionalConfig)
{
var role = RoleEnvironment.Roles["tangible.HybrisOnAzure.ArrRole"];
TableRow currentRow = null;
for(int i = 0; i < role.Instances.Count; i++)
{
var currentInstance = role.Instances[i];
// only display 6 instances per row
// > add current row and create a new one
if (i % 6 == 0)
{
currentRow = new TableRow();
tblArr.Rows.Add(currentRow);
}
var cll = new TableCell();
currentRow.Cells.Add(cll);
var div = new Panel() { CssClass = "default" };
cll.Controls.Add(div);
// display IPAddress / Name of that instance
div.Controls.Add(new Label() { Text = currentInstance.InstanceEndpoints.First().Value.IPEndpoint.Address.ToString() + "<br />" });
// get status from that instance
var statusClient = GetStatusServiceClientForInstance(currentInstance);
if (statusClient == null)
{
div.CssClass = "error";
div.Controls.Add(new Label() { Text = "No connection to status client." });
continue;
}
Dictionary<string, Dictionary<string, Tuple<string, string>>> clientResult = null;
try
{
clientResult = statusClient.GetPluginStatus();
}
catch(Exception ex)
{
div.CssClass = "error";
div.Controls.Add(new Label() { Text = "Error retrieving client status. " + ex.Message });
continue;
}
// there is only one component (ArrServer) running hosting one plugin (ArrPlugin)
// > we get this specific status information
Tuple<string, string> arrPluginStatus;
try
{
arrPluginStatus = clientResult["ArrServer"]["ArrPlugin"];
var status = arrPluginStatus.Item1.ToLower();
div.CssClass = (status == "healthy" || status == "warning" || status == "error") ? status : "default";
div.Controls.Add(new Label() { Text = arrPluginStatus.Item2 });
}
catch(Exception ex)
{
div.CssClass = "warning";
div.Controls.Add(new Label() { Text = "Error getting plugin status: " + ex.Message });
continue;
}
// display checkBox for MaintenanceMode
var chk = new CheckBox() { ID = "chkMaintenance_" + currentInstance.Id, Text = "Set maintenance" };
if (!Page.IsPostBack)
chk.Checked = arrPluginStatus.Item2.ToLower().Contains("maintenance");
cll.Controls.Add(chk);
}
// display current instance count
if (!Page.IsPostBack)
{
txtArrInstanceCount.Text = role.Instances.Count.ToString();
}
}
private void DisplayRoleStatus(string roleName, string componentName, Table targetTable, AdditionalConfiguration additionalConfig)
{
var role = RoleEnvironment.Roles[roleName];
foreach(var currentInstance in role.Instances)
{
var additionalInstanceConfig = additionalConfig.GetConfigurationForInstance(currentInstance.Role.Name, currentInstance.Id);
var row = new TableRow();
targetTable.Rows.Add(row);
var cll1 = new TableCell();
row.Cells.Add(cll1);
var div = new Panel();
cll1.Controls.Add(div);
// display IPAddress / Name of that instance
div.Controls.Add(new Label() { Text = currentInstance.InstanceEndpoints.First().Value.IPEndpoint.Address.ToString() + "<br />" });
// get status from that instance
var statusClient = GetStatusServiceClientForInstance(currentInstance);
if (statusClient == null)
{
div.CssClass = "error";
div.Controls.Add(new Label() { Text = "No connection to status client." });
continue;
}
Dictionary<string, Dictionary<string, Tuple<string, string>>> clientResult = null;
try
{
clientResult = statusClient.GetPluginStatus();
}
catch (Exception ex)
{
div.CssClass = "error";
div.Controls.Add(new Label() { Text = "Error retrieving client status. " + ex.Message });
continue;
}
var cll2 = new TableCell();
row.Cells.Add(cll2);
var div2 = new Panel() { CssClass = "pluginState" };
cll2.Controls.Add(div2);
// there is only one component running: FrontendWorkerServer or BackOfficeWorkerServer
var component = clientResult[componentName];
foreach(var pluginName in component.Keys)
{
div2.Controls.Add(new Label() { Text = pluginName + " (" });
div2.Controls.Add(new Label() { Text = component[pluginName].Item1, CssClass = component[pluginName].Item1.ToLower() });
div2.Controls.Add(new Label() { Text = "): " + component[pluginName].Item2 + "<br />" });
}
// display role status
if (component.Values.Any(pluginStatus => pluginStatus.Item1.ToLower() == "error"))
{
div.CssClass = "error";
div.Controls.Add(new Label() { Text = "Error" });
}
else if (component.Values.Any(pluginStatus => pluginStatus.Item1.ToLower() == "warning"))
{
div.CssClass = "warning";
div.Controls.Add(new Label() { Text = "Error" });
}
else
{
div.CssClass = "healthy";
div.Controls.Add(new Label() { Text = "Healthy" });
}
// display controls for rebooting and stop hybris
var table = new Table() { CssClass = "instanceOptions" };
cll2.Controls.Add(table);
var r1 = new TableRow();
table.Rows.Add(r1);
var c1 = new TableCell();
r1.Cells.Add(c1);
var chk1 = new CheckBox() { ID = "chkStopHybris_" + currentInstance.Id, Text = "Stop Hybris" };
if (!Page.IsPostBack)
chk1.Checked = additionalInstanceConfig.Any(c => c.Name == "StopHybris") ? bool.Parse(additionalInstanceConfig.First(c => c.Name == "StopHybris").Value) : false;
c1.Controls.Add(chk1);
var r2 = new TableRow();
table.Rows.Add(r2);
var c2 = new TableCell();
r2.Cells.Add(c2);
var chk2 = new CheckBox() { ID = "chkReboot_" + currentInstance.Id, Text = "Reboot" };
if (!Page.IsPostBack)
chk2.Checked = false; // TODO: Init
c2.Controls.Add(chk2);
}
}
private void DisplayDeploymentHistory()
{
CloudStorageAccount storageAccount;
if (!RoleEnvironment.IsAvailable)
storageAccount = CloudStorageAccount.Parse("UseDevelopmentStorage=true;");
else
storageAccount = CloudStorageAccount.Parse(RoleEnvironment.GetConfigurationSettingValue("StorageConnectionString"));
var blobClient = storageAccount.CreateCloudBlobClient();
var container = blobClient.GetContainerReference("config");
container.CreateIfNotExists();
foreach(var blob in container.ListBlobs().Where(b => b is CloudBlockBlob).Select(b => b as CloudBlockBlob).OrderByDescending(b => b.Name))
{
var row = new TableRow();
tblDeploymentHistory.Rows.Add(row);
var cell1 = new TableHeaderCell() { Text = blob.Name };
cell1.Style.Add("width", "250px");
row.Cells.Add(cell1);
var cell2 = new TableCell() { Text = "<a href=\"GetDeploymentHistory.ashx?deploymentInfo=" + blob.Name + "\">Download</a>" };
row.Cells.Add(cell2);
}
}
private IStatusService GetStatusServiceClientForInstance(RoleInstance instance)
{
try
{
NetTcpBinding binding = new NetTcpBinding(SecurityMode.None);
var factory = new ChannelFactory<IStatusService>(binding);
var endpoint = instance.InstanceEndpoints["PluginStatus"];
EndpointAddress address = new EndpointAddress(String.Format("net.tcp://{0}/PluginStatus", endpoint.IPEndpoint));
return factory.CreateChannel(address);
}
catch(Exception ex)
{
tangible.Azure.Tracing.Trace.TraceAndLogError("StatusPage", "Error getting status service client for " + instance.Id + ": " + ex.ToString());
return null;
}
}
protected void cmdSubmit_Click(object sender, EventArgs e)
{
// check, if user provided a user name
if (string.IsNullOrWhiteSpace(txtUserName.Text))
{
lblMessage.Text = "Please provide a user name to associate with change submission";
lblMessage.CssClass = "error";
return;
}
// get currently active additional configuration
var oldAddConfig = GetAdditionalConfiguration();
// create a new AdditionalConfiguration based on user input
tangible.Azure.AdditionalConfiguration.AdditionalConfiguration newAddConfig = null;
try
{
newAddConfig = GetNewAdditionalConfiguration();
newAddConfig.Timestamp = DateTime.UtcNow;
newAddConfig.Author = txtUserName.Text;
}
catch (Exception ex)
{
lblMessage.Text = "Error creating new additional configuration: " + ex.ToString();
lblMessage.CssClass = "error";
return;
}
// update java and hybris packages
try
{
UpdateJavaAndHybrisPackages(oldAddConfig, newAddConfig);
}
catch(Exception ex)
{
lblMessage.Text = "Error updating Packages: " + ex.ToString();
lblMessage.CssClass = "error";
return;
}
// upload new configuration file to the blob store
string containerAndFilePath = null;
try
{
containerAndFilePath = UploadAdditionalConfiguration(newAddConfig);
}
catch(Exception ex)
{
lblMessage.Text = "Error uploading new additional configuration: " + ex.ToString();
lblMessage.CssClass = "error";
return;
}
// Adapt Deployment-Configuration for additional-config-file and instance counts
try
{
UpdateCloudServiceConfigurationAndInstanceCount(containerAndFilePath);
lblMessage.Text = "New configuration posted successfully.";
lblMessage.CssClass = "healthy";
}
catch(Exception ex)
{
lblMessage.Text = "Error setting new service configuration: " + ex.ToString();
lblMessage.CssClass = "error";
}
}
private void UpdateCloudServiceConfigurationAndInstanceCount(string containerAndFilePath)
{
var deploymentSlot = RoleEnvironment.GetConfigurationSettingValue("HybrisOnAzure.DeploymentSlot");
var subscriptionId = RoleEnvironment.GetConfigurationSettingValue("HybrisOnAzure.SubscriptionId");
var managementThumb = RoleEnvironment.GetConfigurationSettingValue("HybrisOnAzure.ManagementCertThumb");
var hostedServiceName = RoleEnvironment.GetConfigurationSettingValue("HybrisOnAzure.HostedServiceName");
var deployment = GetDeployment(subscriptionId, hostedServiceName, deploymentSlot, managementThumb);
var clearConfig = System.Text.Encoding.UTF8.GetString(System.Convert.FromBase64String(deployment.Configuration));
var xConfig = XElement.Parse(clearConfig);
int arrInstanceCount;
if (!int.TryParse(txtArrInstanceCount.Text, out arrInstanceCount))
arrInstanceCount = RoleEnvironment.Roles["tangible.HybrisOnAzure.ArrRole"].Instances.Count;
SetInstanceCount(xConfig, "tangible.HybrisOnAzure.ArrRole", arrInstanceCount);
if (RoleEnvironment.Roles.ContainsKey("tangible.HybrisOnAzure.FrontendWorkerRole"))
{
int frontendInstanceCount;
if (!int.TryParse(txtFrontendInstanceCount.Text, out frontendInstanceCount))
frontendInstanceCount = RoleEnvironment.Roles["tangible.HybrisOnAzure.FrontendWorkerRole"].Instances.Count;
SetInstanceCount(xConfig, "tangible.HybrisOnAzure.FrontendWorkerRole", frontendInstanceCount);
}
SetAdditionalConfigFile(xConfig, containerAndFilePath);
SetConfiguration(deployment, xConfig);
}
private void UpdateJavaAndHybrisPackages(AdditionalConfiguration oldAddConfig, AdditionalConfiguration newAddConfig)
{
CloudStorageAccount storageAccount;
if (!RoleEnvironment.IsAvailable)
storageAccount = CloudStorageAccount.Parse("UseDevelopmentStorage=true;");
else
storageAccount = CloudStorageAccount.Parse(RoleEnvironment.GetConfigurationSettingValue("StorageConnectionString"));
var blobClient = storageAccount.CreateCloudBlobClient();
var oldDefaultBackOfficeConfig = oldAddConfig.Roles.First(r => r.Name == "tangible.HybrisOnAzure.BackOfficeWorkerRole").Instances.First(i => i.Id == "default");
var currentJavaPackage = oldDefaultBackOfficeConfig.Configurations.Any(c => c.Name == "JavaPackage") ? oldDefaultBackOfficeConfig.Configurations.First(c => c.Name == "JavaPackage").Value : string.Empty;
var currentHybrisPackage = oldDefaultBackOfficeConfig.Configurations.Any(c => c.Name == "HybrisPackage") ? oldDefaultBackOfficeConfig.Configurations.First(c => c.Name == "HybrisPackage").Value : string.Empty;
var newJavaPackage = txtJavaPackage.Text;
if (string.IsNullOrEmpty(newJavaPackage))
throw new Exception("No Java Package defined.");
if (!blobClient.BlobExists("deployment/JavaPackages/" + newJavaPackage))
throw new Exception("Could not find java package at deployment/JavaPackages/" + newJavaPackage);
var newHybrisPackage = txtHybrisPackage.Text;
if (string.IsNullOrEmpty(newHybrisPackage))
throw new Exception("No Hybris Package defined.");
if (!blobClient.DirectoryExists("deployment/HybrisPackages/" + newHybrisPackage))
throw new Exception("Could not find hybris package at deployment/HybrisPackages/" + newHybrisPackage);
if (currentJavaPackage != newJavaPackage)
blobClient.CopyBlob("deployment/JavaPackages/" + newJavaPackage, "deployment/java.zip");
if (currentHybrisPackage != newHybrisPackage)
blobClient.CopyDirectory("deployment/HybrisPackages/" + newHybrisPackage, "deployment");
// store new package information
foreach(var role in newAddConfig.Roles.Where(r => r.Name == "tangible.HybrisOnAzure.BackOfficeWorkerRole" || r.Name == "tangible.HybrisOnAzure.FrontendWorkerRole"))
foreach(var instance in role.Instances)
{
// remove old package information
instance.Configurations.RemoveAll(c => c.Name == "JavaPackage");
instance.Configurations.Add(new tangible.Azure.AdditionalConfiguration.ConfigurationItem() { Name = "JavaPackage", Value = newJavaPackage });
instance.Configurations.RemoveAll(c => c.Name == "HybrisPackage");
instance.Configurations.Add(new tangible.Azure.AdditionalConfiguration.ConfigurationItem() { Name = "HybrisPackage", Value = newHybrisPackage });
}
}
private AdditionalConfiguration GetNewAdditionalConfiguration()
{
var newConfiguration = new AdditionalConfiguration();
// Arr Configuration
int desiredArrInstanceCount;
if (!int.TryParse(txtArrInstanceCount.Text, out desiredArrInstanceCount))
throw new Exception("Cannot parse ARR instance count");
var arrRole = new tangible.Azure.AdditionalConfiguration.Role() { Name = "tangible.HybrisOnAzure.ArrRole", DesiredInstanceCount = desiredArrInstanceCount };
newConfiguration.Roles.Add(arrRole);
// default configuration
var arrDefaultConfig = new tangible.Azure.AdditionalConfiguration.Instance() { Id = "default" };
arrRole.Instances.Add(arrDefaultConfig);
arrDefaultConfig.Configurations.Add(new tangible.Azure.AdditionalConfiguration.ConfigurationItem() { Name = "IsInMaintenance", Value = "False" });
// instance configuration
if (RoleEnvironment.IsAvailable)
foreach (var arrInstance in RoleEnvironment.Roles["tangible.HybrisOnAzure.ArrRole"].Instances)
{
var arrInstanceConfig = new tangible.Azure.AdditionalConfiguration.Instance() { Id = arrInstance.Id };
arrRole.Instances.Add(arrInstanceConfig);
var setMaintenance = Page.FindControl("chkMaintenance_" + arrInstance.Id) as CheckBox;
if (setMaintenance != null)
arrInstanceConfig.Configurations.Add(new tangible.Azure.AdditionalConfiguration.ConfigurationItem() { Name = "IsInMaintenance", Value = setMaintenance.Checked.ToString() });
}
// Frontend Worker Instances
int desiredFrontendInstanceCount;
if (!int.TryParse(txtArrInstanceCount.Text, out desiredFrontendInstanceCount))
throw new Exception("Cannot parse FrontendWorker instance count");
var frontendRole = new tangible.Azure.AdditionalConfiguration.Role() { Name = "tangible.HybrisOnAzure.FrontendWorkerRole", DesiredInstanceCount = desiredFrontendInstanceCount };
newConfiguration.Roles.Add(frontendRole);
// defaultConfiguration
var frontendDefaultConfig = new tangible.Azure.AdditionalConfiguration.Instance() { Id = "default" };
frontendRole.Instances.Add(frontendDefaultConfig);
frontendDefaultConfig.Configurations.Add(new tangible.Azure.AdditionalConfiguration.ConfigurationItem() { Name = "StopHybris", Value = "False" });
frontendDefaultConfig.Configurations.Add(new tangible.Azure.AdditionalConfiguration.ConfigurationItem() { Name = "Reboot", Value = String.Empty });
// instance configuration
if (RoleEnvironment.IsAvailable && RoleEnvironment.Roles.ContainsKey("tangible.HybrisOnAzure.FrontendWorkerRole"))
foreach (var frontendInstance in RoleEnvironment.Roles["tangible.HybrisOnAzure.FrontendWorkerRole"].Instances)
{
var frontendInstanceConfig = new tangible.Azure.AdditionalConfiguration.Instance() { Id = frontendInstance.Id };
frontendRole.Instances.Add(frontendInstanceConfig);
var stopHybris = Page.FindControl("chkStopHybris_" + frontendInstance.Id) as CheckBox;
if (stopHybris != null)
frontendInstanceConfig.Configurations.Add(new tangible.Azure.AdditionalConfiguration.ConfigurationItem() { Name = "StopHybris", Value = stopHybris.Checked.ToString() });
var reboot = Page.FindControl("chkReboot_" + frontendInstance.Id) as CheckBox;
if (reboot != null)
frontendInstanceConfig.Configurations.Add(new tangible.Azure.AdditionalConfiguration.ConfigurationItem() { Name = "Reboot", Value = (reboot.Checked) ? newConfiguration.Timestamp.ToString() : string.Empty });
}
// BackOffice Worker Instances
var backOfficeRole = new tangible.Azure.AdditionalConfiguration.Role() { Name = "tangible.HybrisOnAzure.BackOfficeWorkerRole" };
newConfiguration.Roles.Add(backOfficeRole);
// defaultConfiguration
var backOfficeDefaultConfig = new tangible.Azure.AdditionalConfiguration.Instance() { Id = "default" };
backOfficeRole.Instances.Add(frontendDefaultConfig);
backOfficeDefaultConfig.Configurations.Add(new tangible.Azure.AdditionalConfiguration.ConfigurationItem() { Name = "StopHybris", Value = "False" });
backOfficeDefaultConfig.Configurations.Add(new tangible.Azure.AdditionalConfiguration.ConfigurationItem() { Name = "Reboot", Value = String.Empty });
// instance configuration
if (RoleEnvironment.IsAvailable && RoleEnvironment.Roles.ContainsKey("tangible.HybrisOnAzure.BackOfficeWorkerRole"))
foreach (var backOfficeInstance in RoleEnvironment.Roles["tangible.HybrisOnAzure.BackOfficeWorkerRole"].Instances)
{
var backOfficeInstanceConfig = new tangible.Azure.AdditionalConfiguration.Instance() { Id = backOfficeInstance.Id };
backOfficeRole.Instances.Add(backOfficeInstanceConfig);
var stopHybris = Page.FindControl("chkStopHybris_" + backOfficeInstance.Id) as CheckBox;
if (stopHybris != null)
backOfficeInstanceConfig.Configurations.Add(new tangible.Azure.AdditionalConfiguration.ConfigurationItem() { Name = "StopHybris", Value = stopHybris.Checked.ToString() });
var reboot = Page.FindControl("chkReboot_" + backOfficeInstance.Id) as CheckBox;
if (reboot != null)
backOfficeInstanceConfig.Configurations.Add(new tangible.Azure.AdditionalConfiguration.ConfigurationItem() { Name = "Reboot", Value = (reboot.Checked) ? newConfiguration.Timestamp.ToString() : string.Empty });
}
return newConfiguration;
}
private tangible.Azure.AdditionalConfiguration.AdditionalConfiguration GetAdditionalConfiguration()
{
var deploymentSlot = RoleEnvironment.GetConfigurationSettingValue("HybrisOnAzure.DeploymentSlot");
var subscriptionId = RoleEnvironment.GetConfigurationSettingValue("HybrisOnAzure.SubscriptionId");
var managementThumb = RoleEnvironment.GetConfigurationSettingValue("HybrisOnAzure.ManagementCertThumb");
var hostedServiceName = RoleEnvironment.GetConfigurationSettingValue("HybrisOnAzure.HostedServiceName");
var deployment = GetDeployment(subscriptionId, hostedServiceName, deploymentSlot, managementThumb);
var clearConfig = System.Text.Encoding.UTF8.GetString(System.Convert.FromBase64String(deployment.Configuration));
var xConfig = XElement.Parse(clearConfig);
var additionalConfigFileAndContainer = xConfig.Descendants(nsConfig + "Setting").FirstOrDefault(elem => elem.Attribute("name") != null && elem.Attribute("name").Value == "tangible.Azure.AdditionalConfiguration").Attribute("value").Value;
CloudStorageAccount storageAccount;
if (!RoleEnvironment.IsAvailable)
storageAccount = CloudStorageAccount.Parse("UseDevelopmentStorage=true;");
else
storageAccount = CloudStorageAccount.Parse(RoleEnvironment.GetConfigurationSettingValue("StorageConnectionString"));
var blobClient = storageAccount.CreateCloudBlobClient();
var blob = blobClient.GetBlobReference(additionalConfigFileAndContainer);
using(var ms = new MemoryStream())
{
blob.DownloadToStream(ms);
ms.Position = 0;
var serializer = new XmlSerializer(typeof(tangible.Azure.AdditionalConfiguration.AdditionalConfiguration));
return serializer.Deserialize(ms) as tangible.Azure.AdditionalConfiguration.AdditionalConfiguration;
}
}
private string UploadAdditionalConfiguration(tangible.Azure.AdditionalConfiguration.AdditionalConfiguration configuration)
{
var fileName = "config/" + configuration.Timestamp.ToString("yyyy-MM-dd_HH-mm-ss") + ".xml";
CloudStorageAccount storageAccount;
if (!RoleEnvironment.IsAvailable)
storageAccount = CloudStorageAccount.Parse("UseDevelopmentStorage=true;");
else
storageAccount = CloudStorageAccount.Parse(RoleEnvironment.GetConfigurationSettingValue("StorageConnectionString"));
var blobClient = storageAccount.CreateCloudBlobClient();
var blob = blobClient.GetBlockBlobReference(fileName, true);
using (var ms = new MemoryStream())
{
// create a serializer
var serializer = new System.Xml.Serialization.XmlSerializer(typeof(tangible.Azure.AdditionalConfiguration.AdditionalConfiguration));
serializer.Serialize(ms, configuration);
ms.Position = 0;
blob.UploadFromStream(ms);
}
return fileName;
}
XNamespace nsConfig = "http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceConfiguration";
private tangible.Azure.Management.Model.Deployment GetDeployment(string subscriptionId, string hostedServiceName, string deploymentSlot, string managementThumb)
{
var subscription = new tangible.Azure.Management.Model.Subscription() { Id = subscriptionId, ManagementCertificateThumbprint = managementThumb };
var cloudService = subscription.HostedServices.FirstOrDefault(hs => hs.ServiceName == hostedServiceName);
return (deploymentSlot.ToLower() == "production") ? cloudService.Production : cloudService.Staging;
}
private void SetInstanceCount(XElement xConfig, string roleName, int instanceCount)
{
var xRole = xConfig.Descendants(nsConfig + "Role").FirstOrDefault(elem => elem.Attribute("name") != null && elem.Attribute("name").Value == roleName);
var xInstances = xRole.Descendants(nsConfig + "Instances").FirstOrDefault();
xInstances.Attribute("count").Value = instanceCount.ToString();
}
private void SetAdditionalConfigFile(XElement xConfig, string p)
{
foreach(var xRole in xConfig.Descendants(nsConfig + "Role"))
{
var xSetting = xRole.Descendants(nsConfig + "Setting").FirstOrDefault(elem => elem.Attribute("name") != null && elem.Attribute("name").Value == "tangible.Azure.AdditionalConfiguration");
xSetting.Attribute("value").Value = p;
}
}
private void SetConfiguration(tangible.Azure.Management.Model.Deployment deployment, XElement xConfig)
{
new tangible.Azure.Management.Api.HostedServicesApi().SetConfiguation(xConfig, deployment.DeploymentSlot, deployment.HostedService.ServiceName, deployment.HostedService.Subscription.Id, deployment.HostedService.Subscription.ManagementCertificateThumbprint);
}
}
}

Просмотреть файл

@ -0,0 +1,123 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace MicrosoftDXGermany.hybrisOnAzure.BackOfficeWorkerRole {
public partial class Admin {
/// <summary>
/// form1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// tblArr control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Table tblArr;
/// <summary>
/// txtArrInstanceCount control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txtArrInstanceCount;
/// <summary>
/// tblFrontend control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Table tblFrontend;
/// <summary>
/// txtFrontendInstanceCount control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txtFrontendInstanceCount;
/// <summary>
/// tblBackOffice control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Table tblBackOffice;
/// <summary>
/// txtJavaPackage control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txtJavaPackage;
/// <summary>
/// txtHybrisPackage control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txtHybrisPackage;
/// <summary>
/// txtUserName control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txtUserName;
/// <summary>
/// cmdSubmit control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Button cmdSubmit;
/// <summary>
/// lblMessage control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Label lblMessage;
/// <summary>
/// tblDeploymentHistory control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Table tblDeploymentHistory;
}
}

Просмотреть файл

@ -0,0 +1,210 @@
// Microsoft Deployment Accelerator for hybris on Azure - sample code
// Copyright (c) Microsoft Corporation
// see LICENSE.txt for license information
using Microsoft.WindowsAzure.ServiceRuntime;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using tangible.Azure.AdditionalConfiguration;
using tangible.Azure.Base;
using tangible.Azure.Downloader;
using tangible.Azure.IIS;
using tangible.Azure.StartupScripts;
using tangible.Azure.Tracing;
namespace MicrosoftDXGermany.hybrisOnAzure.BackOfficeWorkerRole
{
public class BackOfficeWorkerServer : AzureComponentBase
{
static string TRACESOURCE = "BackOfficeWorkerServer";
public override bool BeforeOnStart()
{
var onStartSuccessful = true;
System.Net.ServicePointManager.DefaultConnectionLimit = 64;
#region create plugins
if (!this.ActivePlugins.Any(p => p.GetType() == typeof(Plugins.HybrisPlugin)))
this.AddPlugin<Plugins.HybrisPlugin>(null);
else
{
Trace.TraceAndLogWarning(TRACESOURCE, "Before on Start called with a running HybrisPlugin. Sending stop...");
try
{
this.ActivePlugins.First(p => p.GetType() == typeof(Plugins.HybrisPlugin)).SendStop();
Trace.TraceAndLogInformation(TRACESOURCE, "Successfully stopped HybrisPlugin in BeforeOnStart.");
}
catch (Exception ex)
{
Trace.TraceAndLogError(TRACESOURCE, "Error stopping HybrisPlugin in BeforeOnStart. Error: " + ex.ToString());
}
}
try
{
bool startSolr = false;
if (!bool.TryParse(RoleEnvironment.GetConfigurationSettingValue("HybrisOnAzure.StartSolrPlugin"), out startSolr))
Trace.TraceAndLogError(TRACESOURCE, "ERROR: Could not parse 'HybrisOnAzure.StartSolrPlugin' configuration.");
if (startSolr && !this.ActivePlugins.Any(p => p.GetType() == typeof(Plugins.SolrPlugin)))
this.AddPlugin<Plugins.SolrPlugin>(null);
else if (this.ActivePlugins.Any(p => p.GetType() == typeof(Plugins.SolrPlugin)))
{
Trace.TraceAndLogWarning(TRACESOURCE, "Before on Start called with a running SolrPlugin. Sending stop...");
try
{
this.ActivePlugins.First(p => p.GetType() == typeof(Plugins.SolrPlugin)).SendStop();
Trace.TraceAndLogInformation(TRACESOURCE, "Successfully stopped SolrPlugin in BeforeOnStart.");
}
catch (Exception ex)
{
Trace.TraceAndLogError(TRACESOURCE, "Error stopping SolrPlugin in BeforeOnStart. Error: " + ex.ToString());
}
if (!startSolr)
{
Trace.TraceAndLogInformation(TRACESOURCE, "Removing SolrPlugin.");
this.RemovePlugin(this.ActivePlugins.First(p => p.GetType() == typeof(Plugins.SolrPlugin)));
}
}
}
catch(Exception ex)
{
Trace.TraceAndLogError(TRACESOURCE, "Error creating SolrPlugin in BeforeOnStart. Error: " + ex.ToString());
}
#endregion
#region CLEANUP
try
{
var rootDirectory = RoleEnvironment.GetConfigurationSettingValue("HybrisOnAzure.BaseDirectory");
Trace.TraceInformation(TRACESOURCE + " OnStart - cleanup old files from '{0}'.", rootDirectory);
if (System.IO.Directory.Exists(rootDirectory))
{
Trace.TraceInformation(TRACESOURCE + " OnStart - '{0}' exists > delete.", rootDirectory);
System.IO.Directory.Delete(rootDirectory, true);
if (System.IO.Directory.Exists(rootDirectory))
Trace.TraceError(TRACESOURCE + " OnStart -'{0}' successfully deleted but still exists!.", rootDirectory);
else
Trace.TraceInformation(TRACESOURCE + " OnStart - '{0}' successfully deleted.", rootDirectory);
}
else
Trace.TraceInformation(TRACESOURCE + " OnStart - '{0}' does not exist.", rootDirectory);
}
catch(Exception ex)
{
Trace.TraceAndLogError(TRACESOURCE, "OnStart - error at Cleanup old files: " + ex.ToString());
}
#endregion
#region Download stuff from storage
// download files from storage to this computer
try
{
Trace.TraceInformation(TRACESOURCE + ": BeforeOnStart: Starting DownloadHelper.");
DownloadHelper.Download();
}
catch (Exception ex)
{
Trace.TraceAndLogError(TRACESOURCE, "BeforeOnStart: ERROR while executing DownloadHelper. Message: " + ex.Message);
onStartSuccessful = false;
}
#endregion
#region PatchFiles
// patch files
try
{
Trace.TraceInformation(TRACESOURCE + ": BeforeOnStart: Starting PatchFiles.");
PatchFileHelper.PatchAllFilesFromConfig();
}
catch (Exception ex)
{
Trace.TraceAndLogError(TRACESOURCE, "BeforeOnStart: ERROR while executing PatchFileHelper. Message: " + ex.Message, ex);
onStartSuccessful = false;
}
#endregion
#region Run Commandlets
// execute setup via configurable commandlets.
try
{
Trace.TraceInformation(TRACESOURCE + ": BeforeOnStart: Starting SetupHelper.");
new StartupScriptHelper().ExecuteScripts();
}
catch (Exception ex)
{
Trace.TraceAndLogError(TRACESOURCE, "BeforeOnStart: ERROR while executing SetupHelper. Message: " + ex.Message, ex);
onStartSuccessful = false;
}
#endregion
#region hadle additional changes
AdditionalConfigurationManager.Instance.AdditionalConfigurationChanged += AdditionalConfiguration_Changed;
try
{
AdditionalConfigurationManager.Instance.ProcessConfiguration();
}
catch (Exception ex)
{
Trace.TraceAndLogError(TRACESOURCE, "Error processing initial AdditionalConfiguration:" + ex.ToString());
}
#endregion
#region Configure ARR
try
{
Trace.TraceInformation(TRACESOURCE + " - OnStart: Configuring ARR HealthMonitoring.");
onStartSuccessful = (!IISHelper.ConfigureHealthMonitoring()) ? false : onStartSuccessful;
Trace.TraceInformation(TRACESOURCE + " - OnStart: Configure WebFarm");
onStartSuccessful = (!IISHelper.ConfigureWebFarm()) ? false : onStartSuccessful;
}
catch(Exception ex)
{
Trace.TraceAndLogError(TRACESOURCE, " - OnStart: Error configuring IIS: " + ex.ToString());
}
#endregion
#region handle role environment changes
RoleEnvironment.Changed += RoleEnvironment_Changed;
#endregion
return onStartSuccessful;
}
void RoleEnvironment_Changed(object sender, RoleEnvironmentChangedEventArgs e)
{
try
{
// On Topology Changes to the BackendWorkerRole --> Configure AzureWebFarm
if (e.Changes.Any(c => c is RoleEnvironmentTopologyChange))
{
Trace.TraceAndLogInformation(TRACESOURCE + ":TopologyChange", "The topology has changed. Reconfiguring webfarm.");
ClixOnAzure.WebFarmHostManager.ConfigureAzureWebFarm();
Trace.TraceInformation(TRACESOURCE + ":TopologyChange: Azure Web Farm has been reconfigured.");
}
}
catch(Exception ex)
{
Trace.TraceAndLogError(TRACESOURCE, " - RoleEnvironment_Changed: Error Configuring AzureWebfarm: " + ex.ToString());
Trace.EmailTangible(TRACESOURCE, " - RoleEnvironment_Change: Error Configuring AzureWebfarm.", ex);
}
}
void AdditionalConfiguration_Changed(object sender, ConfigurationItemChangedEventArgs e)
{
Trace.TraceInformation(TRACESOURCE + ":AdditionalConfiguration: " + e.Name + " (" + e.ChangeType.ToString() + ")" + " New = " + e.NewValue ?? "NULL" + " | " + "Old = " + e.OldValue ?? "NULL");
// on change of the "Reboot"-Value > Request a role recycle
if (e.Name == "Reboot" && e.ChangeType == ChangeType.Modified && !string.IsNullOrEmpty(e.NewValue))
{
Trace.TraceAndLogWarning(TRACESOURCE, "Additional Change requested reboot.");
//RoleEnvironment.RequestRecycle();
this.OnStop();
System.Diagnostics.Process.Start("shutdown", "/r /t 0");
}
}
}
}

Просмотреть файл

@ -0,0 +1 @@
<%@ WebHandler Language="C#" CodeBehind="GetDeploymentHistory.ashx.cs" Class="tangible.HybrisOnAzure.BackOfficeWorkerRole.GetDeploymentHistory" %>

Просмотреть файл

@ -0,0 +1,64 @@
// Microsoft Deployment Accelerator for hybris on Azure - sample code
// Copyright (c) Microsoft Corporation
// see LICENSE.txt for license information
using Microsoft.WindowsAzure.ServiceRuntime;
using Microsoft.WindowsAzure.Storage;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using tangible.Azure.Storage.Blob;
namespace MicrosoftDXGermany.hybrisOnAzure.BackOfficeWorkerRole
{
/// <summary>
/// Summary description for GetDeploymentHistory
/// </summary>
public class GetDeploymentHistory : IHttpHandler
{
public void ProcessRequest(HttpContext context)
{
if (!context.Request.Params.AllKeys.Contains("deploymentInfo"))
{
context.Response.Write("Parameter missing.");
return;
}
var fileName = "config/" + context.Request.Params["deploymentInfo"];
context.Response.ContentType = "text/xml";
CloudStorageAccount storageAccount;
if (!RoleEnvironment.IsAvailable)
storageAccount = CloudStorageAccount.Parse("UseDevelopmentStorage=true;");
else
storageAccount = CloudStorageAccount.Parse(RoleEnvironment.GetConfigurationSettingValue("StorageConnectionString"));
var blobClient = storageAccount.CreateCloudBlobClient();
if (!blobClient.BlobExists(fileName))
{
context.Response.Write("File does not exist.");
return;
}
try
{
var blob = blobClient.GetBlobReference(fileName);
blob.DownloadToStream(context.Response.OutputStream);
}
catch (Exception ex)
{
context.Response.Write("Error getting file: " + ex.ToString());
}
}
public bool IsReusable
{
get
{
return false;
}
}
}
}

Просмотреть файл

@ -0,0 +1,250 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>
</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{B9C8E96A-2AC7-4EE6-A004-4BFED0456B6B}</ProjectGuid>
<ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>MicrosoftDXGermany.hybrisOnAzure.BackOfficeWorkerRole</RootNamespace>
<AssemblyName>tangible.HybrisOnAzure.BackOfficeWorkerRole</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<UseIISExpress>true</UseIISExpress>
<IISExpressSSLPort />
<IISExpressAnonymousAuthentication />
<IISExpressWindowsAuthentication />
<IISExpressUseClassicPipelineMode />
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
<RestorePackages>true</RestorePackages>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Ionic.Zip, Version=1.9.1.8, Culture=neutral, PublicKeyToken=edbe51ad942a3f5c, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\tangible.HybrisOnAzure.Toolbox.1.0.0\lib\Ionic.Zip.dll</HintPath>
</Reference>
<Reference Include="Microsoft.CSharp" />
<Reference Include="Microsoft.Data.Edm, Version=5.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Data.Edm.5.6.0\lib\net40\Microsoft.Data.Edm.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Data.OData, Version=5.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Data.OData.5.6.0\lib\net40\Microsoft.Data.OData.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Data.Services.Client, Version=5.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Data.Services.Client.5.6.0\lib\net40\Microsoft.Data.Services.Client.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ServiceBus, Version=2.4.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\WindowsAzure.ServiceBus.2.4.2.0\lib\net40-full\Microsoft.ServiceBus.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Web.Administration, Version=7.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\tangible.HybrisOnAzure.Toolbox.1.0.0\lib\Microsoft.Web.Administration.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAzure.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Microsoft.WindowsAzure.ConfigurationManager.2.0.3\lib\net40\Microsoft.WindowsAzure.Configuration.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAzure.Diagnostics, Version=2.4.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
<Reference Include="Microsoft.WindowsAzure.ServiceRuntime, Version=2.4.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
<Reference Include="Microsoft.WindowsAzure.Storage, Version=4.2.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\WindowsAzure.Storage.4.2.1\lib\net40\Microsoft.WindowsAzure.Storage.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Newtonsoft.Json.6.0.3\lib\net40\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="SendGrid.SmtpApi, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\SendGrid.SmtpApiPlus.1.0.1\lib\portable-net4+sl5+wp8+win8+wpa81+monotouch+monoandroid\SendGrid.SmtpApi.dll</HintPath>
</Reference>
<Reference Include="SendGridPlus, Version=3.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\SendGridPlus.4.1\lib\net40\SendGridPlus.dll</HintPath>
</Reference>
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.IO">
<HintPath>..\packages\Microsoft.Bcl.1.1.8\lib\net40\System.IO.dll</HintPath>
</Reference>
<Reference Include="System.Net.Http, Version=2.2.20.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Microsoft.Net.Http.2.2.20\lib\net40\System.Net.Http.dll</HintPath>
</Reference>
<Reference Include="System.Net.Http.Extensions, Version=2.2.20.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Microsoft.Net.Http.2.2.20\lib\net40\System.Net.Http.Extensions.dll</HintPath>
</Reference>
<Reference Include="System.Net.Http.Primitives, Version=2.2.20.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Microsoft.Net.Http.2.2.20\lib\net40\System.Net.Http.Primitives.dll</HintPath>
</Reference>
<Reference Include="System.Net.Http.WebRequest, Version=2.2.20.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Microsoft.Net.Http.2.2.20\lib\net40\System.Net.Http.WebRequest.dll</HintPath>
</Reference>
<Reference Include="System.Runtime">
<HintPath>..\packages\Microsoft.Bcl.1.1.8\lib\net40\System.Runtime.dll</HintPath>
</Reference>
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.ServiceModel" />
<Reference Include="System.Spatial, Version=5.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\System.Spatial.5.6.0\lib\net40\System.Spatial.dll</HintPath>
</Reference>
<Reference Include="System.Threading.Tasks">
<HintPath>..\packages\Microsoft.Bcl.1.1.8\lib\net40\System.Threading.Tasks.dll</HintPath>
</Reference>
<Reference Include="System.Web.DynamicData" />
<Reference Include="System.Web.Entity" />
<Reference Include="System.Web.ApplicationServices" />
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Web.Extensions" />
<Reference Include="System.Drawing" />
<Reference Include="System.Web" />
<Reference Include="System.Xml" />
<Reference Include="System.Configuration" />
<Reference Include="System.Web.Services" />
<Reference Include="System.EnterpriseServices" />
<Reference Include="System.Xml.Linq" />
<Reference Include="tangible.Azure.AdditionalConfiguration, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\tangible.HybrisOnAzure.Toolbox.1.0.0\lib\tangible.Azure.AdditionalConfiguration.dll</HintPath>
</Reference>
<Reference Include="tangible.Azure.Auxiliary, Version=1.0.0.3335, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\tangible.HybrisOnAzure.Toolbox.1.0.0\lib\tangible.Azure.Auxiliary.dll</HintPath>
</Reference>
<Reference Include="tangible.Azure.Base, Version=1.0.0.3276, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\tangible.HybrisOnAzure.Toolbox.1.0.0\lib\tangible.Azure.Base.dll</HintPath>
</Reference>
<Reference Include="tangible.Azure.Downloader, Version=1.0.0.3335, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\tangible.HybrisOnAzure.Toolbox.1.0.0\lib\tangible.Azure.Downloader.dll</HintPath>
</Reference>
<Reference Include="tangible.Azure.IIS, Version=1.0.0.3335, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\tangible.HybrisOnAzure.Toolbox.1.0.0\lib\tangible.Azure.IIS.dll</HintPath>
</Reference>
<Reference Include="tangible.Azure.Management">
<HintPath>..\packages\tangible.HybrisOnAzure.Toolbox.1.0.0\lib\tangible.Azure.Management.dll</HintPath>
</Reference>
<Reference Include="tangible.Azure.StartupScripts, Version=1.0.0.3357, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\tangible.HybrisOnAzure.Toolbox.1.0.0\lib\tangible.Azure.StartupScripts.dll</HintPath>
</Reference>
<Reference Include="tangible.Azure.Storage, Version=1.0.0.3276, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\tangible.HybrisOnAzure.Toolbox.1.0.0\lib\tangible.Azure.Storage.dll</HintPath>
</Reference>
<Reference Include="tangible.Azure.Tracing, Version=1.0.0.3276, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\tangible.HybrisOnAzure.Toolbox.1.0.0\lib\tangible.Azure.Tracing.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Content Include="Admin.aspx" />
<Content Include="GetDeploymentHistory.ashx" />
<Content Include="packages.config" />
<None Include="Web.Debug.config">
<DependentUpon>Web.config</DependentUpon>
</None>
<None Include="Web.Release.config">
<DependentUpon>Web.config</DependentUpon>
</None>
</ItemGroup>
<ItemGroup>
<Content Include="Web.config">
<SubType>Designer</SubType>
</Content>
</ItemGroup>
<ItemGroup>
<Compile Include="Admin.aspx.cs">
<DependentUpon>Admin.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Admin.aspx.designer.cs">
<DependentUpon>Admin.aspx</DependentUpon>
</Compile>
<Compile Include="BackOfficeWorkerServer.cs" />
<Compile Include="GetDeploymentHistory.ashx.cs">
<DependentUpon>GetDeploymentHistory.ashx</DependentUpon>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="WorkerRole.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\MicrosoftDXGermany.hybrisOnAzure.Common\MicrosoftDXGermany.hybrisOnAzure.Common.csproj">
<Project>{b610504c-aff3-4e15-b1c5-5ee1d284f2a1}</Project>
<Name>MicrosoftDXGermany.hybrisOnAzure.Common</Name>
</ProjectReference>
</ItemGroup>
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" Condition="false" />
<ProjectExtensions>
<VisualStudio>
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
<WebProjectProperties>
<UseIIS>True</UseIIS>
<AutoAssignPort>True</AutoAssignPort>
<DevelopmentServerPort>52102</DevelopmentServerPort>
<DevelopmentServerVPath>/</DevelopmentServerVPath>
<IISUrl>http://localhost:52094/</IISUrl>
<NTLMAuthentication>False</NTLMAuthentication>
<UseCustomServer>False</UseCustomServer>
<CustomServerUrl>
</CustomServerUrl>
<SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
</WebProjectProperties>
</FlavorProperties>
</VisualStudio>
</ProjectExtensions>
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
</Target>
<Import Project="..\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets" Condition="Exists('..\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets')" />
<Target Name="EnsureBclBuildImported" BeforeTargets="BeforeBuild" Condition="'$(BclBuildImported)' == ''">
<Error Condition="!Exists('..\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets')" Text="This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=317567." HelpKeyword="BCLBUILD2001" />
<Error Condition="Exists('..\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets')" Text="The build restored NuGet packages. Build the project again to include these packages in the build. For more information, see http://go.microsoft.com/fwlink/?LinkID=317568." HelpKeyword="BCLBUILD2002" />
</Target>
<!-- 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.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

Просмотреть файл

@ -0,0 +1,35 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("tangible.HybrisOnAzure.BackOfficeWorkerRole")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft")]
[assembly: AssemblyProduct("tangible.HybrisOnAzure.BackOfficeWorkerRole")]
[assembly: AssemblyCopyright("Copyright © Microsoft 2014")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("5a4ca91f-b617-44e2-bd41-facc91cf1523")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

Просмотреть файл

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- For more information on using web.config transformation visit http://go.microsoft.com/fwlink/?LinkId=125889 -->
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<!--
In the example below, the "SetAttributes" transform will change the value of
"connectionString" to use "ReleaseSQLServer" only when the "Match" locator
finds an attribute "name" that has a value of "MyDB".
<connectionStrings>
<add name="MyDB"
connectionString="Data Source=ReleaseSQLServer;Initial Catalog=MyReleaseDB;Integrated Security=True"
xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
</connectionStrings>
-->
<system.web>
<!--
In the example below, the "Replace" transform will replace the entire
<customErrors> section of your web.config file.
Note that because there is only one customErrors section under the
<system.web> node, there is no need to use the "xdt:Locator" attribute.
<customErrors defaultRedirect="GenericError.htm"
mode="RemoteOnly" xdt:Transform="Replace">
<error statusCode="500" redirect="InternalError.htm"/>
</customErrors>
-->
</system.web>
</configuration>

Просмотреть файл

@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- For more information on using web.config transformation visit http://go.microsoft.com/fwlink/?LinkId=125889 -->
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<!--
In the example below, the "SetAttributes" transform will change the value of
"connectionString" to use "ReleaseSQLServer" only when the "Match" locator
finds an attribute "name" that has a value of "MyDB".
<connectionStrings>
<add name="MyDB"
connectionString="Data Source=ReleaseSQLServer;Initial Catalog=MyReleaseDB;Integrated Security=True"
xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
</connectionStrings>
-->
<system.web>
<compilation xdt:Transform="RemoveAttributes(debug)" />
<!--
In the example below, the "Replace" transform will replace the entire
<customErrors> section of your web.config file.
Note that because there is only one customErrors section under the
<system.web> node, there is no need to use the "xdt:Locator" attribute.
<customErrors defaultRedirect="GenericError.htm"
mode="RemoteOnly" xdt:Transform="Replace">
<error statusCode="500" redirect="InternalError.htm"/>
</customErrors>
-->
</system.web>
</configuration>

Просмотреть файл

@ -0,0 +1,81 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<system.diagnostics>
<trace>
<listeners>
<add type="Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics, Version=2.4.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" name="AzureDiagnostics">
<filter type="" />
</add>
</listeners>
</trace>
</system.diagnostics>
<system.web>
<compilation debug="true" targetFramework="4.0" />
<httpRuntime />
</system.web>
<system.webServer>
<rewrite>
<rules>
<!-- Rule for admin page -->
<rule name="adminPage" stopProcessing="true" enabled="true">
<match url="^Admin.aspx$" />
<action type="None" />
</rule>
<rule name="deploymentHistory" stopProcessing="true" enabled="true">
<match url="^GetDeploymentHistory.ashx$" />
<action type="None" />
</rule>
<!-- Rule to redirect all traffic to hybris -->
<rule name="hybris" stopProcessing="true">
<match url="(.*)" />
<action type="Rewrite" url="http://localhost:9001/{R:0}" />
</rule>
</rules>
</rewrite>
</system.webServer>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Net.Http" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.2.20.0" newVersion="2.2.20.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<system.serviceModel>
<extensions>
<!-- In this extension section we are introducing all known service bus extensions. User can remove the ones they don't need. -->
<behaviorExtensions>
<add name="connectionStatusBehavior" type="Microsoft.ServiceBus.Configuration.ConnectionStatusElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="transportClientEndpointBehavior" type="Microsoft.ServiceBus.Configuration.TransportClientEndpointBehaviorElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="serviceRegistrySettings" type="Microsoft.ServiceBus.Configuration.ServiceRegistrySettingsElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</behaviorExtensions>
<bindingElementExtensions>
<add name="netMessagingTransport" type="Microsoft.ServiceBus.Messaging.Configuration.NetMessagingTransportExtensionElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="tcpRelayTransport" type="Microsoft.ServiceBus.Configuration.TcpRelayTransportElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="httpRelayTransport" type="Microsoft.ServiceBus.Configuration.HttpRelayTransportElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="httpsRelayTransport" type="Microsoft.ServiceBus.Configuration.HttpsRelayTransportElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="onewayRelayTransport" type="Microsoft.ServiceBus.Configuration.RelayedOnewayTransportElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</bindingElementExtensions>
<bindingExtensions>
<add name="basicHttpRelayBinding" type="Microsoft.ServiceBus.Configuration.BasicHttpRelayBindingCollectionElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="webHttpRelayBinding" type="Microsoft.ServiceBus.Configuration.WebHttpRelayBindingCollectionElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="ws2007HttpRelayBinding" type="Microsoft.ServiceBus.Configuration.WS2007HttpRelayBindingCollectionElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="netTcpRelayBinding" type="Microsoft.ServiceBus.Configuration.NetTcpRelayBindingCollectionElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="netOnewayRelayBinding" type="Microsoft.ServiceBus.Configuration.NetOnewayRelayBindingCollectionElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="netEventRelayBinding" type="Microsoft.ServiceBus.Configuration.NetEventRelayBindingCollectionElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="netMessagingBinding" type="Microsoft.ServiceBus.Messaging.Configuration.NetMessagingBindingCollectionElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</bindingExtensions>
</extensions>
</system.serviceModel><appSettings>
<!-- Service Bus specific app setings for messaging connections -->
<add key="Microsoft.ServiceBus.ConnectionString" value="Endpoint=sb://[your namespace].servicebus.windows.net;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=[your secret]" />
</appSettings></configuration>

Просмотреть файл

@ -0,0 +1,42 @@
// Microsoft Deployment Accelerator for hybris on Azure - sample code
// Copyright (c) Microsoft Corporation
// see LICENSE.txt for license information
using Microsoft.WindowsAzure.ServiceRuntime;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Mail;
using System.Text;
using System.Threading;
using System.Web;
using tangible.Azure.Base;
using tangible.Azure.Tracing;
namespace MicrosoftDXGermany.hybrisOnAzure.BackOfficeWorkerRole
{
public class BackOfficeWorkerRole : AzurePluginHost
{
public BackOfficeWorkerRole()
: base()
{
this.UnhandledException += new UnhandledExceptionEventHandler(BackOfficeWorkerRole_UnhandledException);
}
void BackOfficeWorkerRole_UnhandledException(object sender, UnhandledExceptionEventArgs e)
{
Trace.TraceAndLogError("BackOfficeWorkerRole", "Unhandled exception " + ((e.ExceptionObject != null) ? e.ExceptionObject.ToString() : "No information"));
}
public override bool BeforeOnStart()
{
// Note: (2) We attach also to a local file on disk
if (System.IO.File.Exists("C:\\AzureWorkerRoleLog.txt")) System.IO.File.Delete("C:\\AzureWorkerRoleLog.txt");
System.Diagnostics.Trace.Listeners.Add(new System.Diagnostics.TextWriterTraceListener("C:\\AzureWorkerRoleLog.txt"));
this.AddComponent(new BackOfficeWorkerServer());
return true;
}
}
}

Просмотреть файл

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.Bcl" version="1.1.8" targetFramework="net40" />
<package id="Microsoft.Bcl.Build" version="1.0.14" targetFramework="net40" />
<package id="Microsoft.Data.Edm" version="5.6.0" targetFramework="net40" />
<package id="Microsoft.Data.OData" version="5.6.0" targetFramework="net40" />
<package id="Microsoft.Data.Services.Client" version="5.6.0" targetFramework="net40" />
<package id="Microsoft.Net.Http" version="2.2.20" targetFramework="net40" />
<package id="Microsoft.WindowsAzure.ConfigurationManager" version="2.0.3" targetFramework="net40" />
<package id="Newtonsoft.Json" version="6.0.3" targetFramework="net40" />
<package id="SendGrid.SmtpApiPlus" version="1.0.1" targetFramework="net40" />
<package id="SendGridPlus" version="4.1" targetFramework="net40" />
<package id="System.Spatial" version="5.6.0" targetFramework="net40" />
<package id="tangible.HybrisOnAzure.Toolbox" version="1.0.0" targetFramework="net40" />
<package id="WindowsAzure.ServiceBus" version="2.4.2.0" targetFramework="net40" />
<package id="WindowsAzure.Storage" version="4.2.1" targetFramework="net40" />
</packages>

Просмотреть файл

@ -0,0 +1,191 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{B610504C-AFF3-4E15-B1C5-5EE1D284F2A1}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>MicrosoftDXGermany.hybrisOnAzure.Common</RootNamespace>
<AssemblyName>tangible.HybrisOnAzure.Common</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
<RestorePackages>true</RestorePackages>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Ionic.Zip, Version=1.9.1.8, Culture=neutral, PublicKeyToken=edbe51ad942a3f5c, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\tangible.HybrisOnAzure.Toolbox.1.0.0\lib\Ionic.Zip.dll</HintPath>
</Reference>
<Reference Include="Microsoft.CSharp" />
<Reference Include="Microsoft.Data.Edm, Version=5.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Data.Edm.5.6.0\lib\net40\Microsoft.Data.Edm.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Data.OData, Version=5.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Data.OData.5.6.0\lib\net40\Microsoft.Data.OData.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Data.Services.Client, Version=5.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Data.Services.Client.5.6.0\lib\net40\Microsoft.Data.Services.Client.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ServiceBus, Version=2.4.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\WindowsAzure.ServiceBus.2.4.2.0\lib\net40-full\Microsoft.ServiceBus.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Web.Administration, Version=7.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\tangible.HybrisOnAzure.Toolbox.1.0.0\lib\Microsoft.Web.Administration.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAzure.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Microsoft.WindowsAzure.ConfigurationManager.2.0.3\lib\net40\Microsoft.WindowsAzure.Configuration.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAzure.Diagnostics, Version=2.4.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
<Reference Include="Microsoft.WindowsAzure.ServiceRuntime, Version=2.4.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
<Reference Include="Microsoft.WindowsAzure.Storage, Version=4.2.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\WindowsAzure.Storage.4.2.1\lib\net40\Microsoft.WindowsAzure.Storage.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Newtonsoft.Json.6.0.3\lib\net40\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="SendGrid.SmtpApi, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\SendGrid.SmtpApiPlus.1.0.1\lib\portable-net4+sl5+wp8+win8+wpa81+monotouch+monoandroid\SendGrid.SmtpApi.dll</HintPath>
</Reference>
<Reference Include="SendGridPlus, Version=3.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\SendGridPlus.4.1\lib\net40\SendGridPlus.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.IO">
<HintPath>..\packages\Microsoft.Bcl.1.1.8\lib\net40\System.IO.dll</HintPath>
</Reference>
<Reference Include="System.Net.Http, Version=2.2.20.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Microsoft.Net.Http.2.2.20\lib\net40\System.Net.Http.dll</HintPath>
</Reference>
<Reference Include="System.Net.Http.Extensions, Version=2.2.20.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Microsoft.Net.Http.2.2.20\lib\net40\System.Net.Http.Extensions.dll</HintPath>
</Reference>
<Reference Include="System.Net.Http.Primitives, Version=2.2.20.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Microsoft.Net.Http.2.2.20\lib\net40\System.Net.Http.Primitives.dll</HintPath>
</Reference>
<Reference Include="System.Net.Http.WebRequest, Version=2.2.20.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Microsoft.Net.Http.2.2.20\lib\net40\System.Net.Http.WebRequest.dll</HintPath>
</Reference>
<Reference Include="System.Runtime">
<HintPath>..\packages\Microsoft.Bcl.1.1.8\lib\net40\System.Runtime.dll</HintPath>
</Reference>
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.ServiceModel" />
<Reference Include="System.Spatial, Version=5.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\System.Spatial.5.6.0\lib\net40\System.Spatial.dll</HintPath>
</Reference>
<Reference Include="System.Threading.Tasks">
<HintPath>..\packages\Microsoft.Bcl.1.1.8\lib\net40\System.Threading.Tasks.dll</HintPath>
</Reference>
<Reference Include="System.Xml" />
<Reference Include="tangible.Azure.AdditionalConfiguration, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\tangible.HybrisOnAzure.Toolbox.1.0.0\lib\tangible.Azure.AdditionalConfiguration.dll</HintPath>
</Reference>
<Reference Include="tangible.Azure.Auxiliary, Version=1.0.0.3335, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\tangible.HybrisOnAzure.Toolbox.1.0.0\lib\tangible.Azure.Auxiliary.dll</HintPath>
</Reference>
<Reference Include="tangible.Azure.Base, Version=1.0.0.3276, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\tangible.HybrisOnAzure.Toolbox.1.0.0\lib\tangible.Azure.Base.dll</HintPath>
</Reference>
<Reference Include="tangible.Azure.Downloader, Version=1.0.0.3335, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\tangible.HybrisOnAzure.Toolbox.1.0.0\lib\tangible.Azure.Downloader.dll</HintPath>
</Reference>
<Reference Include="tangible.Azure.IIS, Version=1.0.0.3335, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\tangible.HybrisOnAzure.Toolbox.1.0.0\lib\tangible.Azure.IIS.dll</HintPath>
</Reference>
<Reference Include="tangible.Azure.Management">
<HintPath>..\packages\tangible.HybrisOnAzure.Toolbox.1.0.0\lib\tangible.Azure.Management.dll</HintPath>
</Reference>
<Reference Include="tangible.Azure.StartupScripts, Version=1.0.0.3357, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\tangible.HybrisOnAzure.Toolbox.1.0.0\lib\tangible.Azure.StartupScripts.dll</HintPath>
</Reference>
<Reference Include="tangible.Azure.Storage, Version=1.0.0.3276, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\tangible.HybrisOnAzure.Toolbox.1.0.0\lib\tangible.Azure.Storage.dll</HintPath>
</Reference>
<Reference Include="tangible.Azure.Tracing, Version=1.0.0.3276, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\tangible.HybrisOnAzure.Toolbox.1.0.0\lib\tangible.Azure.Tracing.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Plugins\HybrisPlugin.cs" />
<Compile Include="Plugins\SolrPlugin.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<Folder Include="Resources\" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
</Target>
<Import Project="..\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets" Condition="Exists('..\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets')" />
<Target Name="EnsureBclBuildImported" BeforeTargets="BeforeBuild" Condition="'$(BclBuildImported)' == ''">
<Error Condition="!Exists('..\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets')" Text="This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=317567." HelpKeyword="BCLBUILD2001" />
<Error Condition="Exists('..\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets')" Text="The build restored NuGet packages. Build the project again to include these packages in the build. For more information, see http://go.microsoft.com/fwlink/?LinkID=317568." HelpKeyword="BCLBUILD2002" />
</Target>
<!-- 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.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

Просмотреть файл

@ -0,0 +1,694 @@
// Microsoft Deployment Accelerator for hybris on Azure - sample code
// Copyright (c) Microsoft Corporation
// see LICENSE.txt for license information
using Microsoft.WindowsAzure;
using Microsoft.WindowsAzure.ServiceRuntime;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
using System.Text.RegularExpressions;
using tangible.Azure.Auxiliary.VolumeManagement;
using tangible.Azure.Base;
using tangible.Azure.Tracing;
using tangible.Azure.Auxiliary;
using tangible.Azure.AdditionalConfiguration;
namespace MicrosoftDXGermany.hybrisOnAzure.Plugins
{
public class HybrisPlugin : IAzurePlugin
{
// Path where Hybris has been downloaded to
public static string BaseDirectory = Environment.ExpandEnvironmentVariables(RoleEnvironment.GetConfigurationSettingValue("HybrisOnAzure.BaseDirectory"));
public static string JavaHomeDirectory = Environment.ExpandEnvironmentVariables(RoleEnvironment.GetConfigurationSettingValue("HybrisOnAzure.JavaHomeDirectory"));
public static int JavaProcessShutdownWaitMinutes = int.Parse(RoleEnvironment.GetConfigurationSettingValue("HybrisOnAzure.JavaProcessShutdownWaitMinutes"));
public static bool IsBackOfficeWorker = RoleEnvironment.CurrentRoleInstance.Role.Name.ToLower().Contains("backoffice");
public bool Initialize()
{
Trace.TraceInformation("HybrisPlugin: Initializing.");
this.Status = AzurePluginStatus.Initializing;
this.StatusMessage = string.Empty;
// 1. create necessary directories for usage by hybris
#region Directories
string workBaseDirectory = null;
try
{
workBaseDirectory = RoleEnvironment.GetLocalResource("HybrisOnAzure.WorkBase").RootPath;
}
catch(Exception ex)
{
Trace.TraceAndLogError("HybrisPlugin", "Error initializing: Could not retrieve local resource for workBaseDirectory. " + ex.ToString());
this.Status = AzurePluginStatus.ErrorInitializing;
this.StatusMessage = "Error initializing: Could not retrieve local resource for workBaseDirectory. ";
return false;
}
// a directory for "working" purposes mapped to a drive letter
string workDrive = null;
try
{
Trace.TraceInformation("HybrisPlugin: Initializing work-Drive.");
if (!Directory.Exists(Path.Combine(workBaseDirectory, "work")))
Directory.CreateDirectory(Path.Combine(workBaseDirectory, "work"));
workDrive = DrivePathManager.Map(Path.Combine(workBaseDirectory, "work"), "Work");
if (!workDrive.EndsWith("\\")) workDrive = workDrive + "\\";
Trace.TraceInformation("HybrisPlugin: mapped work directory to " + workDrive);
}
catch(Exception ex)
{
Trace.TraceAndLogError("HybrisPlugin", "Error initializing: Could not map work drive. " + ex.ToString());
this.Status = AzurePluginStatus.ErrorInitializing;
this.StatusMessage = "Error initializing: Could not map work drive.";
return false;
}
// a directory for "temp" purposes mapped to a drive letter
string tempDrive = null;
try
{
Trace.TraceInformation("HybrisPlugin: Initializing temp-Drive.");
if (!Directory.Exists(Path.Combine(workBaseDirectory, "temp")))
Directory.CreateDirectory(Path.Combine(workBaseDirectory, "temp"));
tempDrive = DrivePathManager.Map(Path.Combine(workBaseDirectory, "temp"), "Temp");
if (!tempDrive.EndsWith("\\")) tempDrive = tempDrive + "\\";
Trace.TraceInformation("HybrisPlugin: mapped temp directory to " + tempDrive);
}
catch (Exception ex)
{
Trace.TraceAndLogError("HybrisPlugin", "Error initializing: Could not map temp drive. " + ex.ToString());
this.Status = AzurePluginStatus.ErrorInitializing;
this.StatusMessage = "Error initializing: Could not map temp drive.";
return false;
}
// a directory for "data" purposes mapped to a drive letter
string dataDrive = null;
try
{
Trace.TraceInformation("HybrisPlugin: Initializing data-Drive.");
if (!Directory.Exists(Path.Combine(workBaseDirectory, "data")))
Directory.CreateDirectory(Path.Combine(workBaseDirectory, "data"));
dataDrive = DrivePathManager.Map(Path.Combine(workBaseDirectory, "data"), "Data");
if (!dataDrive.EndsWith("\\")) dataDrive = dataDrive + "\\";
Trace.TraceInformation("HybrisPlugin: mapped data directory to " + dataDrive);
}
catch (Exception ex)
{
Trace.TraceAndLogError("HybrisPlugin", "Error initializing: Could not map data drive. " + ex.ToString());
this.Status = AzurePluginStatus.ErrorInitializing;
this.StatusMessage = "Error initializing: Could not map data drive.";
return false;
}
#endregion
#region Subdirectories for direct use by hybris
Trace.TraceInformation("HybrisPlugin: Initializing subdirectories.");
string hybrisWorkDirectory = null;
string hybrisTempDirectory = null;
string sharedTempDirectory = null;
string hybrisDataDirectory = null;
string hybrisLogsDirectory = null;
try
{
// Work Directory = Z:\hybris
hybrisWorkDirectory = Path.Combine(workDrive, "hybris");
if (!Directory.Exists(hybrisWorkDirectory))
Directory.CreateDirectory(hybrisWorkDirectory);
}
catch (Exception ex)
{
Trace.TraceAndLogError("HybrisPlugin", "Could not create directory " + hybrisWorkDirectory + ": " + ex.ToString());
}
try
{
// Temp Directory = Y:\hybris
hybrisTempDirectory = Path.Combine(tempDrive, "hybris");
if (!Directory.Exists(hybrisTempDirectory))
Directory.CreateDirectory(hybrisTempDirectory);
}
catch (Exception ex)
{
Trace.TraceAndLogError("HybrisPlugin", "Could not create directory " + hybrisTempDirectory + ": " + ex.ToString());
}
try
{
// Shared Temp Directory = Y:\shared
sharedTempDirectory = Path.Combine(tempDrive, "shared");
if (!Directory.Exists(sharedTempDirectory))
Directory.CreateDirectory(sharedTempDirectory);
}
catch (Exception ex)
{
Trace.TraceAndLogError("HybrisPlugin", "Could not create directory " + sharedTempDirectory + ": " + ex.ToString());
}
try
{
// Data Directory = S:\hybris on BackOfficeWorker, X:\hybris otherwise
if (IsBackOfficeWorker)
{
var driveLetter = hybrisDataDirectory = RoleEnvironment.GetConfigurationSettingValue("HybrisOnAzure.BackOfficeShare.DesiredDrive");
if (!driveLetter.EndsWith("\\")) driveLetter = driveLetter + "\\";
hybrisDataDirectory = Path.Combine(driveLetter, "hybris");
}
else
hybrisDataDirectory = Path.Combine(dataDrive, "hybris");
if (!Directory.Exists(hybrisDataDirectory))
Directory.CreateDirectory(hybrisDataDirectory);
}
catch (Exception ex)
{
Trace.TraceAndLogError("HybrisPlugin", "Could not create directory " + hybrisDataDirectory + ": " + ex.ToString());
}
try
{
// Logs Directory = X:\Logs\hybris
hybrisLogsDirectory = Path.Combine(dataDrive, "logs", "hybris");
if (!Directory.Exists(hybrisLogsDirectory))
Directory.CreateDirectory(hybrisLogsDirectory);
}
catch(Exception ex)
{
Trace.TraceAndLogError("HybrisPlugin", "Could not create directory " + hybrisLogsDirectory + ": " + ex.ToString());
}
#endregion
// 2. Build hybris configuration files
#region Calculates instance numbers
string role = "";
string rolenumber = "";
Trace.TraceInformation("HybrisPlugin: Calculate instance numbers.");
try
{
// This will have values like "BackOfficeWorker_IN_0" or "FrontendWorker_IN_0"
string instanceName = RoleEnvironment.CurrentRoleInstance.Id;
if (!string.IsNullOrEmpty(instanceName) && instanceName.Contains('_'))
{
role = instanceName.Split('_').FirstOrDefault();
if (!string.IsNullOrEmpty(role))
{
role = role.ToLower();
}
try
{
int _rolenumber = Convert.ToInt32(instanceName.Split('_').LastOrDefault());
rolenumber = _rolenumber.ToString(CultureInfo.InvariantCulture);
}
catch (FormatException)
{
// do nothing
}
catch (OverflowException)
{
// do nothing
}
}
if (string.IsNullOrEmpty(role))
{
role = "unknown";
}
if (string.IsNullOrEmpty(rolenumber))
{
rolenumber = "0";
}
}
catch(Exception ex)
{
Trace.TraceAndLogError("HybrisPlugin", "Error calculating role numbers: " + ex.Message);
this.Status = AzurePluginStatus.ErrorInitializing;
this.StatusMessage = "Error calculating role numbers";
return false;
}
#endregion
#region local.properties file
// Build hybris configuration user.properties file
Trace.TraceInformation("HybrisPlugin: Updating local.properties file.");
string hybrisRoot = Path.Combine(BaseDirectory, "hybris");
string hybrisWorkingDirectory = Path.Combine(hybrisRoot, "bin", "platform");
try
{
string userPropertiesFile = Path.Combine(hybrisRoot, "config", "local.properties");
string userPropertiesFileContent = System.IO.File.Exists(userPropertiesFile) ? System.IO.File.ReadAllText(userPropertiesFile) : string.Empty;
// Set the tomcat TCP port and binding information
IPEndPoint tomcatHttpIPEndpoint = RoleEnvironment.CurrentRoleInstance.InstanceEndpoints["TomcatHttp"].IPEndpoint;
userPropertiesFileContent = PatchProperty(userPropertiesFileContent, "tomcat.http.listenaddress", tomcatHttpIPEndpoint.Address.ToString());
userPropertiesFileContent = PatchProperty(userPropertiesFileContent, "tomcat.http.port", tomcatHttpIPEndpoint.Port.ToString(CultureInfo.InvariantCulture));
IPEndPoint tomcatHttpsIPEndpoint = RoleEnvironment.CurrentRoleInstance.InstanceEndpoints["TomcatHttps"].IPEndpoint;
userPropertiesFileContent = PatchProperty(userPropertiesFileContent, "tomcat.https.listenaddress", tomcatHttpsIPEndpoint.Address.ToString());
userPropertiesFileContent = PatchProperty(userPropertiesFileContent, "tomcat.https.port", tomcatHttpsIPEndpoint.Port.ToString(CultureInfo.InvariantCulture));
// Set the JGroups TCP port and binding information
IPEndPoint invalidationIPEndpoint = RoleEnvironment.CurrentRoleInstance.InstanceEndpoints["InvalidateJGroup"].IPEndpoint;
userPropertiesFileContent = PatchProperty(userPropertiesFileContent, "cluster.broadcast.method.jgroups.tcp.bind_addr", invalidationIPEndpoint.Address.ToString());
userPropertiesFileContent = PatchProperty(userPropertiesFileContent, "cluster.broadcast.method.jgroups.tcp.bind_port", invalidationIPEndpoint.Port.ToString(CultureInfo.InvariantCulture));
// Set the cluster id and node id
// For a FrontendWorker, the cluster ID is calculated based on its IP Address (whilst the BackOfficeWorker has the ClusterId 0)
// See FrontendHybrisPlugin.cs Line 111
IPAddress managementEndpointAddress = RoleEnvironment.CurrentRoleInstance.InstanceEndpoints["Management"].IPEndpoint.Address;
byte[] addressBytes = managementEndpointAddress.GetAddressBytes();
int clusterId = IsBackOfficeWorker ? 0 : addressBytes[addressBytes.Length - 1];
userPropertiesFileContent = PatchProperty(userPropertiesFileContent, "cluster.maxid", "256");
userPropertiesFileContent = PatchProperty(userPropertiesFileContent, "cluster.id", clusterId.ToString(CultureInfo.InvariantCulture));
userPropertiesFileContent = PatchProperty(userPropertiesFileContent, "node.id", clusterId.ToString(CultureInfo.InvariantCulture));
// Change media.default.url.strategy when being on backoffice worker
if (RoleEnvironment.CurrentRoleInstance.Role.Name.ToLower().Contains("backoffice"))
{
//userPropertiesFileContent = PatchProperty(userPropertiesFileContent, "media.default.url.strategy", "windowsAzureBlobURLStrategy");
}
// Update work path settings
userPropertiesFileContent = userPropertiesFileContent.Replace(@"{instanceworkdir}", hybrisWorkDirectory.Replace(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar)); // INFO: Was instanceWorkDirectory
userPropertiesFileContent = userPropertiesFileContent.Replace(@"{workdir}", hybrisWorkDirectory.Replace(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar));
userPropertiesFileContent = userPropertiesFileContent.Replace(@"{logsdir}", hybrisLogsDirectory.Replace(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar));
userPropertiesFileContent = userPropertiesFileContent.Replace(@"{datadir}", hybrisDataDirectory.Replace(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar));
userPropertiesFileContent = userPropertiesFileContent.Replace(@"{tempdir}", hybrisTempDirectory.Replace(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar));
// Update the user.properties file
File.WriteAllText(userPropertiesFile, userPropertiesFileContent);
}
catch(Exception ex)
{
Trace.TraceAndLogError("HybrisPlugin", "Error creating user.properties file: " + ex.ToString());
this.Status = AzurePluginStatus.ErrorInitializing;
this.StatusMessage = "Error creating user.properties file";
return false;
}
#endregion
// 3. Create hybris commands
#region build command
// Read the standard PATH environment variable
string searchPath = Environment.GetEnvironmentVariable("path", EnvironmentVariableTarget.Machine);
string hybrisBuildCommandFileName = Path.Combine(hybrisWorkingDirectory, "hybris-build.cmd");
try
{
Trace.TraceInformation("HybrisPlugin: Create hybris build command.");
// Build hybris build command
var hybrisBuildCommandBuilder = new StringBuilder();
hybrisBuildCommandBuilder.AppendLine(@"@echo off");
hybrisBuildCommandBuilder.AppendLine(@"set path=" + Path.Combine(JavaHomeDirectory, @"bin") + ";" + searchPath);
hybrisBuildCommandBuilder.AppendLine(@"set java_home=" + JavaHomeDirectory);
hybrisBuildCommandBuilder.AppendLine(@"set temp=" + sharedTempDirectory);
hybrisBuildCommandBuilder.AppendLine(@"set tmp=" + sharedTempDirectory);
hybrisBuildCommandBuilder.AppendLine();
hybrisBuildCommandBuilder.AppendLine(@"set HYBRIS_DATA_DIR=" + hybrisDataDirectory);
hybrisBuildCommandBuilder.AppendLine(@"set HYBRIS_TEMP_DIR=" + hybrisTempDirectory);
hybrisBuildCommandBuilder.AppendLine(@"set HYBRIS_WORK_DIR=" + hybrisWorkDirectory);
hybrisBuildCommandBuilder.AppendLine(@"set HYBRIS_LOG_DIR=" + hybrisLogsDirectory);
hybrisBuildCommandBuilder.AppendLine(@"set HYBRIS_LOGS_DIR=" + hybrisLogsDirectory);
hybrisBuildCommandBuilder.AppendLine();
hybrisBuildCommandBuilder.AppendLine(@"cd " + hybrisWorkingDirectory);
hybrisBuildCommandBuilder.AppendLine(@"call setantenv.bat");
hybrisBuildCommandBuilder.AppendLine();
//hybrisBuildCommandBuilder.AppendLine(@"cd " + Path.Combine(hybrisWorkingDirectory, @"..\..\build"));
//hybrisBuildCommandBuilder.AppendLine(@"call ant config -Denv=" + DeploymentName + " -Drole=" + RoleName + " -Drolenumber=" + rolenumber);
//hybrisBuildCommandBuilder.AppendLine();
//hybrisBuildCommandBuilder.AppendLine(@"cd " + hybrisWorkingDirectory);
hybrisBuildCommandBuilder.AppendLine(@"call ant");
File.WriteAllText(hybrisBuildCommandFileName, hybrisBuildCommandBuilder.ToString());
}
catch(Exception ex)
{
Trace.TraceAndLogError("HybrisPlugin", "Error creating hybris build command: " + ex.ToString());
this.Status = AzurePluginStatus.ErrorInitializing;
this.StatusMessage = "Error creating hybris build command";
return false;
}
#endregion
#region start command
// Build hybris start command
string hybrisStartCommandFileName = Path.Combine(hybrisWorkingDirectory, "hybris-start.cmd");
try
{
Trace.TraceInformation("HybrisPlugin: Generate hybris start command");
var hybrisStartCommandBuilder = new StringBuilder();
hybrisStartCommandBuilder.AppendLine(@"@echo off");
hybrisStartCommandBuilder.AppendLine(@"set path=" + Path.Combine(JavaHomeDirectory, @"bin") + ";" + searchPath);
hybrisStartCommandBuilder.AppendLine(@"set java_home=" + JavaHomeDirectory);
hybrisStartCommandBuilder.AppendLine(@"set temp=" + sharedTempDirectory);
hybrisStartCommandBuilder.AppendLine(@"set tmp=" + sharedTempDirectory);
hybrisStartCommandBuilder.AppendLine();
hybrisStartCommandBuilder.AppendLine(@"set HYBRIS_DATA_DIR=" + hybrisDataDirectory);
hybrisStartCommandBuilder.AppendLine(@"set HYBRIS_TEMP_DIR=" + hybrisTempDirectory);
hybrisStartCommandBuilder.AppendLine(@"set HYBRIS_WORK_DIR=" + hybrisWorkDirectory);
hybrisStartCommandBuilder.AppendLine(@"set HYBRIS_LOG_DIR=" + hybrisLogsDirectory);
hybrisStartCommandBuilder.AppendLine(@"set HYBRIS_LOGS_DIR=" + hybrisLogsDirectory);
hybrisStartCommandBuilder.AppendLine();
hybrisStartCommandBuilder.AppendLine(@"cd " + hybrisWorkingDirectory);
hybrisStartCommandBuilder.AppendLine(@"call setantenv.bat");
hybrisStartCommandBuilder.AppendLine(@"call hybrisserver.bat");
File.WriteAllText(hybrisStartCommandFileName, hybrisStartCommandBuilder.ToString());
}
catch (Exception ex)
{
Trace.TraceAndLogError("HybrisPlugin", "Error creating hybris start command: " + ex.ToString());
this.Status = AzurePluginStatus.ErrorInitializing;
this.StatusMessage = "Error creating hybris start command";
return false;
}
#endregion
#region stop command
// Build hybris stop command
string hybrisStopCommandFileName = Path.Combine(hybrisWorkingDirectory, "hybris-stop.cmd");
try
{
Trace.TraceInformation("HybrisPlugin: Generating hybris stop command");
var hybrisStopCommandBuilder = new StringBuilder();
hybrisStopCommandBuilder.AppendLine(@"@echo off");
hybrisStopCommandBuilder.AppendLine(@"set path=" + Path.Combine(JavaHomeDirectory, @"bin") + ";" + searchPath);
hybrisStopCommandBuilder.AppendLine(@"set java_home=" + JavaHomeDirectory);
hybrisStopCommandBuilder.AppendLine(@"set temp=" + sharedTempDirectory);
hybrisStopCommandBuilder.AppendLine(@"set tmp=" + sharedTempDirectory);
hybrisStopCommandBuilder.AppendLine();
hybrisStopCommandBuilder.AppendLine(@"set HYBRIS_DATA_DIR=" + hybrisDataDirectory);
hybrisStopCommandBuilder.AppendLine(@"set HYBRIS_TEMP_DIR=" + hybrisTempDirectory);
hybrisStopCommandBuilder.AppendLine(@"set HYBRIS_WORK_DIR=" + hybrisWorkDirectory);
hybrisStopCommandBuilder.AppendLine(@"set HYBRIS_LOG_DIR=" + hybrisLogsDirectory);
hybrisStopCommandBuilder.AppendLine(@"set HYBRIS_LOGS_DIR=" + hybrisLogsDirectory);
hybrisStopCommandBuilder.AppendLine();
hybrisStopCommandBuilder.AppendLine(@"cd " + hybrisWorkingDirectory);
hybrisStopCommandBuilder.AppendLine(@"java -jar StopTanukiWrapper.jar");
File.WriteAllText(hybrisStopCommandFileName, hybrisStopCommandBuilder.ToString());
}
catch (Exception ex)
{
Trace.TraceAndLogError("HybrisPlugin", "Error creating hybris stop command: " + ex.ToString());
this.Status = AzurePluginStatus.ErrorInitializing;
this.StatusMessage = "Error creating hybris stop command";
return false;
}
#endregion
// 4. TanukiWrapper
#region Tanuki wrapper
//Trace.TraceInformation("HybrisPlugin: Installing StopTanukiWrapper.jar");
//try
//{
// // Save the required StopTanukiWrapper.jar file in the platform directory
// string stopTanukiWrapperFileName = Path.Combine(hybrisWorkingDirectory, "StopTanukiWrapper.jar");
// File.WriteAllBytes(stopTanukiWrapperFileName, hybrisOnAzure.Common.Properties.Resources.StopTanukiWrapper);
//}
//catch(Exception ex)
//{
// Trace.TraceAndLogError("HybrisPlugin", "Error installing StopTanukiWrapper.jar: " + ex.ToString());
// this.Status = AzurePluginStatus.ErrorInitializing;
// this.StatusMessage = "Error installing StopTanukiWrapper.jar";
// return false;
//}
#endregion
// 5. actually build the hybris platform
#region Build hybris
// Build hybris platform
Trace.TraceInformation("HybrisPlugin: Building hybris platform.");
try
{
var buildOutput = new StringBuilder();
var buildError = new StringBuilder();
using (var buildProcess = new System.Diagnostics.Process
{
StartInfo = new System.Diagnostics.ProcessStartInfo
{
WorkingDirectory = hybrisWorkingDirectory,
FileName = hybrisBuildCommandFileName,
Arguments = string.Empty,
UseShellExecute = false,
LoadUserProfile = false,
RedirectStandardOutput = true,
RedirectStandardError = true,
RedirectStandardInput = true,
CreateNoWindow = true,
WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden,
},
EnableRaisingEvents = true,
})
{
buildProcess.OutputDataReceived += (s, a) => Trace.TraceVerbose("HybrisPlugin: Building hybris ouput line" + a.Data);
buildProcess.ErrorDataReceived += (s, a) => Trace.TraceAndLogError("HybrisPlugin", "Building hybris error line" + a.Data);
if (buildProcess.Start())
{
buildProcess.BeginOutputReadLine();
buildProcess.BeginErrorReadLine();
buildProcess.WaitForExit();
}
if (buildProcess.ExitCode == 0)
Trace.TraceAndLogInformation("HybrisPlugin", "Successfully built hybris platform.");
else
Trace.TraceAndLogError("HybrisPlugin", "Error executing build hybris platform command.");
}
}
catch(Exception ex)
{
Trace.TraceAndLogError("Hybris", "Error building hybris platform. " + ex.ToString());
this.Status = AzurePluginStatus.ErrorInitializing;
this.StatusMessage = "Error building hybris platform.";
return false;
}
#endregion
// 6. Get from additional settings if we may start the hybris process
#region Additional configuration
AdditionalConfigurationManager.Instance.AdditionalConfigurationChanged += Instance_AdditionalConfigurationChanged;
try
{
Trace.TraceInformation("HybrisPlugin: Processing initial additional configuration.");
AdditionalConfigurationManager.Instance.ProcessConfiguration();
Trace.TraceInformation("HybrisPlugin: Successfully processed initial additional configuration.");
}
catch(Exception ex)
{
Trace.TraceAndLogError("HybrisPlugin", "Error processing initial additional configuration: " + ex.ToString());
}
try
{
Trace.TraceInformation("HybrisPlugin", "Determining if Hybris was stopped before a reboot.");
var stopHybris = AdditionalConfigurationManager.Instance.GetCurrentConfigurationValue("StopHybris");
if (stopHybris == null)
Trace.TraceAndLogWarning("HybrisPlugin", "Determining if Hybris was stopped before a reboot resulted in a NULL value. Hybris will be started.");
else
{
Trace.TraceInformation("HybrisPlugin: Determining if Hybris was stopped before a reboot resulted in: " + stopHybris);
this.ConfigStopHybris = bool.Parse(stopHybris);
}
}
catch (Exception ex)
{
Trace.TraceAndLogError("HybrisPlugin", "Error getting from Additional configuration if processes are to be started: " + ex.ToString());
this.Status = AzurePluginStatus.ErrorInitializing;
this.StatusMessage = "Error getting Additional configuration";
return false;
}
#endregion
Trace.TraceInformation("HybrisPlugin: Initialization done.");
this.Status = AzurePluginStatus.NotStarted;
this.StatusMessage = string.Empty;
return true;
}
private void Instance_AdditionalConfigurationChanged(object sender, ConfigurationItemChangedEventArgs e)
{
if (e.Name == "StopHybris")
{
// this instance is told to change it's maintenance mode
var stringValue = (e.ChangeType == ChangeType.Added | e.ChangeType == ChangeType.Modified) ? e.NewValue : e.OldValue;
bool newValue;
if (bool.TryParse(stringValue, out newValue))
{
Trace.TraceAndLogInformation("HybrisPlugin", "Additional configuration changed value StopHybris to " + newValue.ToString());
// enable or disable the Routing rule to the maintenance page
this.ConfigStopHybris = newValue;
// if hybris has to be stopped > stop hybris
if (newValue && _HybrisJavaProcess != null && !_HybrisJavaProcess.HasExited)
SendStop();
}
}
}
private bool ConfigStopHybris { get; set; }
private System.Diagnostics.Process _HybrisJavaProcess;
public bool IsAlive
{
get
{
// this Plugin is alive as long as the Hybris process is running
// or if the additional configuration says the process should not be running
try
{
return this.ConfigStopHybris || (_HybrisJavaProcess != null && !_HybrisJavaProcess.HasExited);
}
catch
{
return false;
}
}
}
public bool Start()
{
// if hybris is still running we don't need to start again
if (this.IsAlive) return true;
this.Status = AzurePluginStatus.Starting;
this.StatusMessage = string.Empty;
try
{
// Prepare hybris start
string hybrisRoot = Path.Combine(BaseDirectory, "hybris");
string hybrisWorkingDirectory = Path.Combine(hybrisRoot, "bin", "platform");
string hybrisStartCommandFileName = Path.Combine(hybrisWorkingDirectory, "hybris-start.cmd");
// Start hybris process
_HybrisJavaProcess = new System.Diagnostics.Process
{
StartInfo = new System.Diagnostics.ProcessStartInfo
{
WorkingDirectory = hybrisWorkingDirectory,
FileName = hybrisStartCommandFileName,
Arguments = string.Empty,
UseShellExecute = false,
LoadUserProfile = false,
RedirectStandardOutput = true,
RedirectStandardError = true,
RedirectStandardInput = true,
CreateNoWindow = true,
WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden,
},
EnableRaisingEvents = true,
};
_HybrisJavaProcess.OutputDataReceived += (s, a) => { if (!string.IsNullOrWhiteSpace(a.Data)) Trace.TraceVerbose("HybrisPlugin: Hybris process output: " + a.Data); };
_HybrisJavaProcess.ErrorDataReceived += (s, a) => { if (!string.IsNullOrWhiteSpace(a.Data)) Trace.TraceAndLogError("HybrisPlugin", "Hybris process error: " + a.Data); };
_HybrisJavaProcess.Exited += delegate(object sender, EventArgs e)
{
if (!this.ConfigStopHybris)
{
Trace.TraceAndLogError("HybrisPlugin", "Hybris process exited! ExitCode " + (sender as System.Diagnostics.Process).ExitCode.ToString());
this.Status = AzurePluginStatus.Error;
this.StatusMessage = "Hybris process exited!";
}
else
{
Trace.TraceAndLogWarning("HybrisPlugin", "Hybris process exited due to Additional Configuration change! ExitCode " + (sender as System.Diagnostics.Process).ExitCode.ToString());
this.Status = AzurePluginStatus.Warning;
this.StatusMessage = "Hybris process exited!";
}
};
if (_HybrisJavaProcess.Start())
{
_HybrisJavaProcess.BeginOutputReadLine();
_HybrisJavaProcess.BeginErrorReadLine();
}
else
{
Trace.TraceAndLogError("HybrisPlugin", "Hybris process could not be started!");
this.Status = AzurePluginStatus.ErrorStarting;
this.StatusMessage = "Hybris process could not be started!";
return false;
}
Trace.TraceAndLogInformation("HybrisPlugin", "Hybris process started.");
}
catch(Exception ex)
{
Trace.TraceAndLogError("HybrisPlugin", "Error while creating HybrisJavaProcess: " + ex.ToString());
this.Status = AzurePluginStatus.ErrorStarting;
this.StatusMessage = "Error while creating HybrisJavaProcess.";
return false;
}
this.Status = AzurePluginStatus.Healthy;
this.StatusMessage = "Process ID: " + _HybrisJavaProcess.Id.ToString();
return true;
}
private int StopRetries = 6;
private int StopRetryInterval = 1000 * 30; // 30 seconds
public void SendStop()
{
this.Status = AzurePluginStatus.Stopping;
Trace.TraceAndLogWarning("HybrisPlugin", "SendStop: Kill hybris child processes.");
foreach (var childProcess in _HybrisJavaProcess.GetChildProcesses(true).Reverse())
{
try
{
childProcess.Kill();
}
catch (Exception ex)
{
Trace.TraceWarning("HybrisPlugin: SendStop: Could not kill process with ID=" + childProcess.Id.ToString() + ": " + ex.ToString());
}
}
try
{
_HybrisJavaProcess.Kill();
}
catch (Exception ex)
{
Trace.TraceWarning("HybrisPlugin: SendStop: Could not kill HybrisJavaProcess: " + ex.ToString());
}
if (!_HybrisJavaProcess.HasExited)
this.Status = AzurePluginStatus.Unknown;
else
this.Status = AzurePluginStatus.Stopped;
this.StatusMessage = "Stopped.";
if (this.ConfigStopHybris)
this.StatusMessage = "Stopped due to additional configuration change.";
else
this.StatusMessage = "Stopped.";
}
public AzurePluginStatus Status { get; private set; }
public string StatusMessage { get; private set; }
#region Private Methods
/// <summary>
/// Patches the property in the given property file content string.
/// </summary>
private static string PatchProperty(string data, string key, string value)
{
const RegexOptions options = RegexOptions.Multiline | RegexOptions.CultureInvariant | RegexOptions.Compiled;
string result;
var pattern = "^" + key.Replace(".", @"\.") + "=(.*)$";
if (Regex.IsMatch(data, pattern, options))
{
var newValue = key + "=" + value;
result = Regex.Replace(data, pattern, newValue, options);
}
else
{
// append the value when it is not there
result = data + "\r\n" + key + "=" + value + "\r\n";
}
return result;
}
#endregion
}
}

Просмотреть файл

@ -0,0 +1,650 @@
// Microsoft Deployment Accelerator for hybris on Azure - sample code
// Copyright (c) Microsoft Corporation
// see LICENSE.txt for license information
using Microsoft.WindowsAzure.ServiceRuntime;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Net;
using System.Security.AccessControl;
using System.Text;
using tangible.Azure.AdditionalConfiguration;
using tangible.Azure.Auxiliary;
using tangible.Azure.Auxiliary.VolumeManagement;
using tangible.Azure.Base;
using tangible.Azure.Tracing;
namespace MicrosoftDXGermany.hybrisOnAzure.Plugins
{
public class SolrPlugin : IAzurePlugin
{
// Path where Hybris has been downloaded to
public static string BaseDirectory = Environment.ExpandEnvironmentVariables(RoleEnvironment.GetConfigurationSettingValue("HybrisOnAzure.BaseDirectory"));
public static string JavaHomeDirectory = Environment.ExpandEnvironmentVariables(RoleEnvironment.GetConfigurationSettingValue("HybrisOnAzure.JavaHomeDirectory"));
public static int JavaProcessShutdownWaitMinutes = int.Parse(RoleEnvironment.GetConfigurationSettingValue("HybrisOnAzure.JavaProcessShutdownWaitMinutes"));
public static bool IsBackOfficeWorker = RoleEnvironment.CurrentRoleInstance.Role.Name.ToLower().Contains("backoffice");
public bool Initialize()
{
Trace.TraceInformation("SolrPlugin: Initializing.");
this.Status = AzurePluginStatus.Initializing;
this.StatusMessage = string.Empty;
// 1. Create necessary directories for usage by solr
///// SolrJavaProcessHostRolePlugin.cs Line 61
#region Directories
string solrServerDirectory = Path.Combine(BaseDirectory, "solr");
string workBaseDirectory = null;
try
{
workBaseDirectory = RoleEnvironment.GetLocalResource("HybrisOnAzure.WorkBase").RootPath;
}
catch (Exception ex)
{
Trace.TraceAndLogError("SolrPlugin", "Error initializing: Could not retrieve local resource for workBaseDirectory. " + ex.ToString());
this.Status = AzurePluginStatus.ErrorInitializing;
this.StatusMessage = "Error initializing: Could not retrieve local resource for workBaseDirectory. ";
return false;
}
// a directory for "working" purposes mapped to a drive letter
string workDrive = null;
try
{
Trace.TraceInformation("SolrPlugin: Initializing work-Drive.");
if (!Directory.Exists(Path.Combine(workBaseDirectory, "work")))
Directory.CreateDirectory(Path.Combine(workBaseDirectory, "work"));
workDrive = DrivePathManager.Map(Path.Combine(workBaseDirectory, "work"), "Work");
if (!workDrive.EndsWith("\\")) workDrive = workDrive + "\\";
Trace.TraceInformation("SolrPlugin: mapped work directory to " + workDrive);
}
catch (Exception ex)
{
Trace.TraceAndLogError("SolrPlugin", "Error initializing: Could not map work drive. " + ex.ToString());
this.Status = AzurePluginStatus.ErrorInitializing;
this.StatusMessage = "Error initializing: Could not map work drive.";
return false;
}
// a directory for "temp" purposes mapped to a drive letter
string tempDrive = null;
try
{
Trace.TraceInformation("SolrPlugin: Initializing temp-Drive.");
if (!Directory.Exists(Path.Combine(workBaseDirectory, "temp")))
Directory.CreateDirectory(Path.Combine(workBaseDirectory, "temp"));
tempDrive = DrivePathManager.Map(Path.Combine(workBaseDirectory, "temp"), "Temp");
if (!tempDrive.EndsWith("\\")) tempDrive = tempDrive + "\\";
Trace.TraceInformation("SolrPlugin: mapped temp directory to " + tempDrive);
}
catch (Exception ex)
{
Trace.TraceAndLogError("SolrPlugin", "Error initializing: Could not map temp drive. " + ex.ToString());
this.Status = AzurePluginStatus.ErrorInitializing;
this.StatusMessage = "Error initializing: Could not map temp drive.";
return false;
}
// a directory for "data" purposes mapped to a drive letter
string dataDrive = null;
try
{
Trace.TraceInformation("SolrPlugin: Initializing data-Drive.");
if (!Directory.Exists(Path.Combine(workBaseDirectory, "data")))
Directory.CreateDirectory(Path.Combine(workBaseDirectory, "data"));
dataDrive = DrivePathManager.Map(Path.Combine(workBaseDirectory, "data"), "Data");
if (!dataDrive.EndsWith("\\")) dataDrive = dataDrive + "\\";
Trace.TraceInformation("SolrPlugin: mapped data directory to " + dataDrive);
}
catch (Exception ex)
{
Trace.TraceAndLogError("SolrPlugin", "Error initializing: Could not map data drive. " + ex.ToString());
this.Status = AzurePluginStatus.ErrorInitializing;
this.StatusMessage = "Error initializing: Could not map data drive.";
return false;
}
#endregion
#region Subdirectories for direct use by solr
Trace.TraceInformation("SolrPlugin: Initializing subdirectories.");
string solrWorkDirectory = null;
string solrTempDirectory = null;
string sharedTempDirectory = null;
string solrDataDirectory = null;
string solrLogsDirectory = null;
try
{
// Work Directory = Z:\solr
solrWorkDirectory = Path.Combine(workDrive, "solr");
if (!Directory.Exists(solrWorkDirectory))
Directory.CreateDirectory(solrWorkDirectory);
}
catch (Exception ex)
{
Trace.TraceAndLogError("SolrPlugin", "Could not create directory " + solrWorkDirectory + ": " + ex.ToString());
}
try
{
// Temp Directory = Y:\solr
solrTempDirectory = Path.Combine(tempDrive, "solr");
if (!Directory.Exists(solrTempDirectory))
Directory.CreateDirectory(solrTempDirectory);
}
catch (Exception ex)
{
Trace.TraceAndLogError("SolrPlugin", "Could not create directory " + solrTempDirectory + ": " + ex.ToString());
}
try
{
// Shared Temp Directory = Y:\shared
sharedTempDirectory = Path.Combine(tempDrive, "shared");
if (!Directory.Exists(sharedTempDirectory))
Directory.CreateDirectory(sharedTempDirectory);
}
catch (Exception ex)
{
Trace.TraceAndLogError("SolrPlugin", "Could not create directory " + sharedTempDirectory + ": " + ex.ToString());
}
try
{
// Data Directory = S:\solr on BackOfficeWorker, X:\hybris otherwise
if (IsBackOfficeWorker)
{
var driveLetter = solrDataDirectory = RoleEnvironment.GetConfigurationSettingValue("HybrisOnAzure.BackOfficeShare.DesiredDrive");
if (!driveLetter.EndsWith("\\")) driveLetter = driveLetter + "\\";
solrDataDirectory = Path.Combine(driveLetter, "solr");
}
else
solrDataDirectory = Path.Combine(dataDrive, "solr");
if (!Directory.Exists(solrDataDirectory))
Directory.CreateDirectory(solrDataDirectory);
}
catch (Exception ex)
{
Trace.TraceAndLogError("SolrPlugin", "Could not create directory " + solrDataDirectory + ": " + ex.ToString());
}
try
{
// Logs Directory = X:\logs\solr
solrLogsDirectory = Path.Combine(dataDrive, "logs", "solr");
if (!Directory.Exists(solrLogsDirectory))
Directory.CreateDirectory(solrLogsDirectory);
}
catch (Exception ex)
{
Trace.TraceAndLogError("SolrPlugin", "Could not create directory " + solrDataDirectory + ": " + ex.ToString());
}
#endregion
// 2. Patch SOLR commands
#region start/stop command script
// Read the standard PATH environment variable
string searchPath = Environment.GetEnvironmentVariable("path", EnvironmentVariableTarget.Machine);
// Patch SOLR start/stop command script
Trace.TraceInformation("SolrPlugin: Creating start/stop command script.");
string solrCommandFileName = "solrserver.bat";
try
{
string solrCommandFileContent = File.ReadAllText(Path.Combine(solrServerDirectory, solrCommandFileName));
var backOfficeInstance = RoleEnvironment.Roles["tangible.HybrisOnAzure.BackOfficeWorkerRole"].Instances.FirstOrDefault();
if (backOfficeInstance == null)
throw new NullReferenceException("No BackOfficeWorker instance found.");
IPEndPoint masterIPEndpoint = backOfficeInstance.InstanceEndpoints["Solr"].IPEndpoint; // CloudEnvironment.Roles[RoleNames.BackOfficeWorker].Instances.First().InstanceEndpoints[EndpointNames.BackOfficeWorker.Solr].IPEndpoint;
IPEndPoint solrIPEndpoint = RoleEnvironment.CurrentRoleInstance.InstanceEndpoints["Solr"].IPEndpoint;
IPEndPoint solrStopIPEndpoint = RoleEnvironment.CurrentRoleInstance.InstanceEndpoints["SolrStop"].IPEndpoint;
solrCommandFileContent = solrCommandFileContent.Replace(@"{solrdir}", solrServerDirectory);
solrCommandFileContent = solrCommandFileContent.Replace(@"{solrserverdir}", solrServerDirectory);
solrCommandFileContent = solrCommandFileContent.Replace(@"{solrworkdir}", solrWorkDirectory);
solrCommandFileContent = solrCommandFileContent.Replace(@"{solrtempdir}", solrTempDirectory);
solrCommandFileContent = solrCommandFileContent.Replace(@"{solrdatadir}", solrDataDirectory);
solrCommandFileContent = solrCommandFileContent.Replace(@"{solrlogsdir}", solrLogsDirectory);
solrCommandFileContent = solrCommandFileContent.Replace(@"{solrport}", solrIPEndpoint.Port.ToString(CultureInfo.InvariantCulture));
solrCommandFileContent = solrCommandFileContent.Replace(@"{solrmasterip}", masterIPEndpoint.Address.ToString());
solrCommandFileContent = solrCommandFileContent.Replace(@"{solrmasterport}", masterIPEndpoint.Port.ToString(CultureInfo.InvariantCulture));
solrCommandFileContent = solrCommandFileContent.Replace(@"{solrstopkey}", Convert.ToBase64String(Guid.NewGuid().ToByteArray()).Replace("=", ""));
solrCommandFileContent = solrCommandFileContent.Replace(@"{solrstopport}", solrStopIPEndpoint.Port.ToString(CultureInfo.InvariantCulture));
File.WriteAllText(Path.Combine(solrServerDirectory, solrCommandFileName), solrCommandFileContent);
}
catch (Exception ex)
{
Trace.TraceAndLogError("SolrPlugin", "Error creating solr start/stop command script: " + ex.Message);
this.Status = AzurePluginStatus.ErrorInitializing;
this.StatusMessage = "Error creating solr start/stop command script.";
return false;
}
#endregion
#region start command
// Build SOLR start command
Trace.TraceInformation("SolrPlugin: Creating start command.");
try
{
string solrStartCommandFileName = Path.Combine(solrServerDirectory, "solr-start.cmd");
var solrStartCommandBuilder = new StringBuilder();
solrStartCommandBuilder.AppendLine(@"@echo off");
solrStartCommandBuilder.AppendLine(@"set path=" + Path.Combine(JavaHomeDirectory, @"bin") + ";" + searchPath);
solrStartCommandBuilder.AppendLine(@"set java_home=" + JavaHomeDirectory);
solrStartCommandBuilder.AppendLine(@"set temp=" + sharedTempDirectory);
solrStartCommandBuilder.AppendLine(@"set tmp=" + sharedTempDirectory);
solrStartCommandBuilder.AppendLine();
solrStartCommandBuilder.AppendLine(@"set SOLR_DIR=" + solrServerDirectory);
solrStartCommandBuilder.AppendLine(@"set SOLR_WORK_DIR=" + solrWorkDirectory);
solrStartCommandBuilder.AppendLine(@"set SOLR_TEMP_DIR=" + solrTempDirectory);
solrStartCommandBuilder.AppendLine(@"set SOLR_DATA_DIR=" + solrDataDirectory);
solrStartCommandBuilder.AppendLine(@"set SOLR_LOGS_DIR=" + solrLogsDirectory);
solrStartCommandBuilder.AppendLine();
solrStartCommandBuilder.AppendLine(@"call " + Path.GetFileNameWithoutExtension(solrCommandFileName) + " start");
File.WriteAllText(solrStartCommandFileName, solrStartCommandBuilder.ToString());
}
catch (Exception ex)
{
Trace.TraceAndLogError("SolrPlugin", "Error creating solr start command: " + ex.Message);
this.Status = AzurePluginStatus.ErrorInitializing;
this.StatusMessage = "Error creating solr start command.";
return false;
}
#endregion
#region stop command
// Build SOLR stop command
Trace.TraceInformation("SolrPlugin: Creating stop command.");
try
{
string solrStopCommandFileName = Path.Combine(solrServerDirectory, "solr-stop.cmd");
var solrStopCommandBuilder = new StringBuilder();
solrStopCommandBuilder.AppendLine(@"@echo off");
solrStopCommandBuilder.AppendLine(@"set path=" + Path.Combine(JavaHomeDirectory, @"bin") + ";" + searchPath);
solrStopCommandBuilder.AppendLine(@"set java_home=" + JavaHomeDirectory);
solrStopCommandBuilder.AppendLine(@"set temp=" + sharedTempDirectory);
solrStopCommandBuilder.AppendLine(@"set tmp=" + sharedTempDirectory);
solrStopCommandBuilder.AppendLine();
solrStopCommandBuilder.AppendLine(@"set SOLR_DIR=" + solrServerDirectory);
solrStopCommandBuilder.AppendLine(@"set SOLR_WORK_DIR=" + solrWorkDirectory);
solrStopCommandBuilder.AppendLine(@"set SOLR_TEMP_DIR=" + solrTempDirectory);
solrStopCommandBuilder.AppendLine(@"set SOLR_DATA_DIR=" + solrDataDirectory);
solrStopCommandBuilder.AppendLine(@"set SOLR_LOGS_DIR=" + solrLogsDirectory);
solrStopCommandBuilder.AppendLine();
solrStopCommandBuilder.AppendLine(@"call " + Path.GetFileNameWithoutExtension(solrCommandFileName) + " stop");
File.WriteAllText(solrStopCommandFileName, solrStopCommandBuilder.ToString());
}
catch (Exception ex)
{
Trace.TraceAndLogError("SolrPlugin", "Error creating solr stop command: " + ex.Message);
this.Status = AzurePluginStatus.ErrorInitializing;
this.StatusMessage = "Error creating solr stop command.";
return false;
}
#endregion
// 3. set full control for applications directory (otherwise java process cannot write to C:\Applications\solr\logs (whyever)
#region directory permissions
Trace.TraceInformation("SolrPlugin: Creating access rule for everyone to " + BaseDirectory);
try
{
var security = Directory.GetAccessControl(BaseDirectory);
var rule = new FileSystemAccessRule("Everyone", FileSystemRights.FullControl, InheritanceFlags.ContainerInherit | InheritanceFlags.ObjectInherit, PropagationFlags.InheritOnly, AccessControlType.Allow);
security.AddAccessRule(rule);
Directory.SetAccessControl(BaseDirectory, security);
}
catch (Exception ex)
{
Trace.TraceAndLogError("SolrPlugin", "Error creating access rule for everyone: " + ex.ToString());
this.Status = AzurePluginStatus.ErrorInitializing;
this.StatusMessage = "Error creating access rule for everyone.";
return false;
}
#endregion
// 4. create C:\Applications\solr\server\logs directory (otherwise java process dies)
#region logs dir
Trace.TraceInformation("SolrPlugin: Creating logs dir because java ignors log-configuration.");
try
{
var logsDir = Path.Combine(BaseDirectory, "solr", "server", "logs");
if (!Directory.Exists(logsDir))
Directory.CreateDirectory(logsDir);
}
catch (Exception ex)
{
Trace.TraceAndLogError("SolrPlugin", "Error creating special log directory: " + ex.ToString());
this.Status = AzurePluginStatus.ErrorInitializing;
this.StatusMessage = "Error creating special log directory.";
return false;
}
#endregion
// 5. Get from additional settings if we may start the hybris process
#region Additional configuration
AdditionalConfigurationManager.Instance.AdditionalConfigurationChanged += Instance_AdditionalConfigurationChanged;
try
{
Trace.TraceInformation("SolrPlugin: Processing initial additional configuration.");
AdditionalConfigurationManager.Instance.ProcessConfiguration();
Trace.TraceInformation("SolrPlugin: Successfully processed initial additional configuration.");
}
catch (Exception ex)
{
Trace.TraceAndLogError("SolrPlugin", "Error processing initial additional configuration: " + ex.ToString());
}
try
{
Trace.TraceInformation("SolrPlugin", "Determining if Hybris was stopped before a reboot");
var stopHybris = AdditionalConfigurationManager.Instance.GetCurrentConfigurationValue("StopHybris");
if (stopHybris == null)
Trace.TraceAndLogWarning("SolrPlugin", "Determining if Hybris was stopped before a reboot resulted in a NULL value. Solr will be started.");
else
{
Trace.TraceInformation("SolrPlugin: Determining if Solr was stopped before a reboot resulted in the value: " + stopHybris);
this.ConfigStopSolr = bool.Parse(stopHybris);
}
}
catch (Exception ex)
{
Trace.TraceAndLogError("Solr", "Error getting from Additional configuration if processes are to be started: " + ex.ToString());
this.Status = AzurePluginStatus.ErrorInitializing;
this.StatusMessage = "Error getting Additional configuration";
return false;
}
#endregion
Trace.TraceInformation("SolrPlugin: Initialization done.");
this.Status = AzurePluginStatus.NotStarted;
this.StatusMessage = string.Empty;
return true;
}
private void Instance_AdditionalConfigurationChanged(object sender, ConfigurationItemChangedEventArgs e)
{
if (e.Name == "StopHybris")
{
// this instance is told to change it's maintenance mode
var stringValue = (e.ChangeType == ChangeType.Added | e.ChangeType == ChangeType.Modified) ? e.NewValue : e.OldValue;
bool newValue;
if (bool.TryParse(stringValue, out newValue))
{
Trace.TraceAndLogInformation("SolrPlugin", "Additional configuration changed value StopHybris to " + newValue.ToString());
// enable or disable the Routing rule to the maintenance page
this.ConfigStopSolr = newValue;
// if hybris has to be stopped > stop solr
if (newValue && _SolrJavaProcess != null && !_SolrJavaProcess.HasExited)
SendStop();
}
}
}
private bool ConfigStopSolr { get; set; }
private System.Diagnostics.Process _SolrJavaProcess;
public bool IsAlive
{
get
{
// this Plugin is alive as long as the Solr process is running
// or if the additional configuration says the process should not be running
try
{
return this.ConfigStopSolr || (_SolrJavaProcess != null && !_SolrJavaProcess.HasExited);
}
catch
{
return false;
}
}
}
public bool Start()
{
// if SOLR is running we don't need to start again
if (this.IsAlive) return true;
this.Status = AzurePluginStatus.Starting;
this.StatusMessage = string.Empty;
try
{
// Prepare SOLR start
string solrWorkingDirectory = Path.Combine(BaseDirectory, "solr");
string solrStartCommandFileName = Path.Combine(solrWorkingDirectory, "solr-start.cmd");
// Start SOLR process
_SolrJavaProcess = new System.Diagnostics.Process
{
StartInfo = new System.Diagnostics.ProcessStartInfo
{
WorkingDirectory = solrWorkingDirectory,
FileName = solrStartCommandFileName,
Arguments = string.Empty,
UseShellExecute = false,
RedirectStandardOutput = true,
RedirectStandardError = true,
RedirectStandardInput = true,
CreateNoWindow = true,
WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden,
}
};
_SolrJavaProcess.OutputDataReceived += (s, a) => { if (!string.IsNullOrWhiteSpace(a.Data)) Trace.TraceVerbose("SolrPlugin: Solr process output: " + a.Data); };
_SolrJavaProcess.ErrorDataReceived += (s, a) => { if (!string.IsNullOrWhiteSpace(a.Data)) Trace.TraceAndLogError("SolrPlugin", "Solr process error: " + a.Data); };
_SolrJavaProcess.Exited += delegate(object sender, EventArgs e)
{
if (!this.ConfigStopSolr)
{
Trace.TraceAndLogError("SolrPlugin", "Solr process exited! ExitCode " + (sender as System.Diagnostics.Process).ExitCode.ToString());
this.Status = AzurePluginStatus.Error;
this.StatusMessage = "Solr process exited!";
}
else
{
Trace.TraceAndLogWarning("SolrPlugin", "Solr process exited due to Additional Configuration change! ExitCode " + (sender as System.Diagnostics.Process).ExitCode.ToString());
this.Status = AzurePluginStatus.Warning;
this.StatusMessage = "Solr process exited!";
}
};
if (_SolrJavaProcess.Start())
{
_SolrJavaProcess.BeginOutputReadLine();
_SolrJavaProcess.BeginErrorReadLine();
}
else
{
Trace.TraceAndLogError("SolrPlugin", "Solr process could not be started!");
this.Status = AzurePluginStatus.ErrorStarting;
this.StatusMessage = "Solr process could not be started!";
return false;
}
Trace.TraceAndLogInformation("SolrPlugin", "Solr process started.");
}
catch (Exception ex)
{
Trace.TraceAndLogError("SolrPlugin", "Error while creating SolrJavaProcess: " + ex.ToString());
this.Status = AzurePluginStatus.ErrorStarting;
this.StatusMessage = "Error while creating SolrJavaProcess.";
return false;
}
this.Status = AzurePluginStatus.Healthy;
this.StatusMessage = "Process ID: " + _SolrJavaProcess.Id.ToString();
return true;
}
private int StopRetries = 6;
private int StopRetryInterval = 1000 * 30; // 30 seconds
public void SendStop()
{
this.Status = AzurePluginStatus.Stopping;
// ADAPTING: Kill the Solr process
Trace.TraceAndLogWarning("SolrPlugin", "SendStop: Kill solr child processes.");
foreach (var childProcess in _SolrJavaProcess.GetChildProcesses(true).Reverse())
{
try
{
childProcess.Kill();
}
catch (Exception ex)
{
Trace.TraceWarning("SolrPlugin: SendStop: Could not kill process with ID=" + childProcess.Id.ToString() + ": " + ex.ToString());
}
}
try
{
Trace.TraceInformation("SolrPlugin: SendStop: Stopping SolrJavaProcess.");
_SolrJavaProcess.Kill();
Trace.TraceAndLogInformation("SolrPlugin", "SendStop: SolrJavaProcess killed.");
}
catch (Exception ex)
{
Trace.TraceAndLogError("SolrPlugin", "SendStop: Could not kill SolrJavaProcess. " + ex.ToString());
}
if (!_SolrJavaProcess.HasExited)
this.Status = AzurePluginStatus.Unknown;
else
this.Status = AzurePluginStatus.Stopped;
if (this.ConfigStopSolr)
this.StatusMessage = "Stopped due to additional configuration change.";
else
this.StatusMessage = "Stopped.";
return;
#region skipped
//for (int i = 1; i <= this.StopRetries; i++)
//{
// if (this.IsAlive)
// {
// // Prepare SOLR stop
// string solrWorkingDirectory = Path.Combine(BaseDirectory, "solr", "server");
// string solrStopCommandFileName = Path.Combine(solrWorkingDirectory, "solr-stop.cmd");
// System.Diagnostics.Process stopProcess = null;
// try
// {
// stopProcess = new System.Diagnostics.Process
// {
// StartInfo = new System.Diagnostics.ProcessStartInfo
// {
// WorkingDirectory = solrWorkingDirectory,
// FileName = solrStopCommandFileName,
// Arguments = string.Empty,
// UseShellExecute = false,
// RedirectStandardOutput = true,
// RedirectStandardError = true,
// CreateNoWindow = true,
// WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden,
// }
// };
// stopProcess.OutputDataReceived += (s, a) => { if (!string.IsNullOrWhiteSpace(a.Data)) Trace.TraceVerbose("SolrPlugin: SendStop: Solr stop process output: " + a.Data); };
// stopProcess.ErrorDataReceived += (s, a) => { if (!string.IsNullOrWhiteSpace(a.Data)) Trace.TraceAndLogError("SolrPlugin", "SendStop: Solr stop process error: " + a.Data); };
// stopProcess.Exited += (s, a) => Trace.TraceInformation("SolrPlugin: SendStop: Solr stop process exited.");
// if (stopProcess.Start())
// {
// stopProcess.BeginOutputReadLine();
// stopProcess.BeginErrorReadLine();
// }
// // Wait up to XX minutes for solr process to exit
// Trace.TraceInformation(string.Format("SolrPlugin: SendStop: Waiting up to {0} minutes for solr process to exit.", JavaProcessShutdownWaitMinutes));
// if (!stopProcess.WaitForExit((int)TimeSpan.FromMinutes(JavaProcessShutdownWaitMinutes).TotalMilliseconds))
// {
// // the process did not exit after XX minutes
// // > force the process to exit
// Trace.TraceAndLogWarning("SolrPlugin", "SendStop: Kill solr platform process.");
// foreach (var childProcess in _SolrJavaProcess.GetChildProcesses(true).Reverse())
// {
// try
// {
// childProcess.Kill();
// }
// catch (Exception ex)
// {
// Trace.TraceWarning("SolrPlugin: SendStop: Could not kill process with ID=" + childProcess.Id.ToString() + ": " + ex.ToString());
// }
// }
// try
// {
// _SolrJavaProcess.Kill();
// }
// catch (Exception ex)
// {
// Trace.TraceWarning("SolrPlugin: SendStop: Could not kill SolrJavaProcess: " + ex.ToString());
// }
// try
// {
// stopProcess.Kill();
// }
// catch (Exception ex)
// {
// Trace.TraceWarning("SolrPlugin: SendStop: Could not kill stopProcess: " + ex.ToString());
// }
// }
// if (!stopProcess.HasExited)
// {
// Trace.TraceWarning("SolrPlugin: SendStop: StopProcess has not exited > kill it.");
// try
// {
// stopProcess.Kill();
// }
// catch(Exception ex)
// {
// Trace.TraceAndLogError("SolrPlugin", "SendStop: In retry " + i.ToString() + "Stop process did not exit and could not be killed. Exception: " + ex.ToString());
// }
// }
// if (_SolrJavaProcess.HasExited)
// {
// Trace.TraceInformation("SolrPlugin: SendStop: SolrJavaProcess exited.");
// if (!this.ConfigStopSolr)
// {
// // we have not been shut down not due to an additional configuration change
// this.Status = AzurePluginStatus.Stopped;
// this.StatusMessage = string.Empty;
// }
// break;
// }
// else if (i == this.StopRetries)
// {
// Trace.TraceAndLogError("SolrPlugin", "SendStop: Final retry " + i.ToString() + ": SolrJavaProcess did not exit. Killing it.");
// try
// {
// _SolrJavaProcess.Kill();
// if (!this.ConfigStopSolr)
// {
// // we have not been shut down not due to an additional configuration change
// this.Status = AzurePluginStatus.Stopped;
// this.StatusMessage = string.Empty;
// }
// }
// catch(Exception ex)
// {
// Trace.TraceAndLogError("SolrPlugin", "SendStop: Final retry " + i.ToString() + ": Could not kill SolrJavaProcess. Exception: " + ex.ToString());
// this.Status = AzurePluginStatus.Error;
// this.StatusMessage = "Could not kill Solr Process after final stop retry.";
// }
// }
// }
// catch (Exception ex)
// {
// Trace.TraceAndLogError("SolrPlugin", "Error stopping Solr Plugin: " + ex.ToString());
// this.Status = AzurePluginStatus.Unknown;
// this.StatusMessage = "Error stopping SolrPlugin";
// }
// System.Threading.Thread.Sleep(this.StopRetryInterval);
// }
//}
#endregion
}
public AzurePluginStatus Status { get; private set; }
public string StatusMessage { get; private set; }
}
}

Просмотреть файл

@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("tangible.HybrisOnAzure.Common")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft")]
[assembly: AssemblyProduct("tangible.HybrisOnAzure.Common")]
[assembly: AssemblyCopyright("Copyright © Microsoft 2014")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("d46ccaa4-6787-4deb-a07b-c1c4a373404d")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

63
MicrosoftDXGermany.hybrisOnAzure.Common/Properties/Resources.Designer.cs сгенерированный Normal file
Просмотреть файл

@ -0,0 +1,63 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.34014
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace MicrosoftDXGermany.hybrisOnAzure.Common.Properties {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("MicrosoftDXGermany.hybrisOnAzure.Common.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
}
}

Просмотреть файл

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

Просмотреть файл

@ -0,0 +1,43 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Net.Http" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.2.20.0" newVersion="2.2.20.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<system.serviceModel>
<extensions>
<!-- In this extension section we are introducing all known service bus extensions. User can remove the ones they don't need. -->
<behaviorExtensions>
<add name="connectionStatusBehavior" type="Microsoft.ServiceBus.Configuration.ConnectionStatusElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="transportClientEndpointBehavior" type="Microsoft.ServiceBus.Configuration.TransportClientEndpointBehaviorElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="serviceRegistrySettings" type="Microsoft.ServiceBus.Configuration.ServiceRegistrySettingsElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</behaviorExtensions>
<bindingElementExtensions>
<add name="netMessagingTransport" type="Microsoft.ServiceBus.Messaging.Configuration.NetMessagingTransportExtensionElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="tcpRelayTransport" type="Microsoft.ServiceBus.Configuration.TcpRelayTransportElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="httpRelayTransport" type="Microsoft.ServiceBus.Configuration.HttpRelayTransportElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="httpsRelayTransport" type="Microsoft.ServiceBus.Configuration.HttpsRelayTransportElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="onewayRelayTransport" type="Microsoft.ServiceBus.Configuration.RelayedOnewayTransportElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</bindingElementExtensions>
<bindingExtensions>
<add name="basicHttpRelayBinding" type="Microsoft.ServiceBus.Configuration.BasicHttpRelayBindingCollectionElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="webHttpRelayBinding" type="Microsoft.ServiceBus.Configuration.WebHttpRelayBindingCollectionElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="ws2007HttpRelayBinding" type="Microsoft.ServiceBus.Configuration.WS2007HttpRelayBindingCollectionElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="netTcpRelayBinding" type="Microsoft.ServiceBus.Configuration.NetTcpRelayBindingCollectionElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="netOnewayRelayBinding" type="Microsoft.ServiceBus.Configuration.NetOnewayRelayBindingCollectionElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="netEventRelayBinding" type="Microsoft.ServiceBus.Configuration.NetEventRelayBindingCollectionElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="netMessagingBinding" type="Microsoft.ServiceBus.Messaging.Configuration.NetMessagingBindingCollectionElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</bindingExtensions>
</extensions>
</system.serviceModel><appSettings>
<!-- Service Bus specific app setings for messaging connections -->
<add key="Microsoft.ServiceBus.ConnectionString" value="Endpoint=sb://[your namespace].servicebus.windows.net;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=[your secret]" />
</appSettings></configuration>

Просмотреть файл

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.Bcl" version="1.1.8" targetFramework="net40" />
<package id="Microsoft.Bcl.Build" version="1.0.14" targetFramework="net40" />
<package id="Microsoft.Data.Edm" version="5.6.0" targetFramework="net40" />
<package id="Microsoft.Data.OData" version="5.6.0" targetFramework="net40" />
<package id="Microsoft.Data.Services.Client" version="5.6.0" targetFramework="net40" />
<package id="Microsoft.Net.Http" version="2.2.20" targetFramework="net40" />
<package id="Microsoft.WindowsAzure.ConfigurationManager" version="2.0.3" targetFramework="net40" />
<package id="Newtonsoft.Json" version="6.0.3" targetFramework="net40" />
<package id="SendGrid.SmtpApiPlus" version="1.0.1" targetFramework="net40" />
<package id="SendGridPlus" version="4.1" targetFramework="net40" />
<package id="System.Spatial" version="5.6.0" targetFramework="net40" />
<package id="tangible.HybrisOnAzure.Toolbox" version="1.0.0" targetFramework="net40" />
<package id="WindowsAzure.ServiceBus" version="2.4.2.0" targetFramework="net40" />
<package id="WindowsAzure.Storage" version="4.2.1" targetFramework="net40" />
</packages>

Просмотреть файл

@ -0,0 +1,180 @@
// Microsoft Deployment Accelerator for hybris on Azure - sample code
// Copyright (c) Microsoft Corporation
// see LICENSE.txt for license information
using Microsoft.WindowsAzure.ServiceRuntime;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using tangible.Azure.AdditionalConfiguration;
using tangible.Azure.Base;
using tangible.Azure.Downloader;
using tangible.Azure.StartupScripts;
using tangible.Azure.Tracing;
namespace MicrosoftDXGermany.hybrisOnAzure.FrontendWorkerRole
{
public class FrontendWorkerServer : AzureComponentBase
{
static string TRACESOURCE = "FrontendWorkerServer";
public override bool BeforeOnStart()
{
var onStartSuccessful = true;
System.Net.ServicePointManager.DefaultConnectionLimit = 12;
#region create plugins
if (!this.ActivePlugins.Any(p => p.GetType() == typeof(Plugins.HybrisPlugin)))
this.AddPlugin<Plugins.HybrisPlugin>(null);
else
{
Trace.TraceAndLogWarning(TRACESOURCE, "Before on Start called with a running HybrisPlugin. Sending stop...");
try
{
this.ActivePlugins.First(p => p.GetType() == typeof(Plugins.HybrisPlugin)).SendStop();
Trace.TraceAndLogInformation(TRACESOURCE, "Successfully stopped HybrisPlugin in BeforeOnStart.");
}
catch (Exception ex)
{
Trace.TraceAndLogError(TRACESOURCE, "Error stopping HybrisPlugin in BeforeOnStart. Error: " + ex.ToString());
}
}
try
{
bool startSolr = false;
if (!bool.TryParse(RoleEnvironment.GetConfigurationSettingValue("HybrisOnAzure.StartSolrPlugin"), out startSolr))
Trace.TraceAndLogError(TRACESOURCE, "ERROR: Could not parse 'HybrisOnAzure.StartSolrPlugin' configuration.");
if (startSolr && !this.ActivePlugins.Any(p => p.GetType() == typeof(Plugins.SolrPlugin)))
this.AddPlugin<Plugins.SolrPlugin>(null);
else if (this.ActivePlugins.Any(p => p.GetType() == typeof(Plugins.SolrPlugin)))
{
Trace.TraceAndLogWarning(TRACESOURCE, "Before on Start called with a running SolrPlugin. Sending stop...");
try
{
this.ActivePlugins.First(p => p.GetType() == typeof(Plugins.SolrPlugin)).SendStop();
Trace.TraceAndLogInformation(TRACESOURCE, "Successfully stopped SolrPlugin in BeforeOnStart.");
}
catch (Exception ex)
{
Trace.TraceAndLogError(TRACESOURCE, "Error stopping SolrPlugin in BeforeOnStart. Error: " + ex.ToString());
}
if (!startSolr)
{
Trace.TraceAndLogInformation(TRACESOURCE, "Removing SolrPlugin.");
this.RemovePlugin(this.ActivePlugins.First(p => p.GetType() == typeof(Plugins.SolrPlugin)));
}
}
}
catch (Exception ex)
{
Trace.TraceAndLogError(TRACESOURCE, "Error creating SolrPlugin in BeforeOnStart. Error: " + ex.ToString());
}
#endregion
#region CLEANUP
try
{
var rootDirectory = RoleEnvironment.GetConfigurationSettingValue("HybrisOnAzure.BaseDirectory");
Trace.TraceInformation(TRACESOURCE + " OnStart - cleanup old files from '{0}'.", rootDirectory);
if (System.IO.Directory.Exists(rootDirectory))
{
Trace.TraceInformation(TRACESOURCE + " OnStart - '{0}' exists > delete.", rootDirectory);
System.IO.Directory.Delete(rootDirectory, true);
if (System.IO.Directory.Exists(rootDirectory))
Trace.TraceError(TRACESOURCE + " OnStart -'{0}' successfully deleted but still exists!.", rootDirectory);
else
Trace.TraceInformation(TRACESOURCE + " OnStart - '{0}' successfully deleted.", rootDirectory);
}
else
Trace.TraceInformation(TRACESOURCE + " OnStart - '{0}' does not exist.", rootDirectory);
}
catch (Exception ex)
{
Trace.TraceAndLogError(TRACESOURCE, "OnStart - error at Cleanup old files: " + ex.ToString());
}
#endregion
#region Download stuff from storage
// download files from storage to this computer
try
{
Trace.TraceInformation(TRACESOURCE + ": BeforeOnStart: Starting DownloadHelper.");
DownloadHelper.Download();
}
catch (Exception ex)
{
Trace.TraceAndLogError(TRACESOURCE, "BeforeOnStart: ERROR while executing DownloadHelper. Message: " + ex.Message);
onStartSuccessful = false;
}
#endregion
#region PatchFiles
// patch files
try
{
Trace.TraceInformation(TRACESOURCE + ": BeforeOnStart: Starting PatchFiles.");
PatchFileHelper.PatchAllFilesFromConfig();
}
catch (Exception ex)
{
Trace.TraceAndLogError(TRACESOURCE, "BeforeOnStart: ERROR while executing PatchFileHelper. Message: " + ex.Message, ex);
onStartSuccessful = false;
}
#endregion
#region Run Commandlets
// execute setup via configurable commandlets.
try
{
Trace.TraceInformation(TRACESOURCE + ": BeforeOnStart: Starting SetupHelper.");
new StartupScriptHelper().ExecuteScripts();
}
catch (Exception ex)
{
Trace.TraceAndLogError(TRACESOURCE, "BeforeOnStart: ERROR while executing SetupHelper. Message: " + ex.Message, ex);
onStartSuccessful = false;
}
#endregion
#region handle role environment changes
RoleEnvironment.Changed += RoleEnvironment_Changed;
#endregion
#region hadle additional changes
AdditionalConfigurationManager.Instance.AdditionalConfigurationChanged += AdditionalConfiguration_Changed;
try
{
AdditionalConfigurationManager.Instance.ProcessConfiguration();
}
catch (Exception ex)
{
Trace.TraceAndLogError(TRACESOURCE, "Error processing initial AdditionalConfiguration:" + ex.ToString());
}
#endregion
return onStartSuccessful;
}
void AdditionalConfiguration_Changed(object sender, ConfigurationItemChangedEventArgs e)
{
Trace.TraceInformation(TRACESOURCE + ":AdditionalConfiguration: " + e.Name + " (" + e.ChangeType.ToString() + ")" + " New = " + e.NewValue ?? "NULL" + " | " + "Old = " + e.OldValue ?? "NULL");
// on change of the "Reboot"-Value > Request a role recycle
if (e.Name == "Reboot" && e.ChangeType == ChangeType.Modified && !string.IsNullOrEmpty(e.NewValue))
{
Trace.TraceAndLogWarning(TRACESOURCE, "Additional Change requested reboot.");
//RoleEnvironment.RequestRecycle();
this.OnStop();
System.Diagnostics.Process.Start("shutdown", "/r /t 0");
}
}
void RoleEnvironment_Changed(object sender, RoleEnvironmentChangedEventArgs e)
{
}
}
}

Просмотреть файл

@ -0,0 +1,177 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{039A0059-8BC8-40B6-AC67-EF8389763E57}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>MicrosoftDXGermany.hybrisOnAzure.FrontendWorkerRole</RootNamespace>
<AssemblyName>tangible.HybrisOnAzure.FrontendWorkerRole</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<RoleType>Worker</RoleType>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
<RestorePackages>true</RestorePackages>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Ionic.Zip">
<HintPath>..\packages\tangible.HybrisOnAzure.Toolbox.1.0.0\lib\Ionic.Zip.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Data.Edm, Version=5.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Data.Edm.5.6.0\lib\net40\Microsoft.Data.Edm.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Data.OData, Version=5.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Data.OData.5.6.0\lib\net40\Microsoft.Data.OData.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Data.Services.Client, Version=5.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Data.Services.Client.5.6.0\lib\net40\Microsoft.Data.Services.Client.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ServiceBus">
<HintPath>..\packages\WindowsAzure.ServiceBus.2.4.2.0\lib\net40-full\Microsoft.ServiceBus.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Web.Administration, Version=7.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\tangible.HybrisOnAzure.Toolbox.1.0.0\lib\Microsoft.Web.Administration.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAzure.Configuration">
<HintPath>..\packages\Microsoft.WindowsAzure.ConfigurationManager.2.0.3\lib\net40\Microsoft.WindowsAzure.Configuration.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAzure.Diagnostics, Version=2.4.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.WindowsAzure.ServiceRuntime, Version=2.4.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.WindowsAzure.Storage">
<HintPath>..\packages\WindowsAzure.Storage.4.2.1\lib\net40\Microsoft.WindowsAzure.Storage.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Newtonsoft.Json.6.0.3\lib\net40\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="SendGrid.SmtpApi">
<HintPath>..\packages\SendGrid.SmtpApiPlus.1.0.1\lib\portable-net4+sl5+wp8+win8+wpa81+monotouch+monoandroid\SendGrid.SmtpApi.dll</HintPath>
</Reference>
<Reference Include="SendGridPlus">
<HintPath>..\packages\SendGridPlus.4.1\lib\net40\SendGridPlus.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.IO">
<HintPath>..\packages\Microsoft.Bcl.1.1.8\lib\net40\System.IO.dll</HintPath>
</Reference>
<Reference Include="System.Net.Http, Version=2.2.20.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Microsoft.Net.Http.2.2.20\lib\net40\System.Net.Http.dll</HintPath>
</Reference>
<Reference Include="System.Net.Http.Extensions">
<HintPath>..\packages\Microsoft.Net.Http.2.2.20\lib\net40\System.Net.Http.Extensions.dll</HintPath>
</Reference>
<Reference Include="System.Net.Http.Primitives">
<HintPath>..\packages\Microsoft.Net.Http.2.2.20\lib\net40\System.Net.Http.Primitives.dll</HintPath>
</Reference>
<Reference Include="System.Net.Http.WebRequest, Version=2.2.20.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Microsoft.Net.Http.2.2.20\lib\net40\System.Net.Http.WebRequest.dll</HintPath>
</Reference>
<Reference Include="System.Runtime">
<HintPath>..\packages\Microsoft.Bcl.1.1.8\lib\net40\System.Runtime.dll</HintPath>
</Reference>
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.ServiceModel" />
<Reference Include="System.Spatial, Version=5.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\System.Spatial.5.6.0\lib\net40\System.Spatial.dll</HintPath>
</Reference>
<Reference Include="System.Threading.Tasks">
<HintPath>..\packages\Microsoft.Bcl.1.1.8\lib\net40\System.Threading.Tasks.dll</HintPath>
</Reference>
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="tangible.Azure.AdditionalConfiguration">
<HintPath>..\packages\tangible.HybrisOnAzure.Toolbox.1.0.0\lib\tangible.Azure.AdditionalConfiguration.dll</HintPath>
</Reference>
<Reference Include="tangible.Azure.Auxiliary">
<HintPath>..\packages\tangible.HybrisOnAzure.Toolbox.1.0.0\lib\tangible.Azure.Auxiliary.dll</HintPath>
</Reference>
<Reference Include="tangible.Azure.Base">
<HintPath>..\packages\tangible.HybrisOnAzure.Toolbox.1.0.0\lib\tangible.Azure.Base.dll</HintPath>
</Reference>
<Reference Include="tangible.Azure.Downloader">
<HintPath>..\packages\tangible.HybrisOnAzure.Toolbox.1.0.0\lib\tangible.Azure.Downloader.dll</HintPath>
</Reference>
<Reference Include="tangible.Azure.IIS">
<HintPath>..\packages\tangible.HybrisOnAzure.Toolbox.1.0.0\lib\tangible.Azure.IIS.dll</HintPath>
</Reference>
<Reference Include="tangible.Azure.Management">
<HintPath>..\packages\tangible.HybrisOnAzure.Toolbox.1.0.0\lib\tangible.Azure.Management.dll</HintPath>
</Reference>
<Reference Include="tangible.Azure.StartupScripts">
<HintPath>..\packages\tangible.HybrisOnAzure.Toolbox.1.0.0\lib\tangible.Azure.StartupScripts.dll</HintPath>
</Reference>
<Reference Include="tangible.Azure.Storage">
<HintPath>..\packages\tangible.HybrisOnAzure.Toolbox.1.0.0\lib\tangible.Azure.Storage.dll</HintPath>
</Reference>
<Reference Include="tangible.Azure.Tracing">
<HintPath>..\packages\tangible.HybrisOnAzure.Toolbox.1.0.0\lib\tangible.Azure.Tracing.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="FrontendWorkerServer.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="WorkerRole.cs" />
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\MicrosoftDXGermany.hybrisOnAzure.Common\MicrosoftDXGermany.hybrisOnAzure.Common.csproj">
<Project>{b610504c-aff3-4e15-b1c5-5ee1d284f2a1}</Project>
<Name>MicrosoftDXGermany.hybrisOnAzure.Common</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
</Target>
<Import Project="..\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets" Condition="Exists('..\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets')" />
<Target Name="EnsureBclBuildImported" BeforeTargets="BeforeBuild" Condition="'$(BclBuildImported)' == ''">
<Error Condition="!Exists('..\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets')" Text="This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=317567." HelpKeyword="BCLBUILD2001" />
<Error Condition="Exists('..\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets')" Text="The build restored NuGet packages. Build the project again to include these packages in the build. For more information, see http://go.microsoft.com/fwlink/?LinkID=317568." HelpKeyword="BCLBUILD2002" />
</Target>
<!-- 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.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

Просмотреть файл

@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("tangible.HybrisOnAzure.FrontendWorkerRole")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft")]
[assembly: AssemblyProduct("tangible.HybrisOnAzure.FrontendWorkerRole")]
[assembly: AssemblyCopyright("Copyright © Microsoft 2014")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("277ca51c-dd26-42f5-8086-c889cd1a60b6")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

Просмотреть файл

@ -0,0 +1,42 @@
// Microsoft Deployment Accelerator for hybris on Azure - sample code
// Copyright (c) Microsoft Corporation
// see LICENSE.txt for license information
using Microsoft.WindowsAzure.ServiceRuntime;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Mail;
using System.Text;
using System.Threading;
using System.Web;
using tangible.Azure.Base;
using tangible.Azure.Tracing;
namespace MicrosoftDXGermany.hybrisOnAzure.FrontendWorkerRole
{
public class FrontendWorkerRole : AzurePluginHost
{
public FrontendWorkerRole()
: base()
{
this.UnhandledException += new UnhandledExceptionEventHandler(FrontendWorkerRole_UnhandledException);
}
void FrontendWorkerRole_UnhandledException(object sender, UnhandledExceptionEventArgs e)
{
Trace.TraceAndLogError("FrontendWorkerRole", "Unhandled exception " + ((e.ExceptionObject != null) ? e.ExceptionObject.ToString() : "No information"));
}
public override bool BeforeOnStart()
{
// Note: (2) We attach also to a local file on disk
if (System.IO.File.Exists("C:\\AzureWorkerRoleLog.txt")) System.IO.File.Delete("C:\\AzureWorkerRoleLog.txt");
System.Diagnostics.Trace.Listeners.Add(new System.Diagnostics.TextWriterTraceListener("C:\\AzureWorkerRoleLog.txt"));
this.AddComponent(new FrontendWorkerServer());
return true;
}
}
}

Просмотреть файл

@ -0,0 +1,53 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.diagnostics>
<trace>
<listeners>
<add type="Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics, Version=2.4.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" name="AzureDiagnostics">
<filter type="" />
</add>
</listeners>
</trace>
</system.diagnostics>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0" /></startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Net.Http" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.2.20.0" newVersion="2.2.20.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<system.serviceModel>
<extensions>
<!-- In this extension section we are introducing all known service bus extensions. User can remove the ones they don't need. -->
<behaviorExtensions>
<add name="connectionStatusBehavior" type="Microsoft.ServiceBus.Configuration.ConnectionStatusElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="transportClientEndpointBehavior" type="Microsoft.ServiceBus.Configuration.TransportClientEndpointBehaviorElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="serviceRegistrySettings" type="Microsoft.ServiceBus.Configuration.ServiceRegistrySettingsElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</behaviorExtensions>
<bindingElementExtensions>
<add name="netMessagingTransport" type="Microsoft.ServiceBus.Messaging.Configuration.NetMessagingTransportExtensionElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="tcpRelayTransport" type="Microsoft.ServiceBus.Configuration.TcpRelayTransportElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="httpRelayTransport" type="Microsoft.ServiceBus.Configuration.HttpRelayTransportElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="httpsRelayTransport" type="Microsoft.ServiceBus.Configuration.HttpsRelayTransportElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="onewayRelayTransport" type="Microsoft.ServiceBus.Configuration.RelayedOnewayTransportElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</bindingElementExtensions>
<bindingExtensions>
<add name="basicHttpRelayBinding" type="Microsoft.ServiceBus.Configuration.BasicHttpRelayBindingCollectionElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="webHttpRelayBinding" type="Microsoft.ServiceBus.Configuration.WebHttpRelayBindingCollectionElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="ws2007HttpRelayBinding" type="Microsoft.ServiceBus.Configuration.WS2007HttpRelayBindingCollectionElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="netTcpRelayBinding" type="Microsoft.ServiceBus.Configuration.NetTcpRelayBindingCollectionElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="netOnewayRelayBinding" type="Microsoft.ServiceBus.Configuration.NetOnewayRelayBindingCollectionElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="netEventRelayBinding" type="Microsoft.ServiceBus.Configuration.NetEventRelayBindingCollectionElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="netMessagingBinding" type="Microsoft.ServiceBus.Messaging.Configuration.NetMessagingBindingCollectionElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</bindingExtensions>
</extensions>
</system.serviceModel><appSettings>
<!-- Service Bus specific app setings for messaging connections -->
<add key="Microsoft.ServiceBus.ConnectionString" value="Endpoint=sb://[your namespace].servicebus.windows.net;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=[your secret]" />
</appSettings></configuration>

Просмотреть файл

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.Bcl" version="1.1.8" targetFramework="net40" />
<package id="Microsoft.Bcl.Build" version="1.0.14" targetFramework="net40" />
<package id="Microsoft.Data.Edm" version="5.6.0" targetFramework="net40" />
<package id="Microsoft.Data.OData" version="5.6.0" targetFramework="net40" />
<package id="Microsoft.Data.Services.Client" version="5.6.0" targetFramework="net40" />
<package id="Microsoft.Net.Http" version="2.2.20" targetFramework="net40" />
<package id="Microsoft.WindowsAzure.ConfigurationManager" version="2.0.3" targetFramework="net40" />
<package id="Newtonsoft.Json" version="6.0.3" targetFramework="net40" />
<package id="SendGrid.SmtpApiPlus" version="1.0.1" targetFramework="net40" />
<package id="SendGridPlus" version="4.1" targetFramework="net40" />
<package id="System.Spatial" version="5.6.0" targetFramework="net40" />
<package id="tangible.HybrisOnAzure.Toolbox" version="1.0.0" targetFramework="net40" />
<package id="WindowsAzure.ServiceBus" version="2.4.2.0" targetFramework="net40" />
<package id="WindowsAzure.Storage" version="4.2.1" targetFramework="net40" />
</packages>

Просмотреть файл

@ -0,0 +1,119 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.31101.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{CC5FD16D-436D-48AD-A40C-5A424C6E3E79}") = "MicrosoftDXGermany.hybrisOnAzure", "MicrosoftDXGermany.hybrisOnAzure\MicrosoftDXGermany.hybrisOnAzure.ccproj", "{F8D5DD80-FE0E-4E10-BF7C-8D6F6D011061}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MicrosoftDXGermany.hybrisOnAzure.ArrRole", "MicrosoftDXGermany.hybrisOnAzure.ArrRole\MicrosoftDXGermany.hybrisOnAzure.ArrRole.csproj", "{78814B2B-8552-40CA-A30F-FA4E938BEE77}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MicrosoftDXGermany.hybrisOnAzure.BackOfficeWorkerRole", "MicrosoftDXGermany.hybrisOnAzure.BackOfficeWorkerRole\MicrosoftDXGermany.hybrisOnAzure.BackOfficeWorkerRole.csproj", "{B9C8E96A-2AC7-4EE6-A004-4BFED0456B6B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MicrosoftDXGermany.hybrisOnAzure.Common", "MicrosoftDXGermany.hybrisOnAzure.Common\MicrosoftDXGermany.hybrisOnAzure.Common.csproj", "{B610504C-AFF3-4E15-B1C5-5EE1D284F2A1}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{2EEF371C-90F4-4B4F-85F9-08562E6FEA3B}"
ProjectSection(SolutionItems) = preProject
LICENSE.txt = LICENSE.txt
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Run a JAR on startup", "Run a JAR on startup", "{3AB92771-0F5F-48C7-9884-F5BA2C2BDA1B}"
ProjectSection(SolutionItems) = preProject
Solution Items\Run a JAR on startup\README.txt = Solution Items\Run a JAR on startup\README.txt
Solution Items\Run a JAR on startup\RunJar.cmd = Solution Items\Run a JAR on startup\RunJar.cmd
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Additional Configuration", "Additional Configuration", "{E49A4795-92ED-40C2-80C7-FF106D648787}"
ProjectSection(SolutionItems) = preProject
Solution Items\Additional Configuration\configuration.xml = Solution Items\Additional Configuration\configuration.xml
Solution Items\Additional Configuration\README.txt = Solution Items\Additional Configuration\README.txt
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Application Request Routing", "Application Request Routing", "{C1D2BDA0-04D0-4B4F-9F00-89A9FFF753F8}"
ProjectSection(SolutionItems) = preProject
Solution Items\Application Request Routing\README.txt = Solution Items\Application Request Routing\README.txt
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "AzureFiles", "AzureFiles", "{D0B0AB92-6E85-4A91-B921-C78B76559B8C}"
ProjectSection(SolutionItems) = preProject
Solution Items\AzureFiles\ConnectAzureFiles.cmd = Solution Items\AzureFiles\ConnectAzureFiles.cmd
Solution Items\AzureFiles\README.txt = Solution Items\AzureFiles\README.txt
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Custom maintenance page", "Custom maintenance page", "{8CC4388A-0ADD-4D13-9FF3-40A65FEF9845}"
ProjectSection(SolutionItems) = preProject
Solution Items\Custom maintenance page\maintenance.html = Solution Items\Custom maintenance page\maintenance.html
Solution Items\Custom maintenance page\README.txt = Solution Items\Custom maintenance page\README.txt
Solution Items\Custom maintenance page\web.config = Solution Items\Custom maintenance page\web.config
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Java Runtime", "Java Runtime", "{B587BEF0-ADEA-419F-85CA-9CCD2FB36258}"
ProjectSection(SolutionItems) = preProject
Solution Items\Java Runtime\README.txt = Solution Items\Java Runtime\README.txt
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "JDBC Driver", "JDBC Driver", "{08FD80BB-ED2F-4E3A-A4C2-2521C8C67B30}"
ProjectSection(SolutionItems) = preProject
Solution Items\JDBC Driver\JDBCSetup.cmd = Solution Items\JDBC Driver\JDBCSetup.cmd
Solution Items\JDBC Driver\README.txt = Solution Items\JDBC Driver\README.txt
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MicrosoftDXGermany.hybrisOnAzure.FrontendWorkerRole", "MicrosoftDXGermany.hybrisOnAzure.FrondendWorkerRole\MicrosoftDXGermany.hybrisOnAzure.FrontendWorkerRole.csproj", "{039A0059-8BC8-40B6-AC67-EF8389763E57}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{C53B130C-8D1E-474B-8746-D4DB6075B99B}"
ProjectSection(SolutionItems) = preProject
.nuget\NuGet.Config = .nuget\NuGet.Config
.nuget\NuGet.exe = .nuget\NuGet.exe
.nuget\NuGet.targets = .nuget\NuGet.targets
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
x64|Any CPU = x64|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{F8D5DD80-FE0E-4E10-BF7C-8D6F6D011061}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F8D5DD80-FE0E-4E10-BF7C-8D6F6D011061}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F8D5DD80-FE0E-4E10-BF7C-8D6F6D011061}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F8D5DD80-FE0E-4E10-BF7C-8D6F6D011061}.Release|Any CPU.Build.0 = Release|Any CPU
{F8D5DD80-FE0E-4E10-BF7C-8D6F6D011061}.x64|Any CPU.ActiveCfg = Release|Any CPU
{F8D5DD80-FE0E-4E10-BF7C-8D6F6D011061}.x64|Any CPU.Build.0 = Release|Any CPU
{78814B2B-8552-40CA-A30F-FA4E938BEE77}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{78814B2B-8552-40CA-A30F-FA4E938BEE77}.Debug|Any CPU.Build.0 = Debug|Any CPU
{78814B2B-8552-40CA-A30F-FA4E938BEE77}.Release|Any CPU.ActiveCfg = Release|Any CPU
{78814B2B-8552-40CA-A30F-FA4E938BEE77}.Release|Any CPU.Build.0 = Release|Any CPU
{78814B2B-8552-40CA-A30F-FA4E938BEE77}.x64|Any CPU.ActiveCfg = Release|Any CPU
{78814B2B-8552-40CA-A30F-FA4E938BEE77}.x64|Any CPU.Build.0 = Release|Any CPU
{B9C8E96A-2AC7-4EE6-A004-4BFED0456B6B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B9C8E96A-2AC7-4EE6-A004-4BFED0456B6B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B9C8E96A-2AC7-4EE6-A004-4BFED0456B6B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B9C8E96A-2AC7-4EE6-A004-4BFED0456B6B}.Release|Any CPU.Build.0 = Release|Any CPU
{B9C8E96A-2AC7-4EE6-A004-4BFED0456B6B}.x64|Any CPU.ActiveCfg = Release|Any CPU
{B9C8E96A-2AC7-4EE6-A004-4BFED0456B6B}.x64|Any CPU.Build.0 = Release|Any CPU
{B610504C-AFF3-4E15-B1C5-5EE1D284F2A1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B610504C-AFF3-4E15-B1C5-5EE1D284F2A1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B610504C-AFF3-4E15-B1C5-5EE1D284F2A1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B610504C-AFF3-4E15-B1C5-5EE1D284F2A1}.Release|Any CPU.Build.0 = Release|Any CPU
{B610504C-AFF3-4E15-B1C5-5EE1D284F2A1}.x64|Any CPU.ActiveCfg = Release|Any CPU
{B610504C-AFF3-4E15-B1C5-5EE1D284F2A1}.x64|Any CPU.Build.0 = Release|Any CPU
{039A0059-8BC8-40B6-AC67-EF8389763E57}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{039A0059-8BC8-40B6-AC67-EF8389763E57}.Debug|Any CPU.Build.0 = Debug|Any CPU
{039A0059-8BC8-40B6-AC67-EF8389763E57}.Release|Any CPU.ActiveCfg = Release|Any CPU
{039A0059-8BC8-40B6-AC67-EF8389763E57}.Release|Any CPU.Build.0 = Release|Any CPU
{039A0059-8BC8-40B6-AC67-EF8389763E57}.x64|Any CPU.ActiveCfg = Release|Any CPU
{039A0059-8BC8-40B6-AC67-EF8389763E57}.x64|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{3AB92771-0F5F-48C7-9884-F5BA2C2BDA1B} = {2EEF371C-90F4-4B4F-85F9-08562E6FEA3B}
{E49A4795-92ED-40C2-80C7-FF106D648787} = {2EEF371C-90F4-4B4F-85F9-08562E6FEA3B}
{C1D2BDA0-04D0-4B4F-9F00-89A9FFF753F8} = {2EEF371C-90F4-4B4F-85F9-08562E6FEA3B}
{D0B0AB92-6E85-4A91-B921-C78B76559B8C} = {2EEF371C-90F4-4B4F-85F9-08562E6FEA3B}
{8CC4388A-0ADD-4D13-9FF3-40A65FEF9845} = {2EEF371C-90F4-4B4F-85F9-08562E6FEA3B}
{B587BEF0-ADEA-419F-85CA-9CCD2FB36258} = {2EEF371C-90F4-4B4F-85F9-08562E6FEA3B}
{08FD80BB-ED2F-4E3A-A4C2-2521C8C67B30} = {2EEF371C-90F4-4B4F-85F9-08562E6FEA3B}
EndGlobalSection
EndGlobal

Просмотреть файл

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<DiagnosticMonitorConfiguration configurationChangePollInterval="PT1M" overallQuotaInMB="4096" xmlns="http://schemas.microsoft.com/ServiceHosting/2010/10/DiagnosticsConfiguration">
<DiagnosticInfrastructureLogs />
<Directories>
<IISLogs container="wad-iis-logfiles" directoryQuotaInMB="1024" />
<CrashDumps container="wad-crash-dumps" />
</Directories>
<Logs bufferQuotaInMB="1024" scheduledTransferPeriod="PT1M" scheduledTransferLogLevelFilter="Error" />
<WindowsEventLog bufferQuotaInMB="1024" scheduledTransferPeriod="PT1M" scheduledTransferLogLevelFilter="Error">
<DataSource name="Application!*" />
</WindowsEventLog>
<PerformanceCounters bufferQuotaInMB="512" scheduledTransferPeriod="PT0M">
<PerformanceCounterConfiguration counterSpecifier="\Memory\Available MBytes" sampleRate="PT3M" />
<PerformanceCounterConfiguration counterSpecifier="\Web Service(_Total)\ISAPI Extension Requests/sec" sampleRate="PT3M"/>
<PerformanceCounterConfiguration counterSpecifier="\Web Service(_Total)\Bytes Total/Sec" sampleRate="PT3M"/>
<PerformanceCounterConfiguration counterSpecifier="\ASP.NET Applications(__Total__)\Requests/Sec" sampleRate="PT3M"/>
<PerformanceCounterConfiguration counterSpecifier="\ASP.NET Applications(__Total__)\Errors Total/Sec" sampleRate="PT3M"/>
<PerformanceCounterConfiguration counterSpecifier="\ASP.NET\Requests Queued" sampleRate="PT3M"/>
<PerformanceCounterConfiguration counterSpecifier="\ASP.NET\Requests Rejected" sampleRate="PT3M"/>
</PerformanceCounters>
</DiagnosticMonitorConfiguration>

Просмотреть файл

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<DiagnosticMonitorConfiguration configurationChangePollInterval="PT1M" overallQuotaInMB="4096" xmlns="http://schemas.microsoft.com/ServiceHosting/2010/10/DiagnosticsConfiguration">
<DiagnosticInfrastructureLogs />
<Directories>
<IISLogs container="wad-iis-logfiles" directoryQuotaInMB="1024" />
<CrashDumps container="wad-crash-dumps" />
</Directories>
<Logs bufferQuotaInMB="1024" scheduledTransferPeriod="PT1M" scheduledTransferLogLevelFilter="Error" />
<WindowsEventLog bufferQuotaInMB="1024" scheduledTransferPeriod="PT1M" scheduledTransferLogLevelFilter="Error">
<DataSource name="Application!*" />
</WindowsEventLog>
<PerformanceCounters bufferQuotaInMB="512" scheduledTransferPeriod="PT0M">
<PerformanceCounterConfiguration counterSpecifier="\Memory\Available MBytes" sampleRate="PT3M" />
<PerformanceCounterConfiguration counterSpecifier="\Web Service(_Total)\ISAPI Extension Requests/sec" sampleRate="PT3M"/>
<PerformanceCounterConfiguration counterSpecifier="\Web Service(_Total)\Bytes Total/Sec" sampleRate="PT3M"/>
<PerformanceCounterConfiguration counterSpecifier="\ASP.NET Applications(__Total__)\Requests/Sec" sampleRate="PT3M"/>
<PerformanceCounterConfiguration counterSpecifier="\ASP.NET Applications(__Total__)\Errors Total/Sec" sampleRate="PT3M"/>
<PerformanceCounterConfiguration counterSpecifier="\ASP.NET\Requests Queued" sampleRate="PT3M"/>
<PerformanceCounterConfiguration counterSpecifier="\ASP.NET\Requests Rejected" sampleRate="PT3M"/>
</PerformanceCounters>
</DiagnosticMonitorConfiguration>

Просмотреть файл

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<DiagnosticMonitorConfiguration configurationChangePollInterval="PT1M" overallQuotaInMB="4096" xmlns="http://schemas.microsoft.com/ServiceHosting/2010/10/DiagnosticsConfiguration">
<DiagnosticInfrastructureLogs />
<Directories>
<IISLogs container="wad-iis-logfiles" directoryQuotaInMB="1024" />
<CrashDumps container="wad-crash-dumps" />
</Directories>
<Logs bufferQuotaInMB="1024" scheduledTransferPeriod="PT1M" scheduledTransferLogLevelFilter="Error" />
<WindowsEventLog bufferQuotaInMB="1024" scheduledTransferPeriod="PT1M" scheduledTransferLogLevelFilter="Error">
<DataSource name="Application!*" />
</WindowsEventLog>
<PerformanceCounters bufferQuotaInMB="512" scheduledTransferPeriod="PT0M">
<PerformanceCounterConfiguration counterSpecifier="\Memory\Available MBytes" sampleRate="PT3M" />
<PerformanceCounterConfiguration counterSpecifier="\Web Service(_Total)\ISAPI Extension Requests/sec" sampleRate="PT3M"/>
<PerformanceCounterConfiguration counterSpecifier="\Web Service(_Total)\Bytes Total/Sec" sampleRate="PT3M"/>
<PerformanceCounterConfiguration counterSpecifier="\ASP.NET Applications(__Total__)\Requests/Sec" sampleRate="PT3M"/>
<PerformanceCounterConfiguration counterSpecifier="\ASP.NET Applications(__Total__)\Errors Total/Sec" sampleRate="PT3M"/>
<PerformanceCounterConfiguration counterSpecifier="\ASP.NET\Requests Queued" sampleRate="PT3M"/>
<PerformanceCounterConfiguration counterSpecifier="\ASP.NET\Requests Rejected" sampleRate="PT3M"/>
</PerformanceCounters>
</DiagnosticMonitorConfiguration>

Просмотреть файл

@ -0,0 +1,90 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>2.4</ProductVersion>
<ProjectGuid>f8d5dd80-fe0e-4e10-bf7c-8d6f6d011061</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>MicrosoftDXGermany.hybrisOnAzure</RootNamespace>
<AssemblyName>MicrosoftDXGermany.hybrisOnAzure</AssemblyName>
<StartDevelopmentStorage>True</StartDevelopmentStorage>
<Name>MicrosoftDXGermany.hybrisOnAzure</Name>
<PackageEnableRemoteDebugger>False</PackageEnableRemoteDebugger>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<!-- Items for the project -->
<ItemGroup>
<ServiceConfiguration Include="ServiceConfiguration.Raw.cscfg" />
<ServiceDefinition Include="ServiceDefinition.csdef" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\MicrosoftDXGermany.hybrisOnAzure.ArrRole\MicrosoftDXGermany.hybrisOnAzure.ArrRole.csproj">
<Name>MicrosoftDXGermany.hybrisOnAzure.ArrRole</Name>
<Project>{78814b2b-8552-40ca-a30f-fa4e938bee77}</Project>
<Private>True</Private>
<RoleType>Web</RoleType>
<RoleName>MicrosoftDXGermany.hybrisOnAzure.ArrRole</RoleName>
</ProjectReference>
<ProjectReference Include="..\MicrosoftDXGermany.hybrisOnAzure.BackOfficeWorkerRole\MicrosoftDXGermany.hybrisOnAzure.BackOfficeWorkerRole.csproj">
<Name>MicrosoftDXGermany.hybrisOnAzure.BackOfficeWorkerRole</Name>
<Project>{b9c8e96a-2ac7-4ee6-a004-4bfed0456b6b}</Project>
<Private>True</Private>
<RoleType>Web</RoleType>
<RoleName>MicrosoftDXGermany.hybrisOnAzure.BackOfficeWorkerRole</RoleName>
</ProjectReference>
<ProjectReference Include="..\MicrosoftDXGermany.hybrisOnAzure.FrondendWorkerRole\MicrosoftDXGermany.hybrisOnAzure.FrontendWorkerRole.csproj">
<Name>MicrosoftDXGermany.hybrisOnAzure.FrontendWorkerRole</Name>
<Project>{039a0059-8bc8-40b6-ac67-ef8389763e57}</Project>
<Private>True</Private>
<RoleType>Worker</RoleType>
<RoleName>MicrosoftDXGermany.hybrisOnAzure.FrontendWorkerRole</RoleName>
<UpdateDiagnosticsConnectionStringOnPublish>True</UpdateDiagnosticsConnectionStringOnPublish>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Folder Include="Profiles" />
<Folder Include="MicrosoftDXGermany.hybrisOnAzure.ArrRoleContent" />
<Folder Include="MicrosoftDXGermany.hybrisOnAzure.BackOfficeWorkerRoleContent" />
<Folder Include="MicrosoftDXGermany.hybrisOnAzure.FrontendWorkerRoleContent" />
</ItemGroup>
<ItemGroup>
<Content Include="MicrosoftDXGermany.hybrisOnAzure.ArrRoleContent\diagnostics.wadcfg">
<SubType>Content</SubType>
</Content>
<Content Include="MicrosoftDXGermany.hybrisOnAzure.BackOfficeWorkerRoleContent\diagnostics.wadcfg">
<SubType>Content</SubType>
</Content>
<Content Include="MicrosoftDXGermany.hybrisOnAzure.FrontendWorkerRoleContent\diagnostics.wadcfg">
<SubType>Content</SubType>
</Content>
</ItemGroup>
<ItemGroup>
<PublishProfile Include="Profiles\tangiblehybristestProduction.azurePubxml" />
<PublishProfile Include="Profiles\hybrisDemo.azurePubxml" />
</ItemGroup>
<!-- Import the target files for this project template -->
<PropertyGroup>
<VisualStudioVersion Condition=" '$(VisualStudioVersion)' == '' ">10.0</VisualStudioVersion>
<CloudExtensionsDir Condition=" '$(CloudExtensionsDir)' == '' ">$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\Windows Azure Tools\2.4\</CloudExtensionsDir>
</PropertyGroup>
<Import Project="$(CloudExtensionsDir)Microsoft.WindowsAzure.targets" />
</Project>

Просмотреть файл

@ -0,0 +1,131 @@
<?xml version="1.0" encoding="utf-8"?>
<ServiceConfiguration serviceName="MicrosoftDXGermany.HybrisOnAzure" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceConfiguration" osFamily="4" osVersion="*" schemaVersion="2014-06.2.4">
<Role name="MicrosoftDXGermany.hybrisOnAzure.ArrRole">
<Instances count="1" />
<ConfigurationSettings>
<Setting name="StorageConnectionString" value="DefaultEndpointsProtocol=https;AccountName=hybristest;AccountKey=km345cWrdfFvfQ1gtzc0pXSLLv0bA9jQGoE2WOQmCVp/xlrY5lVsAY/TXgTioMtuXwuqheepJJzhdriL0YxBmQfg==" />
<Setting name="Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString" value="DefaultEndpointsProtocol=https;AccountName=hybristest;AccountKey=km345cWrdfFvfQ1gtzc0pXSLLv0bA9jQGoE2WOQmCVp/xlrY5lVsAY/TXgTioMtuXwuqheepJJzhdriL0YxBmQfg==" />
<Setting name="tangible.Azure.Trace.EnableServiceBusTracing" value="True" />
<Setting name="tangible.Azure.Trace.ServicePath" value="trace" />
<Setting name="tangible.Azure.Trace.ServiceNamespace" value="tangiblehybristest" />
<Setting name="tangible.Azure.Trace.Credentials.IssuerName" value="owner" />
<Setting name="tangible.Azure.Trace.Credentials.IssuerSecret" value="dd6XpFJSdf6hQ8dbcb4dOrYSNjUh3ryszInvbtaSdm4TU=" />
<!-- Per default those trace level exist: 0 (Error), 10 (Warning), 20 (Information), 30 (Verbose) -->
<Setting name="tangible.Azure.Trace.MaxTraceLevel" value="100" />
<Setting name="tangible.Azure.Startup.Download.Downloads" value="deployment/ARR30.zip|C:\Setups\ApplicationRequestRouting|true;deployment/customMaintenance.zip|E:\sitesroot\0|true" />
<!-- Commands will be Executed in: E:\approot -->
<Setting name="tangible.Azure.Startup.StartupCommands.Commands" value="C:\Setups\ApplicationRequestRouting\startup.cmd|10000|true;C:\Setups\ApplicationRequestRouting\ConfigWebFarm.cmd|10000" />
<Setting name="tangible.Azure.Startup.PatchFiles.Files" value="" />
<Setting name="tangible.Azure.ARR.IPRangeEnabled" value="True" />
<Setting name="tangible.Azure.ARR.IPRange" value="10.11.5.4-10.11.5.254" />
<Setting name="tangible.Azure.ARR.WebFarmRoleName" value="MicrosoftDXGermany.HybrisOnAzure.FrontendWorkerRole" />
<Setting name="tangible.Azure.ARR.WebFarmEndpointName" value="TomcatHttp" />
<Setting name="tangible.Azure.ARR.WebFarmName" value="AzureWebFarm" />
<Setting name="tangible.Azure.ARR.HealthCheckUrl" value="http://localhost:9001/login.jsp" />
<Setting name="tangible.Azure.ARR.HealthCheckResponseMatch" value="body" />
<Setting name="tangible.Azure.ARR.HealthCheckFile" value="Z:\healthcheck.htm" />
<Setting name="tangible.Azure.ARR.HealthCheckInterval" value="00:00:05" />
<Setting name="tangible.Azure.ARR.HealthCheckTimeout" value="00:01:00" />
<Setting name="tangible.Azure.AdditionalConfiguration" value="config/configuration.xml" />
</ConfigurationSettings>
<Certificates>
<Certificate name="SSL-Certificate" thumbprint="E71670B5C128B2747335EF443E67C8C85349BBA6" thumbprintAlgorithm="sha1" />
</Certificates>
</Role>
<Role name="MicrosoftDXGermany.hybrisOnAzure.FrontendWorkerRole">
<Instances count="1" />
<ConfigurationSettings>
<Setting name="StorageConnectionString" value="DefaultEndpointsProtocol=https;AccountName=hybristest;AccountKey=km345cWrdfFvfQ1gtzc0pXSLLv0bA9jQGoE2WOQmCVp/xlrY5lVsAY/TXgTioMtuXwuqheepJJzhdriL0YxBmQfg==" />
<Setting name="tangible.Azure.Trace.EnableServiceBusTracing" value="True" />
<Setting name="tangible.Azure.Trace.ServicePath" value="trace" />
<Setting name="tangible.Azure.Trace.ServiceNamespace" value="tangiblehybristest" />
<Setting name="tangible.Azure.Trace.Credentials.IssuerName" value="owner" />
<Setting name="tangible.Azure.Trace.Credentials.IssuerSecret" value="dd6XpFJSdf6hQ8dbcb4dOrYSNjUh3ryszInvbtaSdm4TU=" />
<!-- Per default those trace level exist: 0 (Error), 10 (Warning), 20 (Information), 30 (Verbose) -->
<Setting name="tangible.Azure.Trace.MaxTraceLevel" value="100" />
<Setting name="tangible.Azure.Startup.Download.Downloads" value="deployment/java.zip|%ProgramFiles%\Java|true;deployment/JDBCSetup.cmd|C:\Setups|false;deployment/hybrisServer-AllExtensions.zip|C:\Applications|true;deployment/hybrisServer-Platform.zip|C:\Applications|true;deployment/hybrisServer-Config.zip|C:\Applications|true;/deployment/solr.zip|C:\Applications\solr|true;/deployment/solrconfig.xml|C:\Applications\solr\conf|false;deployment/solrserver.bat|C:\Applications\solr|false;deployment/RunJar.zip|C:\Applications\RunJar|true;" />
<!-- Commands will be Executed in: E:\approot -->
<Setting name="tangible.Azure.Startup.StartupCommands.Commands" value="C:\Setups\JDBCSetup.cmd|10000;C:\Applications\RunJar\RunJar.cmd|30000|true;" />
<Setting name="tangible.Azure.Startup.PatchFiles.Files" value="C:\Applications\solr\solrserver.bat;C:\Applications\solr\conf\solrconfig.xml" />
<Setting name="tangible.Azure.AdditionalConfiguration" value="config/configuration.xml" />
<!-- Path where Solr & Hybris have been downloaded to -->
<Setting name="HybrisOnAzure.BaseDirectory" value="C:\Applications" />
<Setting name="HybrisOnAzure.JavaHomeDirectory" value="%ProgramFiles%\Java" />
<Setting name="HybrisOnAzure.JavaProcessShutdownWaitMinutes" value="2" />
<Setting name="HybrisOnAzure.StartSolrPlugin" value="true" />
<Setting name="HybrisOnAzure.IndexMaster" value="false"/>
<Setting name="HybrisOnAzure.IndexSlave" value="true" />
<Setting name="Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString" value="DefaultEndpointsProtocol=https;AccountName=hybristest;AccountKey=km345cWrdfFvfQ1gtzc0pXSLLv0bA9jQGoE2WOQmCVp/xlrY5lVsAY/TXgTioMtuXwuqheepJJzhdriL0YxBmQfg==" />
</ConfigurationSettings>
<Certificates>
</Certificates>
</Role>
<Role name="MicrosoftDXGermany.hybrisOnAzure.BackOfficeWorkerRole">
<Instances count="1" />
<ConfigurationSettings>
<Setting name="StorageConnectionString" value="DefaultEndpointsProtocol=https;AccountName=hybristest;AccountKey=km345cWrdfFvfQ1gtzc0pXSLLv0bA9jQGoE2WOQmCVp/xlrY5lVsAY/TXgTioMtuXwuqheepJJzhdriL0YxBmQfg==" />
<Setting name="tangible.Azure.Trace.EnableServiceBusTracing" value="True" />
<Setting name="tangible.Azure.Trace.ServicePath" value="trace" />
<Setting name="tangible.Azure.Trace.ServiceNamespace" value="tangiblehybristest" />
<Setting name="tangible.Azure.Trace.Credentials.IssuerName" value="owner" />
<Setting name="tangible.Azure.Trace.Credentials.IssuerSecret" value="dd6XpFJSdf6hQ8dbcb4dOrYSNjUh3ryszInvbtaSdm4TU=" />
<!-- Per default those trace level exist: 0 (Error), 10 (Warning), 20 (Information), 30 (Verbose) -->
<Setting name="tangible.Azure.Trace.MaxTraceLevel" value="100" />
<Setting name="tangible.Azure.Startup.Download.Downloads" value="deployment/ARR30.zip|C:\Setups\ApplicationRequestRouting|true;deployment/java.zip|%ProgramFiles%\Java|true;deployment/JDBCSetup.cmd|C:\Setups|false;deployment/hybrisServer-AllExtensions.zip|C:\Applications|true;deployment/hybrisServer-Platform.zip|C:\Applications|true;deployment/hybrisServer-Config.zip|C:\Applications|true;;/deployment/solr.zip|C:\Applications\solr|true;/deployment/solrconfig.xml|C:\Applications\solr\conf|false;deployment/solrserver.bat|C:\Applications\solr|false;deployment/RunJar.zip|C:\Applications\RunJar|true;deployment/ConnectAzureFiles.cmd|C:\Setups|false" />
<!-- Commands will be Executed in: E:\approot -->
<Setting name="tangible.Azure.Startup.StartupCommands.Commands" value="C:\Setups\ApplicationRequestRouting\startup.cmd|10000|true;C:\Setups\ApplicationRequestRouting\ConfigWebFarm.cmd|10000;C:\Setups\JDBCSetup.cmd|10000;C:\Setups\ConnectAzureFiles.cmd|30000;C:\Applications\RunJar\RunJar.cmd|30000|true;" />
<Setting name="tangible.Azure.Startup.PatchFiles.Files" value="C:\Applications\solr\solrserver.bat;C:\Applications\solr\conf\solrconfig.xml" />
<Setting name="tangible.Azure.AdditionalConfiguration" value="config/configuration.xml" />
<Setting name="HybrisOnAzure.DeploymentSlot" value="production" />
<Setting name="HybrisOnAzure.SubscriptionId" value="67777c0e-1df9-4e8d-9f58-7d7409d9543e" />
<Setting name="HybrisOnAzure.ManagementCertThumb" value="60E7ED6E18CD1EFD60534D33952ECD562B6C2C37" />
<Setting name="HybrisOnAzure.HostedServiceName" value="tangiblehybristest" />
<!-- Path where Solr & Hybris have been downloaded to -->
<Setting name="HybrisOnAzure.BaseDirectory" value="C:\Applications" />
<Setting name="HybrisOnAzure.JavaHomeDirectory" value="%ProgramFiles%\Java" />
<Setting name="HybrisOnAzure.JavaProcessShutdownWaitMinutes" value="2" />
<Setting name="HybrisOnAzure.BackOfficeShare.DesiredDrive" value="s:" />
<Setting name="HybrisOnAzure.BackOfficeShare.AccountName" value="hybristest" />
<Setting name="HybrisOnAzure.BackOfficeShare.AccountKey" value="km345dfcWrFvfQ1gtzc0pXSLLv0bA9jQGoE2WOQmCVp/xlrY5lVsAY/TXgTioMtuXwuqheepJJzhdriL0YxBmQfg==" />
<Setting name="HybrisOnAzure.BackOfficeShare.ShareName" value="sharetest" />
<Setting name="HybrisOnAzure.StartSolrPlugin" value="true" />
<Setting name="HybrisOnAzure.IndexMaster" value="true" />
<Setting name="HybrisOnAzure.IndexSlave" value="false" />
<Setting name="tangible.Azure.ARR.IPRangeEnabled" value="True" />
<Setting name="tangible.Azure.ARR.IPRange" value="10.11.5.4-10.11.5.254" />
<Setting name="tangible.Azure.ARR.WebFarmRoleName" value="tangible.HybrisOnAzure.BackOfficeWorkerRole" />
<Setting name="tangible.Azure.ARR.WebFarmEndpointName" value="TomcatHttp" />
<Setting name="tangible.Azure.ARR.WebFarmName" value="AzureWebFarm" />
<Setting name="tangible.Azure.ARR.HealthCheckUrl" value="http://localhost:9001/login.jsp" />
<Setting name="tangible.Azure.ARR.HealthCheckResponseMatch" value="body" />
<Setting name="tangible.Azure.ARR.HealthCheckFile" value="Z:\healthcheck.htm" />
<Setting name="tangible.Azure.ARR.HealthCheckInterval" value="00:00:05" />
<Setting name="tangible.Azure.ARR.HealthCheckTimeout" value="00:01:00" />
<Setting name="Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString" value="DefaultEndpointsProtocol=https;AccountName=hybristest;AccountKey=km345cWrdfFvfQ1gtzc0pXSLLv0bA9jQGoE2WOQmCVp/xlrY5lVsAY/TXgTioMtuXwuqheepJJzhdriL0YxBmQfg==" />
</ConfigurationSettings>
<Certificates>
<Certificate name="ServiceWrapperManagementCertificate" thumbprint="60E7ED6E18CD1EFD60534D33952ECD562B6C2C37" thumbprintAlgorithm="sha1" />
<Certificate name="SSL-Certificate" thumbprint="E71670B5C128B2747335EF443E67C8C85349BBA6" thumbprintAlgorithm="sha1" />
</Certificates>
</Role>
<NetworkConfiguration>
<VirtualNetworkSite name="hybristest" />
<AddressAssignments>
<InstanceAddress roleName="MicrosoftDXGermany.HybrisOnAzure.ArrRole">
<Subnets>
<Subnet name="ArrNet" />
</Subnets>
</InstanceAddress>
<InstanceAddress roleName="MicrosoftDXGermany.HybrisOnAzure.FrontendWorkerRole">
<Subnets>
<Subnet name="FrontendNet" />
</Subnets>
</InstanceAddress>
<InstanceAddress roleName="MicrosoftDXGermany.HybrisOnAzure.BackOfficeWorkerRole">
<Subnets>
<Subnet name="FrontendNet" />
</Subnets>
</InstanceAddress>
</AddressAssignments>
</NetworkConfiguration>
</ServiceConfiguration>

Просмотреть файл

@ -0,0 +1,167 @@
<?xml version="1.0" encoding="utf-8"?>
<ServiceDefinition name="MicrosoftDXGermany.HybrisOnAzure" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition" schemaVersion="2014-06.2.4" upgradeDomainCount="2">
<WebRole name="MicrosoftDXGermany.hybrisOnAzure.ArrRole" vmsize="Medium">
<Runtime executionContext="elevated" />
<Sites>
<Site name="Web">
<Bindings>
<Binding name="HttpInBinding" endpointName="HttpIn" />
<Binding name="HttpsInBinding" endpointName="HttpsIn" />
</Bindings>
</Site>
</Sites>
<Endpoints>
<InputEndpoint name="HttpIn" protocol="http" port="80" />
<InputEndpoint name="HttpsIn" protocol="https" port="443" certificate="SSL-Certificate" />
<InternalEndpoint name="PluginStatus" protocol="tcp" port="12345" />
</Endpoints>
<ConfigurationSettings>
<Setting name="StorageConnectionString" />
<Setting name="tangible.Azure.Trace.EnableServiceBusTracing" />
<Setting name="tangible.Azure.Trace.ServicePath" />
<Setting name="tangible.Azure.Trace.ServiceNamespace" />
<Setting name="tangible.Azure.Trace.Credentials.IssuerName" />
<Setting name="tangible.Azure.Trace.Credentials.IssuerSecret" />
<Setting name="tangible.Azure.Trace.MaxTraceLevel" />
<Setting name="tangible.Azure.Startup.Download.Downloads" />
<Setting name="tangible.Azure.Startup.StartupCommands.Commands" />
<Setting name="tangible.Azure.Startup.PatchFiles.Files" />
<Setting name="tangible.Azure.ARR.IPRangeEnabled" />
<Setting name="tangible.Azure.ARR.IPRange" />
<Setting name="tangible.Azure.ARR.WebFarmRoleName" />
<Setting name="tangible.Azure.ARR.WebFarmEndpointName" />
<Setting name="tangible.Azure.ARR.WebFarmName" />
<Setting name="tangible.Azure.ARR.HealthCheckUrl" />
<Setting name="tangible.Azure.ARR.HealthCheckResponseMatch" />
<Setting name="tangible.Azure.ARR.HealthCheckFile" />
<Setting name="tangible.Azure.ARR.HealthCheckInterval" />
<Setting name="tangible.Azure.ARR.HealthCheckTimeout" />
<Setting name="tangible.Azure.AdditionalConfiguration" />
</ConfigurationSettings>
<Imports>
<Import moduleName="Diagnostics" />
</Imports>
<Certificates>
<Certificate name="SSL-Certificate" storeLocation="LocalMachine" storeName="My" />
</Certificates>
<LocalResources>
<LocalStorage name="tangible.Azure.Startup.Download.DownloadCache" cleanOnRoleRecycle="true" sizeInMB="5000" />
<LocalStorage name="tangible.Azure.Startup.StartupCommands.Cache" cleanOnRoleRecycle="true" sizeInMB="100" />
<LocalStorage name="tangible.Azure.AdditionalConfiguration" cleanOnRoleRecycle="false" sizeInMB="10" />
</LocalResources>
</WebRole>
<WorkerRole name="MicrosoftDXGermany.hybrisOnAzure.FrontendWorkerRole" vmsize="Standard_D4">
<Runtime executionContext="elevated" />
<Endpoints>
<InternalEndpoint name="TomcatHttp" protocol="tcp" port="9001" />
<InternalEndpoint name="TomcatHttps" protocol="tcp" port="9002" />
<InternalEndpoint name="InvalidateJGroup" protocol="tcp" port="7800" />
<InternalEndpoint name="Management" protocol="http" port="8081" />
<InternalEndpoint name="Solr" protocol="tcp" port="8983" />
<InternalEndpoint name="SolrStop" protocol="tcp" port="8985" />
<InternalEndpoint name="PluginStatus" protocol="tcp" port="12345" />
</Endpoints>
<ConfigurationSettings>
<Setting name="StorageConnectionString" />
<Setting name="tangible.Azure.Trace.EnableServiceBusTracing" />
<Setting name="tangible.Azure.Trace.ServicePath" />
<Setting name="tangible.Azure.Trace.ServiceNamespace" />
<Setting name="tangible.Azure.Trace.Credentials.IssuerName" />
<Setting name="tangible.Azure.Trace.Credentials.IssuerSecret" />
<Setting name="tangible.Azure.Trace.MaxTraceLevel" />
<Setting name="tangible.Azure.Startup.Download.Downloads" />
<Setting name="tangible.Azure.Startup.StartupCommands.Commands" />
<Setting name="tangible.Azure.Startup.PatchFiles.Files" />
<Setting name="tangible.Azure.AdditionalConfiguration" />
<Setting name="HybrisOnAzure.BaseDirectory" />
<Setting name="HybrisOnAzure.JavaHomeDirectory" />
<Setting name="HybrisOnAzure.JavaProcessShutdownWaitMinutes" />
<Setting name="HybrisOnAzure.StartSolrPlugin" />
<Setting name="HybrisOnAzure.IndexMaster" />
<Setting name="HybrisOnAzure.IndexSlave" />
</ConfigurationSettings>
<Imports>
<Import moduleName="Diagnostics" />
</Imports>
<LocalResources>
<LocalStorage name="tangible.Azure.Startup.Download.DownloadCache" cleanOnRoleRecycle="true" sizeInMB="5000" />
<LocalStorage name="tangible.Azure.Startup.StartupCommands.Cache" cleanOnRoleRecycle="true" sizeInMB="100" />
<LocalStorage name="tangible.Azure.AdditionalConfiguration" cleanOnRoleRecycle="false" sizeInMB="10" />
<LocalStorage name="HybrisOnAzure.WorkBase" cleanOnRoleRecycle="false" sizeInMB="300000" />
</LocalResources>
<Certificates>
</Certificates>
</WorkerRole>
<WebRole name="MicrosoftDXGermany.hybrisOnAzure.BackOfficeWorkerRole" vmsize="Standard_D4">
<Runtime executionContext="elevated" />
<Sites>
<Site name="Web">
<Bindings>
<Binding name="http" endpointName="http" />
</Bindings>
</Site>
</Sites>
<Endpoints>
<InputEndpoint name="http" protocol="https" port="8080" localPort="80" certificate="SSL-Certificate" />
<InternalEndpoint name="TomcatHttp" protocol="tcp" port="9001" />
<InternalEndpoint name="TomcatHttps" protocol="tcp" port="9002" />
<InternalEndpoint name="InvalidateJGroup" protocol="tcp" port="7800" />
<InternalEndpoint name="Management" protocol="http" port="8081" />
<InternalEndpoint name="Solr" protocol="tcp" port="8983" />
<InternalEndpoint name="SolrStop" protocol="tcp" port="8985" />
<InternalEndpoint name="PluginStatus" protocol="tcp" port="12345" />
</Endpoints>
<ConfigurationSettings>
<Setting name="StorageConnectionString" />
<Setting name="tangible.Azure.Trace.EnableServiceBusTracing" />
<Setting name="tangible.Azure.Trace.ServicePath" />
<Setting name="tangible.Azure.Trace.ServiceNamespace" />
<Setting name="tangible.Azure.Trace.Credentials.IssuerName" />
<Setting name="tangible.Azure.Trace.Credentials.IssuerSecret" />
<Setting name="tangible.Azure.Trace.MaxTraceLevel" />
<Setting name="tangible.Azure.Startup.Download.Downloads" />
<Setting name="tangible.Azure.Startup.StartupCommands.Commands" />
<Setting name="tangible.Azure.Startup.PatchFiles.Files" />
<Setting name="tangible.Azure.AdditionalConfiguration" />
<Setting name="HybrisOnAzure.DeploymentSlot" />
<Setting name="HybrisOnAzure.SubscriptionId" />
<Setting name="HybrisOnAzure.ManagementCertThumb" />
<Setting name="HybrisOnAzure.HostedServiceName" />
<Setting name="HybrisOnAzure.BaseDirectory" />
<Setting name="HybrisOnAzure.JavaHomeDirectory" />
<Setting name="HybrisOnAzure.JavaProcessShutdownWaitMinutes" />
<Setting name="HybrisOnAzure.BackOfficeShare.DesiredDrive" />
<Setting name="HybrisOnAzure.BackOfficeShare.AccountName" />
<Setting name="HybrisOnAzure.BackOfficeShare.AccountKey" />
<Setting name="HybrisOnAzure.BackOfficeShare.ShareName" />
<Setting name="HybrisOnAzure.StartSolrPlugin" />
<Setting name="HybrisOnAzure.IndexMaster" />
<Setting name="HybrisOnAzure.IndexSlave" />
<Setting name="tangible.Azure.ARR.IPRangeEnabled" />
<Setting name="tangible.Azure.ARR.IPRange" />
<Setting name="tangible.Azure.ARR.WebFarmRoleName" />
<Setting name="tangible.Azure.ARR.WebFarmEndpointName" />
<Setting name="tangible.Azure.ARR.WebFarmName" />
<Setting name="tangible.Azure.ARR.HealthCheckUrl" />
<Setting name="tangible.Azure.ARR.HealthCheckResponseMatch" />
<Setting name="tangible.Azure.ARR.HealthCheckFile" />
<Setting name="tangible.Azure.ARR.HealthCheckInterval" />
<Setting name="tangible.Azure.ARR.HealthCheckTimeout" />
</ConfigurationSettings>
<Imports>
<Import moduleName="Diagnostics" />
</Imports>
<LocalResources>
<LocalStorage name="tangible.Azure.SMB.Drive.Cache" cleanOnRoleRecycle="false" sizeInMB="1000" />
<LocalStorage name="tangible.Azure.Startup.Download.DownloadCache" cleanOnRoleRecycle="true" sizeInMB="5000" />
<LocalStorage name="tangible.Azure.Startup.StartupCommands.Cache" cleanOnRoleRecycle="true" sizeInMB="100" />
<LocalStorage name="tangible.Azure.AdditionalConfiguration" cleanOnRoleRecycle="false" sizeInMB="10" />
<LocalStorage name="HybrisOnAzure.WorkBase" cleanOnRoleRecycle="false" sizeInMB="300000" />
</LocalResources>
<Certificates>
<Certificate name="ServiceWrapperManagementCertificate" storeLocation="LocalMachine" storeName="My" />
<Certificate name="SSL-Certificate" storeLocation="LocalMachine" storeName="My" />
</Certificates>
</WebRole>
</ServiceDefinition>

Просмотреть файл

@ -1,2 +1,8 @@
# Hybris-on-Azure-sample
This is the open source release of an Azure PAAS project to accelerate the deployment of the hybris e-commerce software suite on Azure.
# microsoft-deployment-accelerator-for-hybris-on-azure
This is the open source release of a Microsoft Azure PAAS project to accelerate the deployment of the hybris e-commerce software suite on Azure.
See [RELEASE.md](RELEASE.md) for pre-build cloud service packages.
See [LICENSE](LICENSE) for license information.

12
RELEASE.md Normal file
Просмотреть файл

@ -0,0 +1,12 @@
Cloud Service sample code build of the Microsoft Deployment Accelerator for Hybris on Azure
----
See [LICENSE](LICENSE) for license information.
nuget packages included in this build are subject to their individual licenses. See accelerator source code and [nuget.org](http://www.nuget.org) for details.
[Microsoft Deployment Accelerator for Hybris on Azure (1.0.0, 23/06/2015)]https://msdeployacchybrisonazure.blob.core.windows.net/microsoft-deployment-accelerator-for-hybris-on-azure/Microsoft%20Deployment%20Accelerator%20for%20hybris%20on%20Azure%201.0.0%20230615.zip)
In order to deploy this sample build as a cloud service on Azure, changes are required in the ServiceConfiguration.Raw.cscfg file. See accelerator documentation for details.

Просмотреть файл

@ -0,0 +1,10 @@
===== Configuration.xml =====
This file contains a configration for the Windows Azure CloudService that extends the standard azure cloud configuration.
It is used to enable or disable the maintenance page on Application Request Routing servers, start or stop the hybris platform on
the FrontendWorkerServer and the BackOfficeWorkerServer and update Java or Hybris on a running deployment.
This file needs to be uploaded to the Windows Azure Blob storage that is used for deploying the hybrisOnAzure - For All platform
into a container named "config".
Please refer to chapter 4.1 "Upload additional files" of the Hybris On Azure - For All PDF documentation.

Просмотреть файл

@ -0,0 +1,84 @@
<?xml version="1.0"?>
<AdditionalConfiguration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Timestamp>2014-09-16T15:20:12.1218461Z</Timestamp>
<Author>none</Author>
<Roles>
<Role>
<Name>MicrosoftDXGermany.hybrisOnAzure.ArrRole</Name>
<DesiredInstanceCount>1</DesiredInstanceCount>
<Instances>
<Instance>
<Id>default</Id>
<Configurations>
<ConfigurationItem>
<Name>IsInMaintenance</Name>
<Value>False</Value>
</ConfigurationItem>
<ConfigurationItem>
<Name>IPBlocking</Name>
<Value>^$</Value>
</ConfigurationItem>
<ConfigurationItem>
<Name>TrafficShaping</Name>
<Value>(.*)</Value>
</ConfigurationItem>
</Configurations>
</Instance>
</Instances>
</Role>
<Role>
<Name>MicrosoftDXGermany.hybrisOnAzure.FrontendWorkerRole</Name>
<DesiredInstanceCount>1</DesiredInstanceCount>
<Instances>
<Instance>
<Id>default</Id>
<Configurations>
<ConfigurationItem>
<Name>StopHybris</Name>
<Value>False</Value>
</ConfigurationItem>
<ConfigurationItem>
<Name>Reboot</Name>
<Value />
</ConfigurationItem>
<ConfigurationItem>
<Name>JavaPackage</Name>
<Value>jdk1.7.0_65.zip</Value>
</ConfigurationItem>
<ConfigurationItem>
<Name>HybrisPackage</Name>
<Value>2015-02-10-15-00</Value>
</ConfigurationItem>
</Configurations>
</Instance>
</Instances>
</Role>
<Role>
<Name>MicrosoftDXGermany.hybrisOnAzure.BackOfficeWorkerRole</Name>
<DesiredInstanceCount>1</DesiredInstanceCount>
<Instances>
<Instance>
<Id>default</Id>
<Configurations>
<ConfigurationItem>
<Name>StopHybris</Name>
<Value>False</Value>
</ConfigurationItem>
<ConfigurationItem>
<Name>Reboot</Name>
<Value />
</ConfigurationItem>
<ConfigurationItem>
<Name>JavaPackage</Name>
<Value>jdk1.7.0_65.zip</Value>
</ConfigurationItem>
<ConfigurationItem>
<Name>HybrisPackage</Name>
<Value>2015-02-10-15-00</Value>
</ConfigurationItem>
</Configurations>
</Instance>
</Instances>
</Role>
</Roles>
</AdditionalConfiguration>

Просмотреть файл

@ -0,0 +1,36 @@
@echo off
rem echo off -> cmdlet freezes with echo on
@REM -----------------------------------
@REM Configure ApplicationRequestRouting
@REM -----------------------------------
rem Enable Reverse Proxy feature in ARR – will modify D:\Windows\System32\inetsrv\config\applicationHost.config
%systemroot%\system32\inetsrv\APPCMD set config -section:proxy /enabled:true /COMMIT:MACHINE/WEBROOT/APPHOST > appcmd-arr.log
rem Delete previous existing web farm to avoid errors in this script
%systemroot%\system32\inetsrv\appcmd.exe clear config -section:webFarms /commit:apphost
rem Create empty web farm
%systemroot%\system32\inetsrv\appcmd.exe set config -section:webFarms /+"[name='<#%tangible.Azure.ARR.WebFarmName%#>']" /commit:apphost
%systemroot%\system32\inetsrv\appcmd.exe set config -section:webFarms /[name='<#%tangible.Azure.ARR.WebFarmName%#>'].applicationRequestRouting.affinity.useCookie:"True" /commit:apphost
%systemroot%\system32\inetsrv\appcmd.exe set config -section:webFarms /[name='<#%tangible.Azure.ARR.WebFarmName%#>'].applicationRequestRouting.loadBalancing.algorithm:"WeightedRoundRobin" /commit:apphost
rem Disable timeouts and set keep alive
%systemroot%\system32\inetsrv\appcmd.exe set config -section:webFarms /[name='<#%tangible.Azure.ARR.WebFarmName%#>'].applicationRequestRouting.protocol.httpVersion:"PassThrough" /commit:apphost
%systemroot%\system32\inetsrv\appcmd.exe set config -section:webFarms /[name='<#%tangible.Azure.ARR.WebFarmName%#>'].applicationRequestRouting.protocol.keepAlive:"true" /commit:apphost
%systemroot%\system32\inetsrv\appcmd.exe set config -section:webFarms /[name='<#%tangible.Azure.ARR.WebFarmName%#>'].applicationRequestRouting.protocol.timeout:"01:00:00" /commit:apphost
rem Enable Health monitoring
%systemroot%\system32\inetsrv\appcmd.exe set config -section:webFarms /[name='<#%tangible.Azure.ARR.WebFarmName%#>'].applicationRequestRouting.healthCheck.url:"<#%tangible.Azure.ARR.HealthCheckUrl%#>"
%systemroot%\system32\inetsrv\appcmd.exe set config -section:webFarms /[name='<#%tangible.Azure.ARR.WebFarmName%#>'].applicationRequestRouting.healthCheck.responseMatch:"<#%tangible.Azure.ARR.HealthCheckResponseMatch%#>"
%systemroot%\system32\inetsrv\appcmd.exe set config -section:webFarms /[name='<#%tangible.Azure.ARR.WebFarmName%#>'].applicationRequestRouting.healthCheck.interval:"<#%tangible.Azure.ARR.HealthCheckInterval%#>"
%systemroot%\system32\inetsrv\appcmd.exe set config -section:webFarms /[name='<#%tangible.Azure.ARR.WebFarmName%#>'].applicationRequestRouting.healthCheck.timeout:"<#%tangible.Azure.ARR.HealthCheckTimeout%#>" /commit:apphost
rem Disable Disk Cache
%systemroot%\system32\inetsrv\appcmd.exe set config -section:webFarms /[name='<#%tangible.Azure.ARR.WebFarmName%#>'].applicationRequestRouting.protocol.cache.enabled:"false" /commit:apphost
%systemroot%\system32\inetsrv\appcmd.exe set config -section:webFarms /[name='<#%tangible.Azure.ARR.WebFarmName%#>'].applicationRequestRouting.protocol.cache.validationInterval:"00:00:00" /commit:apphost
rem Set no buffer for constant data flow
%systemroot%\system32\inetsrv\appcmd.exe set config -section:webFarms /[name='<#%tangible.Azure.ARR.WebFarmName%#>'].applicationRequestRouting.protocol.minResponseBuffer:"0" /commit:apphost
%systemroot%\system32\inetsrv\appcmd.exe set config -section:webFarms /[name='<#%tangible.Azure.ARR.WebFarmName%#>'].applicationRequestRouting.protocol.responseBufferLimit:"0" /commit:apphost

Просмотреть файл

@ -0,0 +1,25 @@
==== ConfigureWebFarm.cmd =====
This commandlet is part of the HybrisForAll deployment and sets up the IIS Webfarm. Is is to be contained in a Zip file named ARR30.zip.
==== startup.cmd ====
This commandlet is part of the HybrisForAll deployment and installs bits necessary for the webfarm and application request routing. Is is to be contained in a Zip file named ARR30.zip.
The ARR30.zip file needs to contain the following files besides the two commandlets:
WebFarm Framework 1.1
http://download.microsoft.com/download/5/7/0/57065640-4665-4980-A2F1-4D5940B577B0/webfarm_v1.1_amd64_en_US.msi
Renamed to webfarm_amd64_en-US.msi
Application Request Routing 3.0 for IIS
http://www.microsoft.com/en-us/download/details.aspx?id=39715
Renamed to requestRouter_amd64_en-US.msi
External Disk Cache V1
http://download.microsoft.com/download/3/4/1/3415F3F9-5698-44FE-A072-D4AF09728390/ExternalDiskCache_amd64_en-US.msi
External Disk Cache Patch:
Start-BitsTransfer -Source http://download.microsoft.com/download/D/E/9/DE90D9BD-B61C-43F5-8B80-90FDC0B06144/ExternalDiskCachePatch_amd64.msp
======================================
Please refer to chapter 2.9 "Application Request Routing" of the Hybris On Azure - For All PDF documentation.

Просмотреть файл

@ -0,0 +1,13 @@
rem Install Application Request Routing and its dependencies and patches
if exist %systemdrive%\arr-installed.txt goto skip
cd /d "%~dp0"
msiexec /i webfarm_amd64_en-US.msi /qn /log installWebfarm.log
msiexec /i ExternalDiskCache_amd64_en-US.msi /qn /log installExtCache.log
msiexec /i ExternalDiskCachePatch_amd64.msp /qn /log installExtCachePatch.log
msiexec /i requestRouter_amd64_en-US.msi /qn /log installARR.log
time /t >> %systemdrive%\arr-installed.txt
:skip

Просмотреть файл

@ -0,0 +1,12 @@
@REM --------------------
@REM This script connects to a Windows Azure Files account
@REM --------------------
if not exist <#%HybrisOnAzure.BackOfficeShare.DesiredDrive%#> goto create
:remove
echo <#%HybrisOnAzure.BackOfficeShare.DesiredDrive%#> exists, deleting...
net use <#%HybrisOnAzure.BackOfficeShare.DesiredDrive%#> /delete
:create
echo Using AzureFiles account="<#%HybrisOnAzure.BackOfficeShare.AccountName%#>" share="<#%HybrisOnAzure.BackOfficeShare.ShareName%#>"
net use <#%HybrisOnAzure.BackOfficeShare.DesiredDrive%#> \\<#%HybrisOnAzure.BackOfficeShare.AccountName%#>.file.core.windows.net\<#%HybrisOnAzure.BackOfficeShare.ShareName%#> /u:<#%HybrisOnAzure.BackOfficeShare.AccountName%#> <#%HybrisOnAzure.BackOfficeShare.AccountKey%#>

Просмотреть файл

@ -0,0 +1,6 @@
===== ConnectAzureFiles.cmd ===
This commandlet contains a script to connect to a Windows Azure Files share provided by a Windows Azure Storage account.
It is used on the BackOfficeWorker of the hybrisOnAzure - For All platform.
Please refer to to chapter 4.1 "Uploading additional files" of the Hybris On Azure - For All PDF documentation.

Просмотреть файл

@ -0,0 +1,7 @@
===== CustomMaintenance.zip ====
This zip files contains a html page and image files to display a custom styled maintenance page.
It is to be uploaded into the /deployment container in the blob storage account that is used to deploy the hybrisOnAzure - For all
platform.
Please refer to chapter 7.2 "custom maintenance page" in the Hybris On Azure - For All PDF documentation.

Просмотреть файл

@ -0,0 +1,10 @@
<html>
<head>
<title>Maintenance mode</title>
</head>
<body>
<h1>This is a custom maintenance page.</h1>
<p>Please be patient until we have everything running smoothly again.</p>
</body>
</html>

Просмотреть файл

@ -0,0 +1,127 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<system.diagnostics>
<trace>
<listeners>
<add type="Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics, Version=2.4.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" name="AzureDiagnostics">
<filter type="" />
</add>
</listeners>
</trace>
</system.diagnostics>
<system.web>
<compilation debug="true" targetFramework="4.0" />
<httpRuntime />
</system.web>
<system.webServer>
<!-- Rules for Application Request routing -->
<rewrite>
<rules>
<!-- Deliver Maintenance Page directly -->
<rule name="MaintenancePage" stopProcessing="true" enabled="true">
<match url="^maintenance.html$" />
<action type="None" />
</rule>
<rule name="ConstructionImage" stopProcessing="true" enabled="true">
<match url="^construction.jpeg$" />
<action type="None" />
</rule>
<!-- create a rule for each additional custom maintenance page files -->
<!--<rule name="MaintenancePage" stopProcessing="true" enabled="true">
<match url="^myfile.ext$" />
<action type="None" />
</rule>-->
<!-- Rule to redirect all traffic to the maintenance page -->
<rule name="IsInMaintenance" stopProcessing="true" enabled="false">
<match url="(.*)" />
<action type="Rewrite" url="/maintenance.html" redirectType="Temporary" />
</rule>
<!-- Rules to deny access to cockpit urls -->
<rule name="Block_AdminCockpit" stopProcessing="true" enabled="true">
<match url="^admincockpit($|/.*)" />
<action type="CustomResponse" statusCode="403" statusReason="Forbidden: Access is denied." statusDescription="You do not have permission to view this directory or page using the credentials that you supplied." />
</rule>
<rule name="Block_CmsCockpit" stopProcessing="true" enabled="true">
<match url="^cmscockpit($|/.*)" />
<action type="CustomResponse" statusCode="403" statusReason="Forbidden: Access is denied." statusDescription="You do not have permission to view this directory or page using the credentials that you supplied." />
</rule>
<rule name="Block_CmsCockpitRegular" stopProcessing="true" enabled="true">
<match url="^cmscockpitRegular($|/.*)" />
<action type="CustomResponse" statusCode="403" statusReason="Forbidden: Access is denied." statusDescription="You do not have permission to view this directory or page using the credentials that you supplied." />
</rule>
<rule name="Block_AcceleratorServices" stopProcessing="true" enabled="true">
<match url="^acceleratorservices($|/.*)" />
<action type="CustomResponse" statusCode="403" statusReason="Forbidden: Access is denied." statusDescription="You do not have permission to view this directory or page using the credentials that you supplied." />
</rule>
<rule name="Block_CsCockpit" stopProcessing="true" enabled="true">
<match url="^cscockpit($|/.*)" />
<action type="CustomResponse" statusCode="403" statusReason="Forbidden: Access is denied." statusDescription="You do not have permission to view this directory or page using the credentials that you supplied." />
</rule>
<rule name="Block_hac" stopProcessing="true" enabled="true">
<match url="^hac($|/.*)" />
<action type="CustomResponse" statusCode="403" statusReason="Forbidden: Access is denied." statusDescription="You do not have permission to view this directory or page using the credentials that you supplied." />
</rule>
<rule name="Block_hmc" stopProcessing="true" enabled="true">
<match url="^hmc($|/.*)" />
<action type="CustomResponse" statusCode="403" statusReason="Forbidden: Access is denied." statusDescription="You do not have permission to view this directory or page using the credentials that you supplied." />
</rule>
<rule name="Block_instore" stopProcessing="true" enabled="true">
<match url="^instore($|/.*)" />
<action type="CustomResponse" statusCode="403" statusReason="Forbidden: Access is denied." statusDescription="You do not have permission to view this directory or page using the credentials that you supplied." />
</rule>
<rule name="Block_mcc" stopProcessing="true" enabled="true">
<match url="^mcc($|/.*)" />
<action type="CustomResponse" statusCode="403" statusReason="Forbidden: Access is denied." statusDescription="You do not have permission to view this directory or page using the credentials that you supplied." />
</rule>
<rule name="Block_ws410" stopProcessing="true" enabled="true">
<match url="^ws410($|/.*)" />
<action type="CustomResponse" statusCode="403" statusReason="Forbidden: Access is denied." statusDescription="You do not have permission to view this directory or page using the credentials that you supplied." />
</rule>
<rule name="Block_ProductCockpit" stopProcessing="true" enabled="true">
<match url="^productcockpit($|/.*)" />
<action type="CustomResponse" statusCode="403" statusReason="Forbidden: Access is denied." statusDescription="You do not have permission to view this directory or page using the credentials that you supplied." />
</rule>
<rule name="Block_ReportCockpit" stopProcessing="true" enabled="true">
<match url="^reportcockpit($|/.*)" />
<action type="CustomResponse" statusCode="403" statusReason="Forbidden: Access is denied." statusDescription="You do not have permission to view this directory or page using the credentials that you supplied." />
</rule>
<rule name="Block_SolrFacetSearch" stopProcessing="true" enabled="true">
<match url="^solrfacetsearch($|/.*)" />
<action type="CustomResponse" statusCode="403" statusReason="Forbidden: Access is denied." statusDescription="You do not have permission to view this directory or page using the credentials that you supplied." />
</rule>
<rule name="Block_VirtualJDBC" stopProcessing="true" enabled="true">
<match url="^virtualjdbc($|/.*)" />
<action type="CustomResponse" statusCode="403" statusReason="Forbidden: Access is denied." statusDescription="You do not have permission to view this directory or page using the credentials that you supplied." />
</rule>
<rule name="Block_Test" stopProcessing="true" enabled="true">
<match url="^test($|/.*)" />
<action type="CustomResponse" statusCode="403" statusReason="Forbidden: Access is denied." statusDescription="You do not have permission to view this directory or page using the credentials that you supplied." />
</rule>
<!-- Rule to redirect all traffic to the webfarm -->
<rule name="WebFarm" stopProcessing="true">
<match url="(.*)" />
<action type="Rewrite" url="http://AzureWebFarm/{R:0}" />
</rule>
</rules>
</rewrite>
</system.webServer>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Net.Http" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.2.20.0" newVersion="2.2.20.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

Просмотреть файл

@ -0,0 +1,14 @@
@REM --------------------
@REM JDBC driver settings
@REM --------------------
if exist %SystemDrive%\registry-edited.txt goto skip
REM Workaround for JDBC to SQL Azure
REG ADD HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters /f /v KeepAliveTime /t REG_DWORD /d 30000 >> %SystemDrive%\registry-edited.txt
REG ADD HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters /f /v KeepAliveInterval /t REG_DWORD /d 1000 >> %SystemDrive%\registry-edited.txt
REG ADD HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters /f /v TcpMaxDataRetransmission /t REG_DWORD /d 10 >> %SystemDrive%\registry-edited.txt
time /t >> %SystemDrive%\registry-edited.txt
shutdown /r /t 1
:skip

Просмотреть файл

@ -0,0 +1,7 @@
===== JDBCSetup.cmd =====
Windows Azure startup script
This commandlet should be run at startup on every machine using the JDBC driver to connect to databases using Java.
It sets necessary registry keys and reboots the machine once the changes have been applied.
Please refer to chapter 4.1 "Upload additional files" of the Hybris On Azure - For All PDF manual.

Просмотреть файл

@ -0,0 +1,6 @@
** PLACEHOLDER **
Download and install the Java runtime, then zip the install directory into java.zip

Просмотреть файл

@ -0,0 +1,43 @@
=== Restrictions ===
- the Java Application must terminate
- the Java Application must be compatible with the Java Version deployed
=== In Order to run a JAR Java Application on Server startup follow these steps: ===
1. Edit RunJar.cmd: Place proper JAR filename
2. Zip JAR and RunJar.cmd into a single Zip file
e.g. RunJar.zip
/- RunJar.cmd
/- MyJavaProgram.jar
3. Upload RunJar.zip into /deployment/ container in BlobStorage configured in CloudConfiguration "StorageConnectionString"
4. Download RunJar.zip at Server startup by adding the following part to CloudConfiguration "tangible.Azure.Startup.Download.Downloads"
deployment/RunJar.zip|C:\RunJar|true;
That CloudConfiguration contains a semicolon separated list of downloads to be made at startup.
A download is specified by three parameters separated by the pipe character '|'.
1st parameter is the blob to be downloaded.
2nd parameter is a directory the blob is to be downloaded to
3rd parameter 'true' if the downloaded blob is a zip file and needs to be unzipped, 'false' otherwise
5. Execute RunJar.bat at Server startup after the download by adding the following part to CloudConfiguration "tangible.Azure.Startup.StartupCommands.Commands"
C:\RunJar\RunJar.cmd|30000|true;
That CloudConfiguration contains a semicolon separated list of jobs to be run at startup.
A job is specified by three parameters separated by the pipe character '|'.
1st parameter is the file to be executed (.bat, .cmd, .exe, ...)
2nd parameter is the timeout in ms after which the execution is cancelled
3rd parameter 'true' if the job needs to be executed in the director where it is stored (as there is made a copy before executing), 'false' otherwise
=== Access Azure RoleEnvironment ===
Because the JAR is not the RoleEntryPoint of the Cloud service, the RoleEnvironment will not be available using the Azure JAVA SDK.
But you can access ConfigurationSetting values from the cloud configuration and RoleEnvironment information by adding placeholders
in the RunJar.cmd file which will be replaced before executing the RunJar.cmd. (Examples are contained in the .cmd)
Configuration Setting value: Place the name of the configuration settinig in <#% %#> tags.
Example: <#%HybrisOnAzure.JavaHomeDirectory%#> will be replaced by its value from the .cscfg
RoleEnvironment information: Place the expression to the desired information in <#% %#> tags.
Example: <#%RoleEnvironment.CurrentRoleInstance.InstanceEndpoints["TomcatHttp"].IPEndpoint.Port%#> will be replaced by the port number defined by the RoleEnvironment.
Reference: https://msdn.microsoft.com/en-us/library/microsoft.windowsazure.serviceruntime.roleenvironment_members.aspx

Просмотреть файл

@ -0,0 +1,22 @@
@REM --------------------------------------------------------------------------
@REM This command file executes a given JAR file
@REM --------------------------------------------------------------------------
@REM If you want the JAR to be executed only once, enable the next line
@REM if exist %SystemDrive%\jar-executed.txt goto skip
@REM Read a value from the .cscfg file and store it in an environment variable
@REM that can be read from within Java
set CSCFG_HybrisOnAzure.JavaHomeDirectory="<#%HybrisOnAzure.JavaHomeDirectory%#>"
@REM Read a public endpoint from the RoleEnvironment
set RE_TomcatIP=<#%RoleEnvironment.CurrentRoleInstance.InstanceEndpoints["TomcatHttp"].IPEndpoint.Address%#>
set RE_TomcatPort=<#%RoleEnvironment.CurrentRoleInstance.InstanceEndpoints["TomcatHttp"].IPEndpoint.Port%#>
set RE_TomcatEndpoint=<#%RoleEnvironment.CurrentRoleInstance.InstanceEndpoints["TomcatHttp"].IPEndpoint%#>
@REM start the java program
call "<#%HybrisOnAzure.JavaHomeDirectory%#>"\bin\java.exe -jar %~dp0MyJavaProgram.jar
time /t >> %SystemDrive%\jar-executed.txt
:skip

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -0,0 +1,68 @@
@echo off
:: This script start, stops and restarts standalone solr for hybris on azure
:: (c) tanigble engineering GmbH, 2015
:: the value of this variable will be replaced on startup by the hybris on azure platform
set ISMASTER="<#%HybrisOnAzure.IndexMaster%#>"
call :UpCase ISMASTER
:: determine if this server needs master/slave configuration
if %ISMASTER%=="TRUE" (
:: set options for solr master
set JAVA_OPTIONS=-server -Xms2048m -Xmx2048m -jar -Dcom.sun.management.jmxremote.port=9883 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote -DSTOP.PORT={solrstopport} -DSTOP.KEY={solrstopkey} -Dsolr.solr.home=. -Denable.master=true -Djetty.port={solrport} -Dsolr.data.dir={solrdatadir} start.jar
)
if %ISMASTER%=="FALSE" (
:: set options for solr slave
set JAVA_OPTIONS=-server -Xms2048m -Xmx2048m -jar -Dcom.sun.management.jmxremote.port=9883 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote -DSTOP.PORT={solrstopport} -DSTOP.KEY={solrstopkey} -Dsolr.solr.home=. -Denable.slave=true -Djetty.port={solrport} -Dmaster.host={solrmasterip} -Dsolr.data.dir={solrdatadir} start.jar
)
set LOG_FILE=%SOLR_DIR%\logs\solr.log
if ""%1"" == ""restart"" goto doRestart
if ""%1"" == ""start"" goto doStart
if ""%1"" == ""stop"" goto doStop
if ""%1"" == """" goto doUsage
goto EOF
:doStart
echo "Starting Solr"
cd %SOLR_DIR%
cmd /c java %JAVA_OPTIONS%
goto EOF
:doStop
echo "Stoping Solr"
cd %SOLR_DIR%
cmd /c java %JAVA_OPTIONS% --stop
goto EOF
:doRestart
echo "Starting Solr"
cd %SOLR_DIR%
cmd /c java %JAVA_OPTIONS% --stop
timeout 2
cmd /c java %JAVA_OPTIONS%
goto EOF
:doUsage
@echo off
echo Usage: "%0 {start|stop|restart}"
goto EOF
:UpCase
:: Subroutine to convert a variable VALUE to all UPPER CASE.
:: The argument for this subroutine is the variable NAME.
FOR %%i IN ("a=A" "b=B" "c=C" "d=D" "e=E" "f=F" "g=G" "h=H" "i=I" "j=J" "k=K" "l=L" "m=M" "n=N" "o=O" "p=P" "q=Q" "r=R" "s=S" "t=T" "u=U" "v=V" "w=W" "x=X" "y=Y" "z=Z") DO CALL SET "%1=%%%1:%%~i%%"
GOTO:EOF
:EOF