From df4d19326606e02bbf5bf28f926b109bce610d7e Mon Sep 17 00:00:00 2001 From: James Randall Date: Sun, 2 Sep 2018 16:20:23 +0100 Subject: [PATCH] Compatibility with breaking changes in Azure Functions --- .../StandardFunctions/StandardFunctions.csproj | 3 ++- .../StandardFunctions/TimerTriggerFunction.cs | 16 ++++++++++++++++ FunctionMonkey.sln | 3 --- .../GettingStartedSample.csproj | 2 +- .../RestApiSample/RestApiSample.csproj | 2 +- .../ServiceBusSample/ServiceBusSample.csproj | 2 +- .../SwaggerBuildOut/SwaggerBuildOut.csproj | 2 +- .../FunctionMonkey.Abstractions.csproj | 2 +- ...FunctionMonkey.Commanding.Abstractions.csproj | 2 +- .../FunctionMonkey.Compiler.csproj | 14 ++++++++------ .../FunctionMonkey.Compiler.nuspec | 2 +- .../Implementation/AssemblyCompiler.cs | 1 + .../Implementation/TriggerReferenceProvider.cs | 1 + .../Templates/eventhubqueue.csharp.handlebars | 2 +- .../Templates/eventhubqueue.json.handlebars | 2 +- .../Templates/http.json.handlebars | 2 +- .../Templates/servicebusqueue.json.handlebars | 2 +- .../servicebussubscription.csharp.handlebars | 2 +- .../servicebussubscription.json.handlebars | 2 +- .../Templates/storageblob.csharp.handlebars | 2 +- .../Templates/storageblob.json.handlebars | 2 +- .../storageblobstream.csharp.handlebars | 2 +- .../Templates/storageblobstream.json.handlebars | 2 +- .../Templates/storagequeue.csharp.handlebars | 2 +- .../Templates/storagequeue.json.handlebars | 2 +- .../Templates/swaggerui.json.handlebars | 2 +- .../Templates/timer.csharp.handlebars | 2 +- .../Templates/timer.json.handlebars | 2 +- .../FunctionMonkey.FluentValidation.csproj | 6 +++--- Source/FunctionMonkey/FunctionMonkey.csproj | 6 +++--- .../FunctionMonkey.Tests.Integration.csproj | 2 +- docfx/guides/storage/blobs.md | 4 ++++ 32 files changed, 61 insertions(+), 39 deletions(-) create mode 100644 Exemplars/StandardFunctions/TimerTriggerFunction.cs diff --git a/Exemplars/StandardFunctions/StandardFunctions.csproj b/Exemplars/StandardFunctions/StandardFunctions.csproj index 73f85926..dfd7e7d0 100644 --- a/Exemplars/StandardFunctions/StandardFunctions.csproj +++ b/Exemplars/StandardFunctions/StandardFunctions.csproj @@ -5,7 +5,8 @@ - + + diff --git a/Exemplars/StandardFunctions/TimerTriggerFunction.cs b/Exemplars/StandardFunctions/TimerTriggerFunction.cs new file mode 100644 index 00000000..f1101b5e --- /dev/null +++ b/Exemplars/StandardFunctions/TimerTriggerFunction.cs @@ -0,0 +1,16 @@ +using System; +using Microsoft.Azure.WebJobs; +using Microsoft.Azure.WebJobs.Host; +using Microsoft.Extensions.Logging; + +namespace StandardFunctions +{ + public static class TimerTriggerFunction + { + [FunctionName("TimerTriggerFunction")] + public static void Run([TimerTrigger("0 */5 * * * *")]TimerInfo myTimer, ILogger log) + { + log.LogInformation($"C# Timer trigger function executed at: {DateTime.Now}"); + } + } +} diff --git a/FunctionMonkey.sln b/FunctionMonkey.sln index 3d478931..6c93d4b4 100644 --- a/FunctionMonkey.sln +++ b/FunctionMonkey.sln @@ -67,15 +67,12 @@ Global {C24578CA-39E0-4D82-9C31-AB58D0EC6941}.Release|Any CPU.ActiveCfg = Release|Any CPU {C24578CA-39E0-4D82-9C31-AB58D0EC6941}.Release|Any CPU.Build.0 = Release|Any CPU {DCFF70AD-24C9-451D-9A9E-CBD70B87B4B2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {DCFF70AD-24C9-451D-9A9E-CBD70B87B4B2}.Debug|Any CPU.Build.0 = Debug|Any CPU {DCFF70AD-24C9-451D-9A9E-CBD70B87B4B2}.Release|Any CPU.ActiveCfg = Release|Any CPU {DCFF70AD-24C9-451D-9A9E-CBD70B87B4B2}.Release|Any CPU.Build.0 = Release|Any CPU {33FFFEC6-9C74-4849-B3F0-1E3F7E804475}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {33FFFEC6-9C74-4849-B3F0-1E3F7E804475}.Debug|Any CPU.Build.0 = Debug|Any CPU {33FFFEC6-9C74-4849-B3F0-1E3F7E804475}.Release|Any CPU.ActiveCfg = Release|Any CPU {33FFFEC6-9C74-4849-B3F0-1E3F7E804475}.Release|Any CPU.Build.0 = Release|Any CPU {A9F41F67-7491-4F56-A20F-A07C65CEE94F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A9F41F67-7491-4F56-A20F-A07C65CEE94F}.Debug|Any CPU.Build.0 = Debug|Any CPU {A9F41F67-7491-4F56-A20F-A07C65CEE94F}.Release|Any CPU.ActiveCfg = Release|Any CPU {A9F41F67-7491-4F56-A20F-A07C65CEE94F}.Release|Any CPU.Build.0 = Release|Any CPU {488F92CA-6DEC-4E33-A517-167CF6BD02E1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU diff --git a/Samples/DocumentationSamples/GettingStartedSample/GettingStartedSample.csproj b/Samples/DocumentationSamples/GettingStartedSample/GettingStartedSample.csproj index 8ac340f1..e158d541 100644 --- a/Samples/DocumentationSamples/GettingStartedSample/GettingStartedSample.csproj +++ b/Samples/DocumentationSamples/GettingStartedSample/GettingStartedSample.csproj @@ -7,7 +7,7 @@ - + diff --git a/Samples/DocumentationSamples/RestApiSample/RestApiSample.csproj b/Samples/DocumentationSamples/RestApiSample/RestApiSample.csproj index 75c77be5..63299ce8 100644 --- a/Samples/DocumentationSamples/RestApiSample/RestApiSample.csproj +++ b/Samples/DocumentationSamples/RestApiSample/RestApiSample.csproj @@ -6,7 +6,7 @@ - + diff --git a/Samples/DocumentationSamples/ServiceBusSample/ServiceBusSample.csproj b/Samples/DocumentationSamples/ServiceBusSample/ServiceBusSample.csproj index 75c77be5..63299ce8 100644 --- a/Samples/DocumentationSamples/ServiceBusSample/ServiceBusSample.csproj +++ b/Samples/DocumentationSamples/ServiceBusSample/ServiceBusSample.csproj @@ -6,7 +6,7 @@ - + diff --git a/Samples/Scratch/SwaggerBuildOut/SwaggerBuildOut.csproj b/Samples/Scratch/SwaggerBuildOut/SwaggerBuildOut.csproj index 6e0d20e4..14198790 100644 --- a/Samples/Scratch/SwaggerBuildOut/SwaggerBuildOut.csproj +++ b/Samples/Scratch/SwaggerBuildOut/SwaggerBuildOut.csproj @@ -13,7 +13,7 @@ - + diff --git a/Source/FunctionMonkey.Abstractions/FunctionMonkey.Abstractions.csproj b/Source/FunctionMonkey.Abstractions/FunctionMonkey.Abstractions.csproj index e41674e3..917835e1 100644 --- a/Source/FunctionMonkey.Abstractions/FunctionMonkey.Abstractions.csproj +++ b/Source/FunctionMonkey.Abstractions/FunctionMonkey.Abstractions.csproj @@ -2,7 +2,7 @@ netstandard2.0 - 0.12.0-beta000 + 0.13.0-beta000 James Randall https://raw.githubusercontent.com/JamesRandall/AzureFromTheTrenches.Commanding/master/LICENSE https://commanding.azurefromthetrenches.com/ diff --git a/Source/FunctionMonkey.Commanding.Abstractions/FunctionMonkey.Commanding.Abstractions.csproj b/Source/FunctionMonkey.Commanding.Abstractions/FunctionMonkey.Commanding.Abstractions.csproj index 2f69b452..c5e2e9f1 100644 --- a/Source/FunctionMonkey.Commanding.Abstractions/FunctionMonkey.Commanding.Abstractions.csproj +++ b/Source/FunctionMonkey.Commanding.Abstractions/FunctionMonkey.Commanding.Abstractions.csproj @@ -2,7 +2,7 @@ netstandard2.0 - 0.12.0-beta000 + 0.13.0-beta000 James Randall James Randall https://raw.githubusercontent.com/JamesRandall/AzureFromTheTrenches.Commanding/master/LICENSE diff --git a/Source/FunctionMonkey.Compiler/FunctionMonkey.Compiler.csproj b/Source/FunctionMonkey.Compiler/FunctionMonkey.Compiler.csproj index a4d42397..11ef10db 100644 --- a/Source/FunctionMonkey.Compiler/FunctionMonkey.Compiler.csproj +++ b/Source/FunctionMonkey.Compiler/FunctionMonkey.Compiler.csproj @@ -3,7 +3,7 @@ Exe netcoreapp2.0 - 0.12.1-beta000 + 0.13.2-beta000 FunctionMonkey.Compiler FunctionMonkey.Compiler @@ -99,10 +99,12 @@ - + + - - + + + @@ -130,8 +132,8 @@ $(MSBuildProjectDirectory)/bin/$(Configuration)/publish/ $(IntermediatePackDir)$(TargetFramework)/ publishDir=$([MSBuild]::NormalizeDirectory($(IntermediatePackDir))) - 0.12.1.0 - 0.12.1.0 + 0.13.2.0 + 0.13.2.0 diff --git a/Source/FunctionMonkey.Compiler/FunctionMonkey.Compiler.nuspec b/Source/FunctionMonkey.Compiler/FunctionMonkey.Compiler.nuspec index f41d854c..fd56ab65 100644 --- a/Source/FunctionMonkey.Compiler/FunctionMonkey.Compiler.nuspec +++ b/Source/FunctionMonkey.Compiler/FunctionMonkey.Compiler.nuspec @@ -2,7 +2,7 @@ FunctionMonkey.Compiler - 0.12.1-beta000 + 0.13.2-beta000 James Randall Generates Azure Functions from command registrations https://raw.githubusercontent.com/JamesRandall/AzureFromTheTrenches.Commanding/master/LICENSE diff --git a/Source/FunctionMonkey.Compiler/Implementation/AssemblyCompiler.cs b/Source/FunctionMonkey.Compiler/Implementation/AssemblyCompiler.cs index 18452ece..c3e1e104 100644 --- a/Source/FunctionMonkey.Compiler/Implementation/AssemblyCompiler.cs +++ b/Source/FunctionMonkey.Compiler/Implementation/AssemblyCompiler.cs @@ -210,6 +210,7 @@ private static HashSet BuildCandidateReferenceList(IReadOnlyCollection) diff --git a/Source/FunctionMonkey.Compiler/Templates/timer.json.handlebars b/Source/FunctionMonkey.Compiler/Templates/timer.json.handlebars index b47fdda3..bb2c0b39 100644 --- a/Source/FunctionMonkey.Compiler/Templates/timer.json.handlebars +++ b/Source/FunctionMonkey.Compiler/Templates/timer.json.handlebars @@ -1,5 +1,5 @@ { - "generatedBy": "Microsoft.NET.Sdk.Functions-1.0.14", + "generatedBy": "Microsoft.NET.Sdk.Functions-1.0.19", "configurationSource": "attributes", "bindings": [ { diff --git a/Source/FunctionMonkey.FluentValidation/FunctionMonkey.FluentValidation.csproj b/Source/FunctionMonkey.FluentValidation/FunctionMonkey.FluentValidation.csproj index 9723025e..d6ee4191 100644 --- a/Source/FunctionMonkey.FluentValidation/FunctionMonkey.FluentValidation.csproj +++ b/Source/FunctionMonkey.FluentValidation/FunctionMonkey.FluentValidation.csproj @@ -2,14 +2,14 @@ netstandard2.0 - 0.12.0-beta000 + 0.13.0-beta000 James Randall James Randall https://raw.githubusercontent.com/JamesRandall/AzureFromTheTrenches.Commanding/master/LICENSE https://commanding.azurefromthetrenches.com/ https://github.com/JamesRandall/FunctionMonkey.git - 0.12.0.0 - 0.12.0.0 + 0.13.0.0 + 0.13.0.0 diff --git a/Source/FunctionMonkey/FunctionMonkey.csproj b/Source/FunctionMonkey/FunctionMonkey.csproj index ab254269..93a7b574 100644 --- a/Source/FunctionMonkey/FunctionMonkey.csproj +++ b/Source/FunctionMonkey/FunctionMonkey.csproj @@ -2,7 +2,7 @@ netstandard2.0 - 0.12.1-beta000 + 0.13.0-beta000 false James Randall @@ -10,8 +10,8 @@ https://commanding.azurefromthetrenches.com/ https://github.com/JamesRandall/FunctionMonkey.git true - 0.12.1.0 - 0.12.1.0 + 0.13.0.0 + 0.13.0.0 diff --git a/Tests/FunctionMonkey.Tests.Integration/FunctionMonkey.Tests.Integration.csproj b/Tests/FunctionMonkey.Tests.Integration/FunctionMonkey.Tests.Integration.csproj index 1f1ff153..ed16f964 100644 --- a/Tests/FunctionMonkey.Tests.Integration/FunctionMonkey.Tests.Integration.csproj +++ b/Tests/FunctionMonkey.Tests.Integration/FunctionMonkey.Tests.Integration.csproj @@ -4,7 +4,7 @@ v2 - + diff --git a/docfx/guides/storage/blobs.md b/docfx/guides/storage/blobs.md index 794c50f7..d1bdd0eb 100644 --- a/docfx/guides/storage/blobs.md +++ b/docfx/guides/storage/blobs.md @@ -12,6 +12,10 @@ First begin by creating an empty Azure Functions v2 project and then install the Install-Package FunctionMonkey -pre Install-Package FunctionMonkey.Compiler -pre +You will also need the extension package for the storage triggers (at the time of writing this is 3.0.0-beta8): + + Install-Package Microsoft.Azure.WebJobs.Extensions.Storage -pre + Now create a folder in the solution called commands and create a class called HelloWorldCommand: public class HelloWorldCommand : ICommand