Splitting RemoteMonitoring WebJobs into two project

There was a 'wrapper' job that combined the tasks of the two real webjobs. Had to separate out the logic into the two webjob projects and change them to be console apps.
This commit is contained in:
Tyler Jensen 2015-10-14 16:39:19 -07:00
Родитель e1b6b5911e
Коммит fff904a8ff
83 изменённых файлов: 619 добавлений и 673 удалений

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

@ -43,9 +43,9 @@ namespace Microsoft.Azure.Devices.Applications.RemoteMonitoring.Common.Configura
{
configValue = ConfigurationManager.AppSettings[configurationSettingName];
isEmulated = Environment.CommandLine.Contains("iisexpress.exe") ||
Environment.CommandLine.Contains("DeviceAdministration.WebJob.vshost.exe");
Environment.CommandLine.Contains("WebJob.vshost.exe");
}
if (isEmulated && configValue.StartsWith(ConfigToken, StringComparison.OrdinalIgnoreCase))
if (isEmulated && (configValue != null && configValue.StartsWith(ConfigToken, StringComparison.OrdinalIgnoreCase)))
{
if (environment == null)
{

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

@ -230,7 +230,7 @@
"Properties": {
"DataSource": {
"Properties": {
"Container": "DeviceTelemetry",
"Container": "devicetelemetry",
"DateFormat": "yyyy/MM/dd",
"TimeFormat": "HH",
"PathPattern": "devicetelemetry/{date}/{time}",

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

@ -64,9 +64,10 @@ Write-Host "Deployment template path: $deploymentTemplatePath"
# Upload WebPackages
if ($cloudDeploy)
{
$webPackage = UploadFile (".\DeviceAdministration\Web\obj\{0}\Package\Web.zip" -f $configuration) $storageAccount.Name $resourceGroupName "WebDeploy"
$projectRoot = Join-Path $PSScriptRoot "..\.." -Resolve
$webPackage = UploadFile ("$projectRoot\DeviceAdministration\Web\obj\{0}\Package\Web.zip" -f $configuration) $storageAccount.Name $resourceGroupName "WebDeploy"
$params += @{packageUri=$webPackage}
$webJobPackage = UploadFile (".\WebJobHost\obj\{0}\Package\WebJobHost.zip" -f $configuration) $storageAccount.Name $resourceGroupName "WebDeploy"
$webJobPackage = UploadFile ("$projectRoot\WebJobHost\obj\{0}\Package\WebJobHost.zip" -f $configuration) $storageAccount.Name $resourceGroupName "WebDeploy"
$params += @{webJobPackageUri=$webJobPackage}
}

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

@ -251,7 +251,7 @@
"Properties": {
"DataSource": {
"Properties": {
"Container": "DeviceTelemetry",
"Container": "devicetelemetry",
"DateFormat": "yyyy/MM/dd",
"TimeFormat": "HH",
"PathPattern": "devicetelemetry/{date}/{time}",

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

@ -177,7 +177,7 @@
<system.webServer>
<staticContent>
<remove fileExtension=".svg"/>
<remove fileExtension=".svg" />
<mimeMap fileExtension=".svg" mimeType="image/svg+xml" />
</staticContent>

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

@ -1,94 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.1" />
</startup>
<system.diagnostics>
<trace autoflush="true">
<listeners>
<add name="consoleListener" type="System.Diagnostics.ConsoleTraceListener" />
</listeners>
</trace>
</system.diagnostics>
<appSettings>
<add key="docdb.EndpointUrl" value="config:DocDbEndPoint" />
<add key="docdb.PrimaryAuthorizationKey" value="config:DocDBKey" />
<add key="docdb.DatabaseId" value="DevMgmtDB" />
<add key="docdb.DocumentCollectionId" value="DevMgmtCollection" />
<add key="iotHub.HostName" value="config:IotHubName" />
<add key="iotHub.ConnectionString" value="config:IotHubConnectionString" />
<add key="eventHub.HubName" value="config:ServiceEHName" />
<add key="eventHub.ConnectionString" value="config:ServiceSBConnectionString" />
<add key="eventHub.StorageConnectionString" value="config:ServiceStoreAccountConnectionString" />
<add key="device.StorageConnectionString" value="config:ServiceStoreAccountConnectionString" />
<add key="device.TableName" value="config:DeviceTableName" />
<add key="ObjectTypePrefix" value="config:ObjectTypePrefix" />
<add key="RulesEventHub.Name" value="config:RulesEventHubName" />
<add key="RulesEventHub.ConnectionString" value="config:RulesEventHubConnectionString" />
<add key="DeviceRulesStoreContainerName" value="devicerules" />
<add key="DeviceRulesTableName" value="DeviceRulesNormalizedTable" />
<add key="ActionMappingStoreContainerName" value="actionmappings" />
<add key="ActionMappingStoreBlobName" value="mappings.json" />
<add key="AsaRefDataRulesBlobName" value="devicerules.json" />
<add key="DevicePollIntervalSeconds" value="20" />
<add key="UseConfigForDeviceList" value="False" />
</appSettings>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Web.Http" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Net.Http.Formatting" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Owin" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Http.Owin" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.WindowsAzure.Storage" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.0.2.0" newVersion="5.0.2.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.WindowsAzure.ServiceRuntime" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.7.0.0" newVersion="2.7.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>
</configuration>

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

@ -1,36 +0,0 @@
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("DeviceAdministration.WebJob")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("DeviceAdministration.WebJob")]
[assembly: AssemblyCopyright("Copyright © 2015")]
[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("36d1d6b8-8735-433b-adfd-c8509c1b6b58")]
// 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")]

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

@ -1,212 +0,0 @@
<?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>{8F9CAF4E-8537-4398-A1C2-C39CC4136B69}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>DeviceAdministration.WebJob</RootNamespace>
<AssemblyName>DeviceAdministration.WebJob</AssemblyName>
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
<RestorePackages>true</RestorePackages>
<TargetFrameworkProfile />
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<RunCodeAnalysis>true</RunCodeAnalysis>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Autofac, Version=3.5.0.0, Culture=neutral, PublicKeyToken=17863af14b0044da, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\packages\Autofac.3.5.2\lib\net40\Autofac.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Azure.Amqp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\packages\Microsoft.Azure.Amqp.1.0.0-preview-001-000-000\lib\net451\Microsoft.Azure.Amqp.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Azure.Devices, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\packages\Microsoft.Azure.Devices.1.0.0-preview-001-000-001\lib\net451\Microsoft.Azure.Devices.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Azure.Devices.Client, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\packages\Microsoft.Azure.Devices.Client.1.0.0-preview-001-000-000\lib\net45\Microsoft.Azure.Devices.Client.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Azure.Documents.Client, Version=1.4.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\packages\Microsoft.Azure.DocumentDB.1.4.1\lib\net40\Microsoft.Azure.Documents.Client.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Azure.KeyVault.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\packages\Microsoft.Azure.KeyVault.Core.1.0.0\lib\net40\Microsoft.Azure.KeyVault.Core.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Data.Edm, Version=5.6.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\packages\Microsoft.Data.Edm.5.6.4\lib\net40\Microsoft.Data.Edm.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Data.OData, Version=5.6.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\packages\Microsoft.Data.OData.5.6.4\lib\net40\Microsoft.Data.OData.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Data.Services.Client, Version=5.6.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\packages\Microsoft.Data.Services.Client.5.6.4\lib\net40\Microsoft.Data.Services.Client.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Owin, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\packages\Microsoft.Owin.3.0.1\lib\net45\Microsoft.Owin.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Owin.Host.SystemWeb">
<HintPath>..\..\packages\Microsoft.Owin.Host.SystemWeb.3.0.1\lib\net45\Microsoft.Owin.Host.SystemWeb.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Owin.Hosting">
<HintPath>..\..\packages\Microsoft.Owin.Hosting.3.0.1\lib\net45\Microsoft.Owin.Hosting.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ServiceBus, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\packages\WindowsAzure.ServiceBus.3.0.4\lib\net45-full\Microsoft.ServiceBus.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ServiceBus.Messaging.EventProcessorHost, Version=0.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\packages\Microsoft.Azure.ServiceBus.EventProcessorHost.2.0.3\lib\net45-full\Microsoft.ServiceBus.Messaging.EventProcessorHost.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAzure.Configuration">
<HintPath>..\..\packages\Microsoft.WindowsAzure.ConfigurationManager.3.1.0\lib\net40\Microsoft.WindowsAzure.Configuration.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAzure.Diagnostics, Version=2.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\packages\Unofficial.Microsoft.WindowsAzure.Diagnostics.2.7.0.0\lib\net40\Microsoft.WindowsAzure.Diagnostics.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.WindowsAzure.ServiceRuntime, Version=2.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.WindowsAzure.Storage, Version=5.0.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\packages\WindowsAzure.Storage.5.0.2\lib\net40\Microsoft.WindowsAzure.Storage.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\..\packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Owin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=f0ebd12fd5e55cc5, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\packages\Owin.1.0\lib\net40\Owin.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Net.Http.Formatting, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\packages\Microsoft.AspNet.WebApi.Client.5.2.3\lib\net45\System.Net.Http.Formatting.dll</HintPath>
</Reference>
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.ServiceModel" />
<Reference Include="System.Spatial, Version=5.6.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\packages\System.Spatial.5.6.4\lib\net40\System.Spatial.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Web.Http, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\packages\Microsoft.AspNet.WebApi.Core.5.2.3\lib\net45\System.Web.Http.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" />
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<None Include="packages.config">
<SubType>Designer</SubType>
</None>
<None Include="Properties\webjob-publish-settings.json" />
<None Include="settings.job" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Common\Common.csproj">
<Project>{5959c109-5369-4ff7-8b55-605a79fdf200}</Project>
<Name>Common</Name>
</ProjectReference>
<ProjectReference Include="..\..\EventProcessor\EventProcessor.WorkerRole\EventProcessor.WorkerRole.csproj">
<Project>{588c29c8-3bf8-4cf6-89a7-33d611388e0e}</Project>
<Name>EventProcessor.WorkerRole</Name>
</ProjectReference>
<ProjectReference Include="..\..\Simulator\Simulator.WorkerRole\Simulator.WorkerRole.csproj">
<Project>{8f0ff371-2306-4210-9c22-0d0657b595dc}</Project>
<Name>Simulator.WorkerRole</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include=".NETFramework,Version=v4.5.1">
<Visible>False</Visible>
<ProductName>Microsoft .NET Framework 4.5.1 %28x86 and x64%29</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>false</Install>
</BootstrapperPackage>
</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.Web.WebJobs.Publish.1.0.7\tools\webjobs.targets" Condition="Exists('..\..\packages\Microsoft.Web.WebJobs.Publish.1.0.7\tools\webjobs.targets')" />
<!-- 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>

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

@ -1,26 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Autofac" version="3.5.2" targetFramework="net451" />
<package id="Microsoft.AspNet.WebApi.Client" version="5.2.3" targetFramework="net451" />
<package id="Microsoft.AspNet.WebApi.Core" version="5.2.3" targetFramework="net451" />
<package id="Microsoft.Azure.Amqp" version="1.0.0-preview-001-000-000" targetFramework="net451" />
<package id="Microsoft.Azure.Devices" version="1.0.0-preview-001-000-001" targetFramework="net451" />
<package id="Microsoft.Azure.Devices.Client" version="1.0.0-preview-001-000-000" targetFramework="net451" />
<package id="Microsoft.Azure.DocumentDB" version="1.4.1" targetFramework="net451" />
<package id="Microsoft.Azure.KeyVault.Core" version="1.0.0" targetFramework="net451" />
<package id="Microsoft.Azure.ServiceBus.EventProcessorHost" version="2.0.3" targetFramework="net451" />
<package id="Microsoft.Data.Edm" version="5.6.4" targetFramework="net451" />
<package id="Microsoft.Data.OData" version="5.6.4" targetFramework="net451" />
<package id="Microsoft.Data.Services.Client" version="5.6.4" targetFramework="net451" />
<package id="Microsoft.Owin" version="3.0.1" targetFramework="net451" />
<package id="Microsoft.Owin.Host.SystemWeb" version="3.0.1" targetFramework="net451" />
<package id="Microsoft.Owin.Hosting" version="3.0.1" targetFramework="net451" />
<package id="Microsoft.Web.WebJobs.Publish" version="1.0.7" targetFramework="net451" />
<package id="Microsoft.WindowsAzure.ConfigurationManager" version="3.1.0" targetFramework="net451" />
<package id="Newtonsoft.Json" version="7.0.1" targetFramework="net451" />
<package id="Owin" version="1.0" targetFramework="net451" />
<package id="System.Spatial" version="5.6.4" targetFramework="net451" />
<package id="Unofficial.Microsoft.WindowsAzure.Diagnostics" version="2.7.0.0" targetFramework="net451" />
<package id="WindowsAzure.ServiceBus" version="3.0.4" targetFramework="net451" />
<package id="WindowsAzure.Storage" version="5.0.2" targetFramework="net451" />
</packages>

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

@ -7,10 +7,10 @@
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{588C29C8-3BF8-4CF6-89A7-33D611388E0E}</ProjectGuid>
<OutputType>Library</OutputType>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Microsoft.Azure.Devices.Applications.RemoteMonitoring.EventProcessor.WorkerRole</RootNamespace>
<AssemblyName>EventProcessor.WorkerRole</AssemblyName>
<RootNamespace>Microsoft.Azure.Devices.Applications.RemoteMonitoring.EventProcessor.WebJob</RootNamespace>
<AssemblyName>EventProcessor.WebJob</AssemblyName>
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<RoleType>Worker</RoleType>
@ -25,6 +25,9 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
<CheckForOverflowUnderflow>true</CheckForOverflowUnderflow>
</PropertyGroup>
<PropertyGroup>
<StartupObject>Microsoft.Azure.Devices.Applications.RemoteMonitoring.EventProcessor.WebJob.Program</StartupObject>
</PropertyGroup>
<ItemGroup>
<Reference Include="Autofac, Version=3.5.0.0, Culture=neutral, PublicKeyToken=17863af14b0044da, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
@ -134,8 +137,6 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="DataInitialization\DataInitializer.cs" />
<Compile Include="DataInitialization\IDataInitializer.cs" />
<Compile Include="EventProcessorModule.cs" />
<Compile Include="Processors\ActionEventProcessor.cs" />
<Compile Include="Processors\ActionProcessor.cs" />
@ -147,6 +148,7 @@
<Compile Include="Processors\IDeviceEventProcessor.cs" />
<Compile Include="Processors\IMessageFeedbackProcessor.cs" />
<Compile Include="Processors\MessageFeedbackProcessor.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
@ -156,6 +158,7 @@
<None Include="packages.config">
<SubType>Designer</SubType>
</None>
<None Include="Properties\webjob-publish-settings.json" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="$(SolutionDir)\Common\Common.csproj">
@ -176,6 +179,7 @@
</PropertyGroup>
<Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
</Target>
<Import Project="..\..\packages\Microsoft.Web.WebJobs.Publish.1.0.3\tools\webjobs.targets" Condition="Exists('..\..\packages\Microsoft.Web.WebJobs.Publish.1.0.3\tools\webjobs.targets')" />
<!-- 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">

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

@ -5,11 +5,10 @@ using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Common.Repository;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Common.Utility;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.DeviceAdmin.Infrastructure.BusinessLogic;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.DeviceAdmin.Infrastructure.Repository;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.EventProcessor.WorkerRole.DataInitialization;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.EventProcessor.WorkerRole.Processors;
using Microsoft.Azure.IoT.Samples.EventProcessor.WorkerRole.Processors;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.EventProcessor.WebJob.Processors;
using Microsoft.Azure.IoT.Samples.EventProcessor.WebJob.Processors;
namespace Microsoft.Azure.Devices.Applications.RemoteMonitoring.EventProcessor.WorkerRole
namespace Microsoft.Azure.Devices.Applications.RemoteMonitoring.EventProcessor.WebJob
{
public sealed class EventProcessorModule : Module
{
@ -60,9 +59,6 @@ namespace Microsoft.Azure.Devices.Applications.RemoteMonitoring.EventProcessor.W
builder.RegisterType<ActionLogic>()
.As<IActionLogic>();
builder.RegisterType<DataInitializer>()
.As<IDataInitializer>();
builder.RegisterType<ActionRepository>()
.As<IActionRepository>();

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

@ -7,7 +7,7 @@ using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Common.Configuration
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.DeviceAdmin.Infrastructure.BusinessLogic;
using Microsoft.ServiceBus.Messaging;
namespace Microsoft.Azure.Devices.Applications.RemoteMonitoring.EventProcessor.WorkerRole.Processors
namespace Microsoft.Azure.Devices.Applications.RemoteMonitoring.EventProcessor.WebJob.Processors
{
public class ActionEventProcessor : IActionEventProcessor, IDisposable
{

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

@ -10,7 +10,7 @@ using Microsoft.ServiceBus.Messaging;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
namespace Microsoft.Azure.Devices.Applications.RemoteMonitoring.EventProcessor.WorkerRole.Processors
namespace Microsoft.Azure.Devices.Applications.RemoteMonitoring.EventProcessor.WebJob.Processors
{
public class ActionProcessor : IEventProcessor
{

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

@ -6,7 +6,7 @@ using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Common.Configuration
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.DeviceAdmin.Infrastructure.BusinessLogic;
using Microsoft.ServiceBus.Messaging;
namespace Microsoft.Azure.Devices.Applications.RemoteMonitoring.EventProcessor.WorkerRole.Processors
namespace Microsoft.Azure.Devices.Applications.RemoteMonitoring.EventProcessor.WebJob.Processors
{
public class ActionProcessorFactory : IEventProcessorFactory
{

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

@ -12,7 +12,7 @@ using Microsoft.ServiceBus.Messaging;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
namespace Microsoft.Azure.Devices.Applications.RemoteMonitoring.EventProcessor.WorkerRole.Processors
namespace Microsoft.Azure.Devices.Applications.RemoteMonitoring.EventProcessor.WebJob.Processors
{
public class DeviceAdministrationProcessor : IEventProcessor
{

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

@ -6,7 +6,7 @@ using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Common.Configuration
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.DeviceAdmin.Infrastructure.BusinessLogic;
using Microsoft.ServiceBus.Messaging;
namespace Microsoft.Azure.Devices.Applications.RemoteMonitoring.EventProcessor.WorkerRole.Processors
namespace Microsoft.Azure.Devices.Applications.RemoteMonitoring.EventProcessor.WebJob.Processors
{
public class DeviceAdministrationProcessorFactory : IEventProcessorFactory
{

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

@ -7,7 +7,7 @@ using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Common.Configuration
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.DeviceAdmin.Infrastructure.BusinessLogic;
using Microsoft.ServiceBus.Messaging;
namespace Microsoft.Azure.Devices.Applications.RemoteMonitoring.EventProcessor.WorkerRole.Processors
namespace Microsoft.Azure.Devices.Applications.RemoteMonitoring.EventProcessor.WebJob.Processors
{
public class DeviceEventProcessor : IDeviceEventProcessor, IDisposable
{

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

@ -1,4 +1,4 @@
namespace Microsoft.Azure.Devices.Applications.RemoteMonitoring.EventProcessor.WorkerRole.Processors
namespace Microsoft.Azure.Devices.Applications.RemoteMonitoring.EventProcessor.WebJob.Processors
{
public interface IActionEventProcessor
{

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

@ -1,4 +1,4 @@
namespace Microsoft.Azure.Devices.Applications.RemoteMonitoring.EventProcessor.WorkerRole.Processors
namespace Microsoft.Azure.Devices.Applications.RemoteMonitoring.EventProcessor.WebJob.Processors
{
using System.Threading;

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

@ -1,4 +1,4 @@
namespace Microsoft.Azure.IoT.Samples.EventProcessor.WorkerRole.Processors
namespace Microsoft.Azure.IoT.Samples.EventProcessor.WebJob.Processors
{
public interface IMessageFeedbackProcessor
{

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

@ -10,7 +10,7 @@ using Microsoft.Azure.Devices.Applications.RemoteMonitoring.DeviceAdmin.Infrastr
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Common.Configurations;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Common.DeviceSchema;
namespace Microsoft.Azure.IoT.Samples.EventProcessor.WorkerRole.Processors
namespace Microsoft.Azure.IoT.Samples.EventProcessor.WebJob.Processors
{
public class MessageFeedbackProcessor : IMessageFeedbackProcessor, IDisposable
{

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

@ -0,0 +1,119 @@
using System;
using System.Diagnostics;
using System.Threading;
using System.Threading.Tasks;
using Autofac;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.EventProcessor.WebJob.Processors;
using Microsoft.Azure.IoT.Samples.EventProcessor.WebJob.Processors;
namespace Microsoft.Azure.Devices.Applications.RemoteMonitoring.EventProcessor.WebJob
{
using System.IO;
public static class Program
{
static CancellationTokenSource cancellationTokenSource = new CancellationTokenSource();
static IContainer eventProcessorContainer;
private const string SHUTDOWN_FILE_ENV_VAR = "WEBJOBS_SHUTDOWN_FILE";
private static string _shutdownFile;
private static Timer _timer;
static void Main(string[] args)
{
try
{
// Cloud deploys often get staged and started to warm them up, then get a shutdown
// signal from the framework before being moved to the production slot. We don't want
// to start initializing data if we have already gotten the shutdown message, so we'll
// monitor it. This environment variable is reliable
// http://blog.amitapple.com/post/2014/05/webjobs-graceful-shutdown/#.VhVYO6L8-B4
_shutdownFile = Environment.GetEnvironmentVariable(SHUTDOWN_FILE_ENV_VAR);
bool shutdownSignalReceived = false;
// Setup a file system watcher on that file's directory to know when the file is created
// First check for null, though. This does not exist on a localhost deploy, only cloud
if (!string.IsNullOrWhiteSpace(_shutdownFile))
{
var fileSystemWatcher = new FileSystemWatcher(Path.GetDirectoryName(_shutdownFile));
fileSystemWatcher.Created += OnShutdownFileChanged;
fileSystemWatcher.Changed += OnShutdownFileChanged;
fileSystemWatcher.NotifyFilter = NotifyFilters.CreationTime | NotifyFilters.FileName | NotifyFilters.LastWrite;
fileSystemWatcher.IncludeSubdirectories = false;
fileSystemWatcher.EnableRaisingEvents = true;
// In case the file had already been created before we started watching it.
if (System.IO.File.Exists(_shutdownFile))
{
shutdownSignalReceived = true;
}
}
if (!shutdownSignalReceived)
{
BuildContainer();
StartEventProcessorHost();
StartActionProcessorHost();
StartMessageFeedbackProcessorHost();
RunAsync().Wait();
}
}
catch (Exception ex)
{
cancellationTokenSource.Cancel();
Trace.TraceError("Webjob terminating: {0}", ex.ToString());
}
}
private static void OnShutdownFileChanged(object sender, FileSystemEventArgs e)
{
if (e.FullPath.IndexOf(Path.GetFileName(_shutdownFile), StringComparison.OrdinalIgnoreCase) >= 0)
{
cancellationTokenSource.Cancel();
}
}
static void BuildContainer()
{
var builder = new ContainerBuilder();
builder.RegisterModule(new EventProcessorModule());
eventProcessorContainer = builder.Build();
}
static void StartEventProcessorHost()
{
Trace.TraceInformation("Starting Event Processor");
var eventProcessor = eventProcessorContainer.Resolve<IDeviceEventProcessor>();
eventProcessor.Start(cancellationTokenSource.Token);
}
static void StartActionProcessorHost()
{
Trace.TraceInformation("Starting action processor");
var actionProcessor = eventProcessorContainer.Resolve<IActionEventProcessor>();
actionProcessor.Start();
}
static void StartMessageFeedbackProcessorHost()
{
Trace.TraceInformation("Starting command feedback processor");
var feedbackProcessor = eventProcessorContainer.Resolve<IMessageFeedbackProcessor>();
feedbackProcessor.Start();
}
static async Task RunAsync()
{
while (!cancellationTokenSource.Token.IsCancellationRequested)
{
Trace.TraceInformation("Running");
try
{
await Task.Delay(TimeSpan.FromMinutes(5), cancellationTokenSource.Token);
}
catch (TaskCanceledException) { }
}
}
}
}

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

@ -5,7 +5,7 @@ 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("EventProcessor.WorkerRole")]
[assembly: AssemblyTitle("EventProcessor.WebJob")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft")]

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

@ -1,6 +1,6 @@
{
"$schema": "http://schemastore.org/schemas/json/webjob-publish-settings.json",
"webJobName": "DeviceAdministration-WebJob",
"webJobName": "EventProcessor-WebJob",
"startTime": null,
"endTime": null,
"jobRecurrenceFrequency": null,

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

@ -3,7 +3,8 @@
<system.diagnostics>
<trace>
<listeners>
<add type="Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics, Version=2.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" name="AzureDiagnostics">
<add name="consoleListener" type="System.Diagnostics.ConsoleTraceListener" />
<add type="Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics, Version=2.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" name="AzureDiagnostics">
<filter type="" />
</add>
</listeners>
@ -88,6 +89,26 @@
</extensions>
</system.serviceModel>
<appSettings>
<add key="Microsoft.ServiceBus.ConnectionString" value="Endpoint=sb://[your namespace].servicebus.windows.net;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=[your secret]" />
<add key="docdb.EndpointUrl" value="config:DocDbEndPoint" />
<add key="docdb.PrimaryAuthorizationKey" value="config:DocDBKey" />
<add key="docdb.DatabaseId" value="DevMgmtDB" />
<add key="docdb.DocumentCollectionId" value="DevMgmtCollection" />
<add key="iotHub.HostName" value="config:IotHubName" />
<add key="iotHub.ConnectionString" value="config:IotHubConnectionString" />
<add key="eventHub.HubName" value="config:ServiceEHName" />
<add key="eventHub.ConnectionString" value="config:ServiceSBConnectionString" />
<add key="eventHub.StorageConnectionString" value="config:ServiceStoreAccountConnectionString" />
<add key="device.StorageConnectionString" value="config:ServiceStoreAccountConnectionString" />
<add key="device.TableName" value="config:DeviceTableName" />
<add key="ObjectTypePrefix" value="config:ObjectTypePrefix" />
<add key="RulesEventHub.Name" value="config:RulesEventHubName" />
<add key="RulesEventHub.ConnectionString" value="config:RulesEventHubConnectionString" />
<add key="DeviceRulesStoreContainerName" value="devicerules" />
<add key="DeviceRulesTableName" value="DeviceRulesNormalizedTable" />
<add key="ActionMappingStoreContainerName" value="actionmappings" />
<add key="ActionMappingStoreBlobName" value="mappings.json" />
<add key="AsaRefDataRulesBlobName" value="devicerules.json" />
<add key="DevicePollIntervalSeconds" value="20" />
<add key="UseConfigForDeviceList" value="False" />
</appSettings>
</configuration>

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

@ -17,6 +17,7 @@
<package id="Microsoft.Owin" version="3.0.1" targetFramework="net451" />
<package id="Microsoft.Owin.Host.SystemWeb" version="3.0.1" targetFramework="net451" />
<package id="Microsoft.Owin.Hosting" version="3.0.1" targetFramework="net451" />
<package id="Microsoft.Web.WebJobs.Publish" version="1.0.3" targetFramework="net451" />
<package id="Microsoft.WindowsAzure.ConfigurationManager" version="3.1.0" targetFramework="net451" />
<package id="Newtonsoft.Json" version="7.0.1" targetFramework="net451" />
<package id="Owin" version="1.0" targetFramework="net451" />

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

@ -9,9 +9,9 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Web", "DeviceAdministration
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Infrastructure", "DeviceAdministration\Infrastructure\Infrastructure.csproj", "{54B5B211-B661-42E9-AF2D-87712A37D608}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EventProcessor.WorkerRole", "EventProcessor\EventProcessor.WorkerRole\EventProcessor.WorkerRole.csproj", "{588C29C8-3BF8-4CF6-89A7-33D611388E0E}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EventProcessor.WebJob", "EventProcessor\EventProcessor.WebJob\EventProcessor.WebJob.csproj", "{588C29C8-3BF8-4CF6-89A7-33D611388E0E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Simulator.WorkerRole", "Simulator\Simulator.WorkerRole\Simulator.WorkerRole.csproj", "{8F0FF371-2306-4210-9C22-0D0657B595DC}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Simulator.WebJob", "Simulator\Simulator.WebJob\Simulator.WebJob.csproj", "{8F0FF371-2306-4210-9C22-0D0657B595DC}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{3E3CB1FA-112D-49FB-A60A-71085BF01992}"
ProjectSection(SolutionItems) = preProject
@ -22,8 +22,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{3E3CB1
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Infrastructure.UnitTests", "DeviceAdministration\Infrastructure.UnitTests\Infrastructure.UnitTests.csproj", "{008E8267-1703-4108-904A-99C1B9ED8F7A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebJob", "DeviceAdministration\WebJob\WebJob.csproj", "{8F9CAF4E-8537-4398-A1C2-C39CC4136B69}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebJobHost", "WebJobHost\WebJobHost.csproj", "{350C5961-0778-45F8-9A59-D309FCD653DD}"
EndProject
Global
@ -56,10 +54,6 @@ Global
{008E8267-1703-4108-904A-99C1B9ED8F7A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{008E8267-1703-4108-904A-99C1B9ED8F7A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{008E8267-1703-4108-904A-99C1B9ED8F7A}.Release|Any CPU.Build.0 = Release|Any CPU
{8F9CAF4E-8537-4398-A1C2-C39CC4136B69}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8F9CAF4E-8537-4398-A1C2-C39CC4136B69}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8F9CAF4E-8537-4398-A1C2-C39CC4136B69}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8F9CAF4E-8537-4398-A1C2-C39CC4136B69}.Release|Any CPU.Build.0 = Release|Any CPU
{350C5961-0778-45F8-9A59-D309FCD653DD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{350C5961-0778-45F8-9A59-D309FCD653DD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{350C5961-0778-45F8-9A59-D309FCD653DD}.Release|Any CPU.ActiveCfg = Release|Any CPU

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

@ -7,13 +7,13 @@ using System.Threading.Tasks;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Common.Configurations;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Common.Models;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Common.Repository;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.SimulatorCore.Devices;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.SimulatorCore.Devices.Factory;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.SimulatorCore.Logging;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.SimulatorCore.Telemetry.Factory;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.SimulatorCore.Transport.Factory;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.SimulatorCore.Devices;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.SimulatorCore.Devices.Factory;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.SimulatorCore.Logging;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.SimulatorCore.Telemetry.Factory;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.SimulatorCore.Transport.Factory;
namespace Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole
namespace Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob
{
/// <summary>
/// Creates multiple devices with events for testing.

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

@ -2,11 +2,11 @@ using System;
using System.Threading.Tasks;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Common.DeviceSchema;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Common.Helpers;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.Cooler.Devices;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.SimulatorCore.CommandProcessors;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.SimulatorCore.Transport;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.Cooler.Devices;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.SimulatorCore.CommandProcessors;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.SimulatorCore.Transport;
namespace Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.Cooler.CommandProcessors
namespace Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.Cooler.CommandProcessors
{
/// <summary>
/// Command processor to handle the change in device state.

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

@ -3,11 +3,11 @@ using System.Runtime.ExceptionServices;
using System.Threading.Tasks;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Common.DeviceSchema;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Common.Helpers;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.Cooler.Devices;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.SimulatorCore.CommandProcessors;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.SimulatorCore.Transport;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.Cooler.Devices;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.SimulatorCore.CommandProcessors;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.SimulatorCore.Transport;
namespace Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.Cooler.CommandProcessors
namespace Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.Cooler.CommandProcessors
{
/// <summary>
/// Command processor to handle the change in the temperature range

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

@ -3,11 +3,11 @@ using System.Runtime.ExceptionServices;
using System.Threading.Tasks;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Common.DeviceSchema;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Common.Helpers;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.Cooler.Devices;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.SimulatorCore.CommandProcessors;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.SimulatorCore.Transport;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.Cooler.Devices;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.SimulatorCore.CommandProcessors;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.SimulatorCore.Transport;
namespace Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.Cooler.CommandProcessors
namespace Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.Cooler.CommandProcessors
{
/// <summary>
/// Command processor to handle activating external temperature

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

@ -1,10 +1,10 @@
using System;
using System.Threading.Tasks;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.Cooler.Devices;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.SimulatorCore.CommandProcessors;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.SimulatorCore.Transport;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.Cooler.Devices;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.SimulatorCore.CommandProcessors;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.SimulatorCore.Transport;
namespace Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.Cooler.CommandProcessors
namespace Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.Cooler.CommandProcessors
{
/// <summary>
/// Command processor to start telemetry data

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

@ -1,10 +1,10 @@
using System;
using System.Threading.Tasks;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.Cooler.Devices;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.SimulatorCore.CommandProcessors;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.SimulatorCore.Transport;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.Cooler.Devices;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.SimulatorCore.CommandProcessors;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.SimulatorCore.Transport;
namespace Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.Cooler.CommandProcessors
namespace Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.Cooler.CommandProcessors
{
/// <summary>
/// Command processor to stop telemetry data

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

@ -1,13 +1,13 @@
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Common.Configurations;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.Cooler.CommandProcessors;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.Cooler.Telemetry;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.SimulatorCore.CommandProcessors;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.SimulatorCore.Devices;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.SimulatorCore.Logging;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.SimulatorCore.Telemetry.Factory;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.SimulatorCore.Transport.Factory;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.Cooler.CommandProcessors;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.Cooler.Telemetry;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.SimulatorCore.CommandProcessors;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.SimulatorCore.Devices;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.SimulatorCore.Logging;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.SimulatorCore.Telemetry.Factory;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.SimulatorCore.Transport.Factory;
namespace Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.Cooler.Devices
namespace Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.Cooler.Devices
{
/// <summary>
/// Implementation of a specific device type that extends the BaseDevice functionality

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

@ -1,12 +1,12 @@
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Common.Configurations;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Common.Models;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.SimulatorCore.Devices;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.SimulatorCore.Devices.Factory;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.SimulatorCore.Logging;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.SimulatorCore.Telemetry.Factory;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.SimulatorCore.Transport.Factory;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.SimulatorCore.Devices;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.SimulatorCore.Devices.Factory;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.SimulatorCore.Logging;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.SimulatorCore.Telemetry.Factory;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.SimulatorCore.Transport.Factory;
namespace Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.Cooler.Devices.Factory
namespace Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.Cooler.Devices.Factory
{
public class CoolerDeviceFactory : IDeviceFactory
{

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

@ -1,4 +1,4 @@
namespace Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.Cooler.Telemetry.Data
namespace Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.Cooler.Telemetry.Data
{
public class RemoteMonitorTelemetryData
{

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

@ -1,8 +1,8 @@
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.SimulatorCore.Devices;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.SimulatorCore.Logging;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.SimulatorCore.Telemetry.Factory;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.SimulatorCore.Devices;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.SimulatorCore.Logging;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.SimulatorCore.Telemetry.Factory;
namespace Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.Cooler.Telemetry.Factory
namespace Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.Cooler.Telemetry.Factory
{
public class CoolerTelemetryFactory : ITelemetryFactory
{

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

@ -2,11 +2,11 @@
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Common.SampleDataGenerator;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.Cooler.Telemetry.Data;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.SimulatorCore.Logging;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.SimulatorCore.Telemetry;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.Cooler.Telemetry.Data;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.SimulatorCore.Logging;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.SimulatorCore.Telemetry;
namespace Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.Cooler.Telemetry
namespace Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.Cooler.Telemetry
{
public class RemoteMonitorTelemetry : ITelemetry
{

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

@ -1,10 +1,10 @@
using System;
using System.Threading.Tasks;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.SimulatorCore.Devices;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.SimulatorCore.Logging;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.SimulatorCore.Telemetry;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.SimulatorCore.Devices;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.SimulatorCore.Logging;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.SimulatorCore.Telemetry;
namespace Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.Cooler.Telemetry
namespace Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.Cooler.Telemetry
{
public class StartupTelemetry : ITelemetry
{

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

@ -6,7 +6,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Microsoft.Azure.Devices.Applications.RemoteMonitoring.EventProcessor.WorkerRole.DataInitialization
namespace Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.DataInitialization
{
public class DataInitializer : IDataInitializer
{

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

@ -4,7 +4,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Microsoft.Azure.Devices.Applications.RemoteMonitoring.EventProcessor.WorkerRole.DataInitialization
namespace Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.DataInitialization
{
/// <summary>
/// Represents component to create initial data for the system

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

@ -2,10 +2,10 @@
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.SimulatorCore.Devices;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.SimulatorCore.Logging;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.SimulatorCore.Devices;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.SimulatorCore.Logging;
namespace Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole
namespace Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob
{
/// <summary>
/// Manages and coordinates all devices

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

@ -1,55 +1,46 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
using Autofac;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.EventProcessor.WorkerRole;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.EventProcessor.WorkerRole.Processors;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Common;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Common.Repository;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.Cooler.Devices.Factory;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.Cooler.Telemetry.Factory;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.SimulatorCore.Devices.Factory;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.SimulatorCore.Logging;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.SimulatorCore.Serialization;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.SimulatorCore.Transport.Factory;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.SimulatorCore.Repository;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Common.Configurations;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.EventProcessor.WorkerRole.DataInitialization;
using Microsoft.Azure.IoT.Samples.EventProcessor.WorkerRole.Processors;
using System.IO;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Common.Repository;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.Cooler.Devices.Factory;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.Cooler.Telemetry.Factory;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.DataInitialization;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.SimulatorCore.Devices.Factory;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.SimulatorCore.Logging;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.SimulatorCore.Repository;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.SimulatorCore.Serialization;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.SimulatorCore.Transport.Factory;
namespace DeviceAdministration.WebJob
namespace Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator
{
class Program
public static class Program
{
static CancellationTokenSource cancellationTokenSource = new CancellationTokenSource();
//static ManualResetEvent runCompleteEvent = new ManualResetEvent(false);
static IContainer eventProcessorContainer;
static IContainer simulatorContainer;
private const string SHUTDOWN_FILE_ENV_VAR = "WEBJOBS_SHUTDOWN_FILE";
private static string _shutdownFile;
private static bool _shutdownSignalReceived = false;
private static Timer _timer;
static void Main(string[] args)
{
try
{
//Cloud deploys often get staged and started to warm them up, then get a shutdown
//signal from the framework before being moved to the production slot. We don't want
//to start initializing data if we have already gotten the shutdown message, so we'll
//monitor it. This environment variable is reliable
//http://blog.amitapple.com/post/2014/05/webjobs-graceful-shutdown/#.VhVYO6L8-B4
// Cloud deploys often get staged and started to warm them up, then get a shutdown
// signal from the framework before being moved to the production slot. We don't want
// to start initializing data if we have already gotten the shutdown message, so we'll
// monitor it. This environment variable is reliable
// http://blog.amitapple.com/post/2014/05/webjobs-graceful-shutdown/#.VhVYO6L8-B4
_shutdownFile = Environment.GetEnvironmentVariable(SHUTDOWN_FILE_ENV_VAR);
bool shutdownSignalReceived = false;
// Setup a file system watcher on that file's directory to know when the file is created
//First check for null, though. This does not exist on a localhost deploy, only cloud
// First check for null, though. This does not exist on a localhost deploy, only cloud
if (!string.IsNullOrWhiteSpace(_shutdownFile))
{
var fileSystemWatcher = new FileSystemWatcher(Path.GetDirectoryName(_shutdownFile));
@ -59,24 +50,22 @@ namespace DeviceAdministration.WebJob
fileSystemWatcher.IncludeSubdirectories = false;
fileSystemWatcher.EnableRaisingEvents = true;
//In case the file had already been created before we started watching it.
// In case the file had already been created before we started watching it.
if (System.IO.File.Exists(_shutdownFile))
{
_shutdownSignalReceived = true;
shutdownSignalReceived = true;
}
}
BuildContainer();
if (!shutdownSignalReceived)
{
BuildContainer();
StartDataInitializationAsNeeded();
StartEventProcessorHost();
StartActionProcessorHost();
StartMessageFeedbackProcessorHost();
StartSimulator();
StartDataInitializationAsNeeded();
StartSimulator();
RunAsync().Wait();
RunAsync().Wait();
}
}
catch (Exception ex)
{
@ -85,19 +74,30 @@ namespace DeviceAdministration.WebJob
}
}
static void BuildContainer()
{
var builder = new ContainerBuilder();
builder.RegisterModule(new SimulatorModule());
simulatorContainer = builder.Build();
}
private static void OnShutdownFileChanged(object sender, FileSystemEventArgs e)
{
if (e.FullPath.IndexOf(Path.GetFileName(_shutdownFile), StringComparison.OrdinalIgnoreCase) >= 0)
{
_shutdownSignalReceived = true;
cancellationTokenSource.Cancel();
}
}
static void BuildContainer()
static void CreateInitialDataAsNeeded(object state)
{
var builder = new ContainerBuilder();
builder.RegisterModule(new EventProcessorModule());
eventProcessorContainer = builder.Build();
_timer.Dispose();
if (!cancellationTokenSource.Token.IsCancellationRequested)
{
Trace.TraceInformation("Preparing to add initial data");
var creator = simulatorContainer.Resolve<IDataInitializer>();
creator.CreateInitialDataIfNeeded();
}
}
static void StartDataInitializationAsNeeded()
@ -113,39 +113,6 @@ namespace DeviceAdministration.WebJob
_timer = new Timer(CreateInitialDataAsNeeded, null, 10000, Timeout.Infinite);
}
static void CreateInitialDataAsNeeded(object state)
{
_timer.Dispose();
if (!_shutdownSignalReceived && !cancellationTokenSource.Token.IsCancellationRequested)
{
Trace.TraceInformation("Preparing to add initial data");
var creator = eventProcessorContainer.Resolve<IDataInitializer>();
creator.CreateInitialDataIfNeeded();
}
}
static void StartEventProcessorHost()
{
Trace.TraceInformation("Starting Event Processor");
var eventProcessor = eventProcessorContainer.Resolve<IDeviceEventProcessor>();
eventProcessor.Start(cancellationTokenSource.Token);
}
static void StartActionProcessorHost()
{
Trace.TraceInformation("Starting action processor");
var actionProcessor = eventProcessorContainer.Resolve<IActionEventProcessor>();
actionProcessor.Start();
}
static void StartMessageFeedbackProcessorHost()
{
Trace.TraceInformation("Starting command feedback processor");
var feedbackProcessor = eventProcessorContainer.Resolve<IMessageFeedbackProcessor>();
feedbackProcessor.Start();
}
static void StartSimulator()
{
// Dependencies to inject into the Bulk Device Tester

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

@ -5,7 +5,7 @@ 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("Simulator.WorkerRole")]
[assembly: AssemblyTitle("Simulator.WebJob")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft")]

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

@ -1,14 +1,14 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.34209
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.Properties {
namespace Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]

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

@ -1,5 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.Properties" GeneratedClassName="Settings">
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.Properties" GeneratedClassName="Settings">
<Profiles />
<Settings>
<Setting Name="DeviceList" Type="System.Collections.Specialized.StringCollection" Scope="Application">

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

@ -0,0 +1,9 @@
{
"$schema": "http://schemastore.org/schemas/json/webjob-publish-settings.json",
"webJobName": "DeviceSimulator-WebJob",
"startTime": null,
"endTime": null,
"jobRecurrenceFrequency": null,
"interval": null,
"runMode": "Continuous"
}

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

@ -7,16 +7,31 @@
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{8F0FF371-2306-4210-9C22-0D0657B595DC}</ProjectGuid>
<OutputType>Library</OutputType>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole</RootNamespace>
<AssemblyName>Simulator.WorkerRole</AssemblyName>
<RootNamespace>Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob</RootNamespace>
<AssemblyName>Simulator.WebJob</AssemblyName>
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<RoleType>Worker</RoleType>
<TargetFrameworkProfile />
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
<RestorePackages>true</RestorePackages>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
<CheckForOverflowUnderflow>true</CheckForOverflowUnderflow>
@ -26,7 +41,14 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
<CheckForOverflowUnderflow>true</CheckForOverflowUnderflow>
</PropertyGroup>
<PropertyGroup>
<StartupObject>Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.Program</StartupObject>
</PropertyGroup>
<ItemGroup>
<Reference Include="Autofac, Version=3.5.0.0, Culture=neutral, PublicKeyToken=17863af14b0044da, processorArchitecture=MSIL">
<HintPath>..\..\packages\Autofac.3.5.2\lib\net40\Autofac.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Azure.Amqp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\packages\Microsoft.Azure.Amqp.1.0.0-preview-001-000-000\lib\net451\Microsoft.Azure.Amqp.dll</HintPath>
<Private>True</Private>
@ -70,6 +92,7 @@
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Runtime.Serialization" />
@ -77,6 +100,7 @@
<HintPath>..\..\packages\System.Spatial.5.6.4\lib\net40\System.Spatial.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Web.Extensions" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp">
@ -87,6 +111,10 @@
</ItemGroup>
<ItemGroup>
<Compile Include="BulkDeviceTester.cs" />
<Compile Include="DataInitialization\DataInitializer.cs" />
<Compile Include="DataInitialization\IDataInitializer.cs" />
<Compile Include="SimulatorModule.cs" />
<Compile Include="Program.cs" />
<Compile Include="SimulatorCore\CommandProcessors\CommandProcessor.cs" />
<Compile Include="SimulatorCore\CommandProcessors\PingDeviceProcessor.cs" />
<Compile Include="SimulatorCore\Devices\Factory\DeviceFactory.cs" />
@ -139,14 +167,36 @@
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<None Include="Properties\webjob-publish-settings.json" />
<None Include="settings.job" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="$(SolutionDir)\Common\Common.csproj">
<Project>{5959c109-5369-4ff7-8b55-605a79fdf200}</Project>
<Name>Common</Name>
</ProjectReference>
<ProjectReference Include="..\..\DeviceAdministration\Infrastructure\Infrastructure.csproj">
<Project>{54B5B211-B661-42E9-AF2D-87712A37D608}</Project>
<Name>Infrastructure</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include=".NETFramework,Version=v4.5.1">
<Visible>False</Visible>
<ProductName>Microsoft .NET Framework 4.5.1 %28x86 and x64%29</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
@ -155,6 +205,7 @@
</PropertyGroup>
<Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
</Target>
<Import Project="..\..\packages\Microsoft.Web.WebJobs.Publish.1.0.3\tools\webjobs.targets" Condition="Exists('..\..\packages\Microsoft.Web.WebJobs.Publish.1.0.3\tools\webjobs.targets')" />
<!-- 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">

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

@ -1,8 +1,8 @@
using System.Threading.Tasks;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.SimulatorCore.Devices;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.SimulatorCore.Transport;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.SimulatorCore.Devices;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.SimulatorCore.Transport;
namespace Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.SimulatorCore.CommandProcessors
namespace Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.SimulatorCore.CommandProcessors
{
/// <summary>
/// The CommandProcessor classes implement the Gang of Four's

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

@ -1,10 +1,10 @@
using System;
using System.Runtime.ExceptionServices;
using System.Threading.Tasks;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.SimulatorCore.Devices;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.SimulatorCore.Transport;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.SimulatorCore.Devices;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.SimulatorCore.Transport;
namespace Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.SimulatorCore.CommandProcessors
namespace Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.SimulatorCore.CommandProcessors
{
public class PingDeviceProcessor : CommandProcessor
{

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

@ -7,15 +7,15 @@ using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Common.DeviceSchema;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Common.Factory;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Common.Models;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Common.Models.Commands;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.SimulatorCore.CommandProcessors;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.SimulatorCore.Logging;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.SimulatorCore.Telemetry;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.SimulatorCore.Telemetry.Factory;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.SimulatorCore.Transport;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.SimulatorCore.Transport.Factory;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.SimulatorCore.CommandProcessors;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.SimulatorCore.Logging;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.SimulatorCore.Telemetry;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.SimulatorCore.Telemetry.Factory;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.SimulatorCore.Transport;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.SimulatorCore.Transport.Factory;
using Microsoft.Azure.Devices.Common.Exceptions;
namespace Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.SimulatorCore.Devices
namespace Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.SimulatorCore.Devices
{
/// <summary>
/// Simulates a single IoT device that sends and recieves data from a transport

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

@ -1,10 +1,10 @@
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Common.Configurations;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Common.Models;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.SimulatorCore.Logging;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.SimulatorCore.Telemetry.Factory;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.SimulatorCore.Transport.Factory;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.SimulatorCore.Logging;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.SimulatorCore.Telemetry.Factory;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.SimulatorCore.Transport.Factory;
namespace Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.SimulatorCore.Devices.Factory
namespace Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.SimulatorCore.Devices.Factory
{
public class DeviceFactory : IDeviceFactory
{

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

@ -1,9 +1,9 @@
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Common.Configurations;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Common.Models;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.SimulatorCore.Telemetry.Factory;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.SimulatorCore.Transport.Factory;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.SimulatorCore.Telemetry.Factory;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.SimulatorCore.Transport.Factory;
namespace Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.SimulatorCore.Devices.Factory
namespace Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.SimulatorCore.Devices.Factory
{
public interface IDeviceFactory
{

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

@ -2,9 +2,9 @@
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Common.Models;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.SimulatorCore.Telemetry;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.SimulatorCore.Telemetry;
namespace Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.SimulatorCore.Devices
namespace Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.SimulatorCore.Devices
{
/// <summary>
/// Represents a device. Implementors may be written in managed code, or a managed wrapper

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

@ -1,4 +1,4 @@
namespace Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.SimulatorCore.Logging
namespace Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.SimulatorCore.Logging
{
/// <summary>
/// Basic implementation of a loger where all functions are noops.

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

@ -1,4 +1,4 @@
namespace Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.SimulatorCore.Logging
namespace Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.SimulatorCore.Logging
{
/// <summary>
/// Simple interface to insulate the app from the logging technology

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

@ -1,6 +1,6 @@
using System.Diagnostics;
namespace Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.SimulatorCore.Logging
namespace Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.SimulatorCore.Logging
{
/// <summary>
/// Default implementation of ILogger with the System.Diagnostics.Trace

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

@ -5,9 +5,9 @@ using System.Threading.Tasks;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Common.Configurations;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Common.Models;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Common.Repository;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.SimulatorCore.Logging;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.SimulatorCore.Logging;
namespace Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.SimulatorCore.Repository
namespace Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.SimulatorCore.Repository
{
/// <summary>
/// Sample repository that pulls the initial device config from the app.config file

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

@ -1,4 +1,4 @@
namespace Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.SimulatorCore.Serialization
namespace Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.SimulatorCore.Serialization
{
/// <summary>
/// Interface to serialize & deserialize through the ITransport interface

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

@ -1,7 +1,7 @@
using System.Text;
using Newtonsoft.Json;
namespace Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.SimulatorCore.Serialization
namespace Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.SimulatorCore.Serialization
{
/// <summary>
/// JSON implementation of the ISerialize interface that serializes/deserializes

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

@ -1,9 +1,9 @@
using System;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.SimulatorCore.Logging;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.SimulatorCore.Logging;
namespace Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.SimulatorCore.Telemetry
namespace Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.SimulatorCore.Telemetry
{
/// <summary>
/// Represents a static, pre-defined group of events that a

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

@ -1,9 +1,9 @@
using System;
using System.Globalization;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.SimulatorCore.Devices;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.SimulatorCore.Logging;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.SimulatorCore.Devices;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.SimulatorCore.Logging;
namespace Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.SimulatorCore.Telemetry.Factory
namespace Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.SimulatorCore.Telemetry.Factory
{
public class GenericConcreteTelemetryFactory
{

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

@ -1,6 +1,6 @@
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.SimulatorCore.Devices;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.SimulatorCore.Devices;
namespace Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.SimulatorCore.Telemetry.Factory
namespace Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.SimulatorCore.Telemetry.Factory
{
public interface ITelemetryFactory
{

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

@ -2,7 +2,7 @@
using System.Threading;
using System.Threading.Tasks;
namespace Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.SimulatorCore.Telemetry
namespace Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.SimulatorCore.Telemetry
{
/// <summary>
/// Represents a group of one or more events that a simulated device will send to the cloud.

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

@ -1,8 +1,8 @@
using System.Diagnostics;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.SimulatorCore.Serialization;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.SimulatorCore.Serialization;
using System;
namespace Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.SimulatorCore.Transport
namespace Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.SimulatorCore.Transport
{
/// <summary>
/// Wraps the byte array returned from the cloud so that it can be deserialized

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

@ -1,10 +1,10 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.SimulatorCore.Logging;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.SimulatorCore.Serialization;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.SimulatorCore.Logging;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.SimulatorCore.Serialization;
namespace Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.SimulatorCore.Transport
namespace Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.SimulatorCore.Transport
{
public class EmptyTransport : ITransport
{

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

@ -1,6 +1,6 @@
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.SimulatorCore.Devices;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.SimulatorCore.Devices;
namespace Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.SimulatorCore.Transport.Factory
namespace Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.SimulatorCore.Transport.Factory
{
public interface ITransportFactory
{

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

@ -1,9 +1,9 @@
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Common.Configurations;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.SimulatorCore.Devices;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.SimulatorCore.Logging;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.SimulatorCore.Serialization;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.SimulatorCore.Devices;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.SimulatorCore.Logging;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.SimulatorCore.Serialization;
namespace Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.SimulatorCore.Transport.Factory
namespace Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.SimulatorCore.Transport.Factory
{
public class IotHubTransportFactory : ITransportFactory
{

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

@ -2,7 +2,7 @@
using System.Collections.Generic;
using System.Threading.Tasks;
namespace Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.SimulatorCore.Transport
namespace Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.SimulatorCore.Transport
{
/// <summary>
/// Interface to provide actions that can be performed against a cloud service such as IoT Hub

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

@ -1,16 +1,16 @@
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Common.Configurations;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Common.DeviceSchema;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Common.Helpers;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.SimulatorCore.Devices;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.SimulatorCore.Logging;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.SimulatorCore.Serialization;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.SimulatorCore.Devices;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.SimulatorCore.Logging;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.SimulatorCore.Serialization;
using Microsoft.Azure.Devices.Client;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Threading.Tasks;
namespace Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.SimulatorCore.Transport
namespace Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.SimulatorCore.Transport
{
/// <summary>
/// Implementation of ITransport that talks to IoT Hub.

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

@ -0,0 +1,63 @@
using Autofac;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Common.Configurations;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Common.Repository;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.DeviceAdmin.Infrastructure.BusinessLogic;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.DeviceAdmin.Infrastructure.Repository;
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.DataInitialization;
namespace Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob
{
using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Common.Utility;
public sealed class SimulatorModule : Module
{
protected override void Load(ContainerBuilder builder)
{
builder.RegisterType<ConfigurationProvider>()
.As<IConfigurationProvider>()
.SingleInstance();
builder.RegisterType<DeviceLogic>()
.As<IDeviceLogic>();
builder.RegisterType<DeviceRulesLogic>()
.As<IDeviceRulesLogic>();
builder.RegisterType<DeviceRegistryRepository>()
.As<IDeviceRegistryCrudRepository>();
builder.RegisterType<DeviceRegistryRepository>()
.As<IDeviceRegistryListRepository>();
builder.RegisterType<DeviceRulesRepository>()
.As<IDeviceRulesRepository>();
builder.RegisterType<IotHubRepository>()
.As<IIotHubRepository>();
builder.RegisterType<SecurityKeyGenerator>()
.As<ISecurityKeyGenerator>();
builder.RegisterType<VirtualDeviceTableStorage>()
.As<IVirtualDeviceStorage>();
builder.RegisterType<ActionMappingLogic>()
.As<IActionMappingLogic>();
builder.RegisterType<ActionMappingRepository>()
.As<IActionMappingRepository>();
builder.RegisterType<ActionLogic>()
.As<IActionLogic>();
builder.RegisterType<DataInitializer>()
.As<IDataInitializer>();
builder.RegisterType<ActionRepository>()
.As<IActionRepository>();
builder.RegisterType<DocDbRestUtility>()
.As<IDocDbRestUtility>();
}
}
}

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

@ -2,19 +2,45 @@
<configuration>
<configSections>
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<section name="Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
<section name="Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</sectionGroup>
</configSections>
<system.diagnostics>
<trace>
<listeners>
<add type="Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics, Version=2.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" name="AzureDiagnostics">
<filter type="" />
</add>
</listeners>
</trace>
</system.diagnostics>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.1" /></startup>
<system.diagnostics>
<trace>
<listeners>
<add name="consoleListener" type="System.Diagnostics.ConsoleTraceListener" />
<add type="Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics, Version=2.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" name="AzureDiagnostics">
<filter type="" />
</add>
</listeners>
</trace>
</system.diagnostics>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.1" />
</startup>
<appSettings>
<add key="docdb.EndpointUrl" value="config:DocDbEndPoint" />
<add key="docdb.PrimaryAuthorizationKey" value="config:DocDBKey" />
<add key="docdb.DatabaseId" value="DevMgmtDB" />
<add key="docdb.DocumentCollectionId" value="DevMgmtCollection" />
<add key="iotHub.HostName" value="config:IotHubName" />
<add key="iotHub.ConnectionString" value="config:IotHubConnectionString" />
<add key="eventHub.HubName" value="config:ServiceEHName" />
<add key="eventHub.ConnectionString" value="config:ServiceSBConnectionString" />
<add key="eventHub.StorageConnectionString" value="config:ServiceStoreAccountConnectionString" />
<add key="device.StorageConnectionString" value="config:ServiceStoreAccountConnectionString" />
<add key="device.TableName" value="config:DeviceTableName" />
<add key="ObjectTypePrefix" value="config:ObjectTypePrefix" />
<add key="RulesEventHub.Name" value="config:RulesEventHubName" />
<add key="RulesEventHub.ConnectionString" value="config:RulesEventHubConnectionString" />
<add key="DeviceRulesStoreContainerName" value="devicerules" />
<add key="DeviceRulesTableName" value="DeviceRulesNormalizedTable" />
<add key="ActionMappingStoreContainerName" value="actionmappings" />
<add key="ActionMappingStoreBlobName" value="mappings.json" />
<add key="AsaRefDataRulesBlobName" value="devicerules.json" />
<add key="DevicePollIntervalSeconds" value="20" />
<add key="UseConfigForDeviceList" value="False" />
</appSettings>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
@ -56,7 +82,7 @@
Update this list with a valid set of deviceIds, primary key and secondary key, comma delimited
-->
<applicationSettings>
<Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.Properties.Settings>
<Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.Properties.Settings>
<setting name="DeviceList" serializeAs="Xml">
<value>
<ArrayOfString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
@ -64,6 +90,6 @@
</ArrayOfString>
</value>
</setting>
</Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WorkerRole.Properties.Settings>
</Microsoft.Azure.Devices.Applications.RemoteMonitoring.Simulator.WebJob.Properties.Settings>
</applicationSettings>
</configuration>
</configuration>

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

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Autofac" version="3.5.2" targetFramework="net451" />
<package id="Microsoft.AspNet.WebApi.Client" version="5.2.3" targetFramework="net451" />
<package id="Microsoft.AspNet.WebApi.Core" version="5.2.3" targetFramework="net451" />
<package id="Microsoft.Azure.Amqp" version="1.0.0-preview-001-000-000" targetFramework="net451" />
@ -9,6 +10,7 @@
<package id="Microsoft.Data.Edm" version="5.6.4" targetFramework="net451" />
<package id="Microsoft.Data.OData" version="5.6.4" targetFramework="net451" />
<package id="Microsoft.Data.Services.Client" version="5.6.4" targetFramework="net451" />
<package id="Microsoft.Web.WebJobs.Publish" version="1.0.3" targetFramework="net451" />
<package id="Newtonsoft.Json" version="7.0.1" targetFramework="net451" />
<package id="System.Spatial" version="5.6.4" targetFramework="net451" />
<package id="Unofficial.Microsoft.WindowsAzure.Diagnostics" version="2.7.0.0" targetFramework="net451" />

26
WebJobHost/App.config Normal file
Просмотреть файл

@ -0,0 +1,26 @@
<?xml version="1.0"?>
<configuration>
<appSettings>
<add key="docdb.EndpointUrl" value="config:DocDbEndPoint" />
<add key="docdb.PrimaryAuthorizationKey" value="config:DocDBKey" />
<add key="docdb.DatabaseId" value="DevMgmtDB" />
<add key="docdb.DocumentCollectionId" value="DevMgmtCollection" />
<add key="iotHub.HostName" value="config:IotHubName" />
<add key="iotHub.ConnectionString" value="config:IotHubConnectionString" />
<add key="eventHub.HubName" value="config:ServiceEHName" />
<add key="eventHub.ConnectionString" value="config:ServiceSBConnectionString" />
<add key="eventHub.StorageConnectionString" value="config:ServiceStoreAccountConnectionString" />
<add key="device.StorageConnectionString" value="config:ServiceStoreAccountConnectionString" />
<add key="device.TableName" value="config:DeviceTableName" />
<add key="ObjectTypePrefix" value="config:ObjectTypePrefix" />
<add key="RulesEventHub.Name" value="config:RulesEventHubName" />
<add key="RulesEventHub.ConnectionString" value="config:RulesEventHubConnectionString" />
<add key="DeviceRulesStoreContainerName" value="devicerules" />
<add key="DeviceRulesTableName" value="DeviceRulesNormalizedTable" />
<add key="ActionMappingStoreContainerName" value="actionmappings" />
<add key="ActionMappingStoreBlobName" value="mappings.json" />
<add key="AsaRefDataRulesBlobName" value="devicerules.json" />
<add key="DevicePollIntervalSeconds" value="20" />
<add key="UseConfigForDeviceList" value="False" />
</appSettings>
</configuration>

1
WebJobHost/Global.asax Normal file
Просмотреть файл

@ -0,0 +1 @@
<%@ Application Codebehind="Global.asax.cs" Inherits="Microsoft.Azure.Devices.Applications.RemoteMonitoring.DeviceAdmin.Web.MvcApplication" Language="C#" %>

13
WebJobHost/Global.asax.cs Normal file
Просмотреть файл

@ -0,0 +1,13 @@
using System.Diagnostics;
namespace Microsoft.Azure.Devices.Applications.RemoteMonitoring.DeviceAdmin.Web
{
public class MvcApplication : System.Web.HttpApplication
{
protected void Application_Start()
{
// Do nothing else here, need application class for host.
Trace.TraceInformation("WebJobHost starting...");
}
}
}

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

@ -2,7 +2,10 @@
"$schema": "http://schemastore.org/schemas/json/webjobs-list.json",
"WebJobs": [
{
"filePath": "../DeviceAdministration/WebJob/WebJob.csproj"
"filePath": "../EventProcessor/EventProcessor.WebJob/EventProcessor.WebJob.csproj"
},
{
"filePath": "../Simulator/Simulator.WebJob/Simulator.WebJob.csproj"
}
]
}

16
WebJobHost/Startup.cs Normal file
Просмотреть файл

@ -0,0 +1,16 @@
using Microsoft.Owin;
using Owin;
[assembly: OwinStartup(typeof(WebJobHost.Startup))]
namespace WebJobHost
{
public class Startup
{
public void Configuration(IAppBuilder app)
{
// For more information on how to configure your application, visit http://go.microsoft.com/fwlink/?LinkID=316888
// Do nothing on startup
}
}
}

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

@ -1,4 +1,4 @@
<?xml version="1.0"?>
<?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
@ -13,67 +13,48 @@
</system.Web>
-->
<system.web>
<compilation debug="true" targetFramework="4.5.1"/>
<httpRuntime targetFramework="4.5"/>
<globalization culture="auto" uiCulture="auto" enableClientBasedCulture="true"/>
<customErrors mode="RemoteOnly"/>
<sessionState mode="Off"/>
<compilation debug="true" targetFramework="4.5.1" />
<httpRuntime targetFramework="4.5" />
<globalization culture="auto" uiCulture="auto" enableClientBasedCulture="true" />
<customErrors mode="RemoteOnly" />
<sessionState mode="Off" />
</system.web>
<appSettings>
<add key="ida.AADTenant" value="config:AADTenant"/>
<add key="ida.AADAudience" value="config:AADAudience"/>
<add key="ida.FederationMetadataAddress" value="config:AADMetadataAddress"/>
<add key="ida.FederationRealm" value="config:AADRealm"/>
<add key="docdb.EndpointUrl" value="config:DocDbEndPoint"/>
<add key="docdb.PrimaryAuthorizationKey" value="config:DocDBKey"/>
<add key="docdb.DatabaseId" value="DevMgmtDB"/>
<add key="docdb.DocumentCollectionId" value="DevMgmtCollection"/>
<add key="iotHub.HostName" value="config:IotHubName"/>
<add key="iotHub.ConnectionString" value="config:IotHubConnectionString"/>
<add key="device.StorageConnectionString" value="config:ServiceStoreAccountConnectionString"/>
<add key="device.TableName" value="config:DeviceTableName"/>
<add key="DeviceRulesStoreContainerName" value="devicerules"/>
<add key="DeviceRulesTableName" value="DeviceRulesNormalizedTable"/>
<add key="ActionMappingStoreContainerName" value="actionmappings"/>
<add key="ActionMappingStoreBlobName" value="mappings.json"/>
<add key="AsaRefDataRulesBlobName" value="devicerules.json"/>
<add key="SolutionName" value="Remote Monitoring Solution"/>
<add key="TelemetryStoreContainerName" value="devicetelemetry"/>
<add key="TelemetryDataPrefix" value="devicetelemetry/"/>
<add key="TelemetrySummaryPrefix" value="devicetelemetry-summary/"/>
<add key="AlertsStoreContainerName" value="rulesoutput"/>
<add key="DeviceAlertsDataPrefix" value=""/>
<add key="MapApiQueryKey" value="config:MapApiQueryKey"/>
</appSettings>
<system.diagnostics>
<trace autoflush="true">
<listeners>
<add name="consoleListener" type="System.Diagnostics.ConsoleTraceListener" />
</listeners>
</trace>
</system.diagnostics>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0"/>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.WindowsAzure.ServiceRuntime" publicKeyToken="31bf3856ad364e35" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-2.7.0.0" newVersion="2.7.0.0"/>
<assemblyIdentity name="Microsoft.WindowsAzure.ServiceRuntime" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.7.0.0" newVersion="2.7.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Net.Http.Formatting" publicKeyToken="31bf3856ad364e35" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0"/>
<assemblyIdentity name="System.Net.Http.Formatting" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.WindowsAzure.Storage" publicKeyToken="31bf3856ad364e35" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-5.0.2.0" newVersion="5.0.2.0"/>
<assemblyIdentity name="Microsoft.WindowsAzure.Storage" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.0.2.0" newVersion="5.0.2.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Owin" publicKeyToken="31bf3856ad364e35" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0"/>
<assemblyIdentity name="Microsoft.Owin" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Http" publicKeyToken="31bf3856ad364e35" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0"/>
<assemblyIdentity name="System.Web.Http" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Http.Owin" publicKeyToken="31bf3856ad364e35" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0"/>
<assemblyIdentity name="System.Web.Http.Owin" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>

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

@ -42,6 +42,14 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.CSharp" />
<Reference Include="Microsoft.Owin, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Owin.3.0.1\lib\net45\Microsoft.Owin.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Owin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=f0ebd12fd5e55cc5, processorArchitecture=MSIL">
<HintPath>..\packages\Owin.1.0\lib\net40\Owin.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Web.DynamicData" />
<Reference Include="System.Web.Entity" />
@ -59,8 +67,10 @@
<Reference Include="System.Xml.Linq" />
</ItemGroup>
<ItemGroup>
<Content Include="Global.asax" />
<Content Include="Properties\webjobs-list.json" />
<Content Include="packages.config" />
<None Include="app.config" />
<None Include="Web.Debug.config">
<DependentUpon>Web.config</DependentUpon>
</None>
@ -69,17 +79,25 @@
</None>
</ItemGroup>
<ItemGroup>
<Content Include="Web.config">
<None Include="Web.config">
<SubType>Designer</SubType>
</Content>
</None>
</ItemGroup>
<ItemGroup>
<Compile Include="Global.asax.cs">
<DependentUpon>Global.asax</DependentUpon>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Startup.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\DeviceAdministration\WebJob\WebJob.csproj">
<Project>{8f9caf4e-8537-4398-a1c2-c39cc4136b69}</Project>
<Name>WebJob</Name>
<ProjectReference Include="..\EventProcessor\EventProcessor.WebJob\EventProcessor.WebJob.csproj">
<Project>{588c29c8-3bf8-4cf6-89a7-33d611388e0e}</Project>
<Name>EventProcessor.WebJob</Name>
</ProjectReference>
<ProjectReference Include="..\Simulator\Simulator.WebJob\Simulator.WebJob.csproj">
<Project>{8f0ff371-2306-4210-9c22-0d0657b595dc}</Project>
<Name>Simulator.WebJob</Name>
</ProjectReference>
</ItemGroup>
<PropertyGroup>

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

@ -1,4 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.Owin" version="3.0.1" targetFramework="net451" />
<package id="Microsoft.Web.WebJobs.Publish" version="1.0.3" targetFramework="net45" />
<package id="Owin" version="1.0" targetFramework="net451" />
</packages>