From 8626d7e769206b4fbc118dd2e7d89a15e66543c1 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Fri, 8 Dec 2017 15:02:54 -0500 Subject: [PATCH] events processor web job project --- bitwarden-core.sln | 9 +- src/EventsProcessor/App.config | 40 ++++++ src/EventsProcessor/EventsProcessor.csproj | 123 ++++++++++++++++++ src/EventsProcessor/Functions.cs | 17 +++ src/EventsProcessor/Program.cs | 19 +++ .../Properties/AssemblyInfo.cs | 35 +++++ .../Properties/webjob-publish-settings.json | 5 + src/EventsProcessor/packages.config | 14 ++ 8 files changed, 261 insertions(+), 1 deletion(-) create mode 100644 src/EventsProcessor/App.config create mode 100644 src/EventsProcessor/EventsProcessor.csproj create mode 100644 src/EventsProcessor/Functions.cs create mode 100644 src/EventsProcessor/Program.cs create mode 100644 src/EventsProcessor/Properties/AssemblyInfo.cs create mode 100644 src/EventsProcessor/Properties/webjob-publish-settings.json create mode 100644 src/EventsProcessor/packages.config diff --git a/bitwarden-core.sln b/bitwarden-core.sln index 9865ab235c..8bc449fdba 100644 --- a/bitwarden-core.sln +++ b/bitwarden-core.sln @@ -43,7 +43,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Function", "util\Function\F EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Icons", "src\Icons\Icons.csproj", "{9CF59342-3912-4B45-A2BA-0F173666586D}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Events", "src\Events\Events.csproj", "{994DD611-F266-4BD3-8072-3B1B57267ED5}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Events", "src\Events\Events.csproj", "{994DD611-F266-4BD3-8072-3B1B57267ED5}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EventsProcessor", "src\EventsProcessor\EventsProcessor.csproj", "{FCB77723-0FF5-4B1B-AB90-6930CF2E25F9}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -101,6 +103,10 @@ Global {994DD611-F266-4BD3-8072-3B1B57267ED5}.Debug|Any CPU.Build.0 = Debug|Any CPU {994DD611-F266-4BD3-8072-3B1B57267ED5}.Release|Any CPU.ActiveCfg = Release|Any CPU {994DD611-F266-4BD3-8072-3B1B57267ED5}.Release|Any CPU.Build.0 = Release|Any CPU + {FCB77723-0FF5-4B1B-AB90-6930CF2E25F9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FCB77723-0FF5-4B1B-AB90-6930CF2E25F9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FCB77723-0FF5-4B1B-AB90-6930CF2E25F9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FCB77723-0FF5-4B1B-AB90-6930CF2E25F9}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -118,6 +124,7 @@ Global {A6C44A84-8E51-4C64-B9C4-7B7C23253345} = {DD5BD056-4AAE-43EF-BBD2-0B569B8DA84E} {9CF59342-3912-4B45-A2BA-0F173666586D} = {DD5BD056-4AAE-43EF-BBD2-0B569B8DA84D} {994DD611-F266-4BD3-8072-3B1B57267ED5} = {DD5BD056-4AAE-43EF-BBD2-0B569B8DA84D} + {FCB77723-0FF5-4B1B-AB90-6930CF2E25F9} = {DD5BD056-4AAE-43EF-BBD2-0B569B8DA84D} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {E01CBF68-2E20-425F-9EDB-E0A6510CA92F} diff --git a/src/EventsProcessor/App.config b/src/EventsProcessor/App.config new file mode 100644 index 0000000000..73da09f0fc --- /dev/null +++ b/src/EventsProcessor/App.config @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/EventsProcessor/EventsProcessor.csproj b/src/EventsProcessor/EventsProcessor.csproj new file mode 100644 index 0000000000..e49261a0bf --- /dev/null +++ b/src/EventsProcessor/EventsProcessor.csproj @@ -0,0 +1,123 @@ + + + + + Debug + AnyCPU + {FCB77723-0FF5-4B1B-AB90-6930CF2E25F9} + Exe + Properties + Bit.EventsProcessor + EventsProcessor + v4.7 + 512 + true + + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + true + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\..\packages\Microsoft.Azure.KeyVault.Core.2.0.4\lib\net45\Microsoft.Azure.KeyVault.Core.dll + + + ..\..\packages\Microsoft.Azure.WebJobs.Core.2.0.0\lib\net45\Microsoft.Azure.WebJobs.dll + + + ..\..\packages\Microsoft.Azure.WebJobs.2.0.0\lib\net45\Microsoft.Azure.WebJobs.Host.dll + + + ..\..\packages\Microsoft.Data.Edm.5.8.3\lib\net40\Microsoft.Data.Edm.dll + + + ..\..\packages\Microsoft.Data.OData.5.8.3\lib\net40\Microsoft.Data.OData.dll + + + ..\..\packages\Microsoft.Data.Services.Client.5.8.3\lib\net40\Microsoft.Data.Services.Client.dll + + + ..\..\packages\Microsoft.WindowsAzure.ConfigurationManager.3.2.3\lib\net40\Microsoft.WindowsAzure.Configuration.dll + + + ..\..\packages\WindowsAzure.Storage.8.6.0\lib\net45\Microsoft.WindowsAzure.Storage.dll + + + ..\..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll + + + + + ..\..\packages\System.Spatial.5.8.3\lib\net40\System.Spatial.dll + + + + + + + + + + + + + + + + + + + + + False + Microsoft .NET Framework 4.7 %28x86 and x64%29 + true + + + False + .NET Framework 3.5 SP1 + false + + + + + + \ No newline at end of file diff --git a/src/EventsProcessor/Functions.cs b/src/EventsProcessor/Functions.cs new file mode 100644 index 0000000000..7e00ef4db0 --- /dev/null +++ b/src/EventsProcessor/Functions.cs @@ -0,0 +1,17 @@ +using System; +using System.IO; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.Azure.WebJobs; + +namespace Bit.EventsProcessor +{ + public class Functions + { + public async static Task ProcessQueueMessageAsync( + [QueueTrigger("event")] string message, TextWriter logger, CancellationToken token) + { + await logger.WriteLineAsync(message); + } + } +} diff --git a/src/EventsProcessor/Program.cs b/src/EventsProcessor/Program.cs new file mode 100644 index 0000000000..7afb3ce558 --- /dev/null +++ b/src/EventsProcessor/Program.cs @@ -0,0 +1,19 @@ +using Microsoft.Azure.WebJobs; + +namespace Bit.EventsProcessor +{ + public class Program + { + private static void Main() + { + var config = new JobHostConfiguration(); + if(config.IsDevelopment) + { + config.UseDevelopmentSettings(); + } + + var host = new JobHost(config); + host.RunAndBlock(); + } + } +} diff --git a/src/EventsProcessor/Properties/AssemblyInfo.cs b/src/EventsProcessor/Properties/AssemblyInfo.cs new file mode 100644 index 0000000000..17fc2ad0b4 --- /dev/null +++ b/src/EventsProcessor/Properties/AssemblyInfo.cs @@ -0,0 +1,35 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("EventsProcessor")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("EventsProcessor")] +[assembly: AssemblyCopyright("Copyright © 2017")] +[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("fcb77723-0ff5-4b1b-ab90-6930cf2e25f9")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/EventsProcessor/Properties/webjob-publish-settings.json b/src/EventsProcessor/Properties/webjob-publish-settings.json new file mode 100644 index 0000000000..17bf2837ee --- /dev/null +++ b/src/EventsProcessor/Properties/webjob-publish-settings.json @@ -0,0 +1,5 @@ +{ + "$schema": "http://schemastore.org/schemas/json/webjob-publish-settings.json", + "webJobName": "EventsProcessor", + "runMode": "Continuous" +} \ No newline at end of file diff --git a/src/EventsProcessor/packages.config b/src/EventsProcessor/packages.config new file mode 100644 index 0000000000..017bdc2405 --- /dev/null +++ b/src/EventsProcessor/packages.config @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + \ No newline at end of file