Skip to content

Commit

Permalink
Compatibility with breaking changes in Azure Functions
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesRandall committed Sep 2, 2018
1 parent dbd88c6 commit df4d193
Show file tree
Hide file tree
Showing 32 changed files with 61 additions and 39 deletions.
3 changes: 2 additions & 1 deletion Exemplars/StandardFunctions/StandardFunctions.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.EventHubs" Version="3.0.0-beta5" />
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="1.0.14" />
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.Storage" Version="3.0.0-beta8" />
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="1.0.19" />
</ItemGroup>
<ItemGroup>
<None Update="host.json">
Expand Down
16 changes: 16 additions & 0 deletions Exemplars/StandardFunctions/TimerTriggerFunction.cs
Original file line number Diff line number Diff line change
@@ -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}");
}
}
}
3 changes: 0 additions & 3 deletions FunctionMonkey.sln
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<PackageReference Include="FunctionMonkey" Version="0.6.6-beta000" />
<PackageReference Include="FunctionMonkey.Compiler" Version="0.7.0-beta000" />
<PackageReference Include="FunctionMonkey.FluentValidation" Version="0.6.4-beta000" />
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="1.0.14" />
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="1.0.19" />
</ItemGroup>
<ItemGroup>
<None Update="host.json">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<ItemGroup>
<PackageReference Include="FunctionMonkey" Version="0.6.6-beta000" />
<PackageReference Include="FunctionMonkey.Compiler" Version="0.7.0-beta000" />
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="1.0.14" />
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="1.0.19" />
</ItemGroup>
<ItemGroup>
<None Update="host.json">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<ItemGroup>
<PackageReference Include="FunctionMonkey" Version="0.6.6-beta000" />
<PackageReference Include="FunctionMonkey.Compiler" Version="0.7.0-beta000" />
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="1.0.14" />
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="1.0.19" />
</ItemGroup>
<ItemGroup>
<None Update="host.json">
Expand Down
2 changes: 1 addition & 1 deletion Samples/Scratch/SwaggerBuildOut/SwaggerBuildOut.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<PackageReference Include="Autofac" Version="4.8.1" />
<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="4.2.2" />
<PackageReference Include="AzureFromTheTrenches.Commanding" Version="8.1.1" />
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="1.0.14" />
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="1.0.19" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\Source\FunctionMonkey.Abstractions\FunctionMonkey.Abstractions.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<Version>0.12.0-beta000</Version>
<Version>0.13.0-beta000</Version>
<Authors>James Randall</Authors>
<PackageLicenseUrl>https://raw.githubusercontent.com/JamesRandall/AzureFromTheTrenches.Commanding/master/LICENSE</PackageLicenseUrl>
<PackageProjectUrl>https://commanding.azurefromthetrenches.com/</PackageProjectUrl>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<Version>0.12.0-beta000</Version>
<Version>0.13.0-beta000</Version>
<Company>James Randall</Company>
<Authors>James Randall</Authors>
<PackageLicenseUrl>https://raw.githubusercontent.com/JamesRandall/AzureFromTheTrenches.Commanding/master/LICENSE</PackageLicenseUrl>
Expand Down
14 changes: 8 additions & 6 deletions Source/FunctionMonkey.Compiler/FunctionMonkey.Compiler.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.0</TargetFramework>
<Version>0.12.1-beta000</Version>
<Version>0.13.2-beta000</Version>
<AssemblyName>FunctionMonkey.Compiler</AssemblyName>
<PackageId>FunctionMonkey.Compiler</PackageId>
</PropertyGroup>
Expand Down Expand Up @@ -99,10 +99,12 @@
<PackageReference Include="AzureFromTheTrenches.Commanding" Version="8.1.1" />
<PackageReference Include="AzureFromTheTrenches.Commanding.Abstractions" Version="8.1.1" />
<PackageReference Include="Handlebars.Net" Version="1.9.5" />
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.CosmosDB" Version="3.0.0-beta7" />
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions" Version="3.0.0-beta8" />
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.CosmosDB" Version="3.0.1-beta2" />
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.EventHubs" Version="3.0.0-beta5" />
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.Http" Version="3.0.0-beta5" />
<PackageReference Include="Microsoft.Azure.WebJobs.ServiceBus" Version="3.0.0-beta5" />
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.Http" Version="3.0.0-beta8" />
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.Storage" Version="3.0.0-beta8" />
<PackageReference Include="Microsoft.Azure.WebJobs.ServiceBus" Version="3.0.0-beta8" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Scripting" Version="2.8.2" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="2.1.1" />
<PackageReference Include="Microsoft.OpenApi" Version="1.1.0-preview.3" />
Expand Down Expand Up @@ -130,8 +132,8 @@
<IntermediatePackDir>$(MSBuildProjectDirectory)/bin/$(Configuration)/publish/</IntermediatePackDir>
<PublishDir>$(IntermediatePackDir)$(TargetFramework)/</PublishDir>
<NuspecProperties>publishDir=$([MSBuild]::NormalizeDirectory($(IntermediatePackDir)))</NuspecProperties>
<AssemblyVersion>0.12.1.0</AssemblyVersion>
<FileVersion>0.12.1.0</FileVersion>
<AssemblyVersion>0.13.2.0</AssemblyVersion>
<FileVersion>0.13.2.0</FileVersion>
<PackageReleaseNotes></PackageReleaseNotes>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
<metadata>
<id>FunctionMonkey.Compiler</id>
<version>0.12.1-beta000</version>
<version>0.13.2-beta000</version>
<authors>James Randall</authors>
<description>Generates Azure Functions from command registrations</description>
<licenseUrl>https://raw.githubusercontent.com/JamesRandall/AzureFromTheTrenches.Commanding/master/LICENSE</licenseUrl>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ private static HashSet<string> BuildCandidateReferenceList(IReadOnlyCollection<A
typeof(IServiceProvider).GetTypeInfo().Assembly.Location,
typeof(IHeaderDictionary).GetTypeInfo().Assembly.Location,
typeof(StringValues).GetTypeInfo().Assembly.Location,
typeof(ExecutionContext).GetTypeInfo().Assembly.Location
};
foreach (Assembly externalAssembly in externalAssemblies)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System.Reflection;
using FunctionMonkey.Model;
using Microsoft.Azure.WebJobs;
using Microsoft.Azure.WebJobs.Extensions;

namespace FunctionMonkey.Compiler.Implementation
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ namespace {{Namespace}}
ILogger log,
ExecutionContext executionContext)
{
log.LogInformation("Service bus queue trigger function {{Name}} processed a request.");
log.LogInformation("Event hub trigger function {{Name}} processed a request.");

{{CommandTypeName}} command;
if (!System.String.IsNullOrWhiteSpace(eventHubMessage))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"generatedBy": "Microsoft.NET.Sdk.Functions-1.0.13",
"generatedBy": "Microsoft.NET.Sdk.Functions-1.0.19",
"configurationSource": "attributes",
"bindings": [
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"generatedBy": "Microsoft.NET.Sdk.Functions.Generator-1.0.13",
"generatedBy": "Microsoft.NET.Sdk.Functions.Generator-1.0.19",
"configurationSource": "attributes",
"bindings": [
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"generatedBy": "Microsoft.NET.Sdk.Functions-1.0.13",
"generatedBy": "Microsoft.NET.Sdk.Functions-1.0.19",
"configurationSource": "attributes",
"bindings": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ namespace {{Namespace}}
ILogger log,
ExecutionContext executionContext)
{
log.LogInformation("Service bus queue trigger function {{Name}} processed a request.");
log.LogInformation("Service bus subscription trigger function {{Name}} processed a request.");

{{CommandTypeName}} command;
if (!System.String.IsNullOrWhiteSpace(queueItem))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"generatedBy": "Microsoft.NET.Sdk.Functions-1.0.13",
"generatedBy": "Microsoft.NET.Sdk.Functions-1.0.19",
"configurationSource": "attributes",
"bindings": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ namespace {{Namespace}}
ILogger log,
ExecutionContext executionContext)
{
log.LogInformation("Service bus queue trigger function {{Name}} processed a request.");
log.LogInformation("Storage blob trigger function {{Name}} processed a request.");

string json;
using(StreamReader reader = new StreamReader(stream))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"generatedBy": "Microsoft.NET.Sdk.Functions-1.0.13",
"generatedBy": "Microsoft.NET.Sdk.Functions-1.0.19",
"configurationSource": "attributes",
"bindings": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ namespace {{Namespace}}
ILogger log,
ExecutionContext executionContext)
{
log.LogInformation("Blob stream function {{Name}} processed a request.");
log.LogInformation("Storage blob stream function {{Name}} processed a request.");

{{CommandTypeName}} command = new {{CommandTypeName}} {
Stream = stream,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"generatedBy": "Microsoft.NET.Sdk.Functions-1.0.13",
"generatedBy": "Microsoft.NET.Sdk.Functions-1.0.19",
"configurationSource": "attributes",
"bindings": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ namespace {{Namespace}}
ILogger log,
ExecutionContext executionContext)
{
log.LogInformation("Service bus queue trigger function {{Name}} processed a request.");
log.LogInformation("Storage queue trigger function {{Name}} processed a request.");

{{CommandTypeName}} command;
if (!System.String.IsNullOrWhiteSpace(queueItem))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"generatedBy": "Microsoft.NET.Sdk.Functions-1.0.13",
"generatedBy": "Microsoft.NET.Sdk.Functions-1.0.19",
"configurationSource": "attributes",
"bindings": [
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"generatedBy": "Microsoft.NET.Sdk.Functions.Generator-1.0.14",
"generatedBy": "Microsoft.NET.Sdk.Functions.Generator-1.0.19",
"configurationSource": "attributes",
"bindings": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace {{Namespace}}
ILogger log,
ExecutionContext executionContext)
{
log.LogInformation("Service bus queue trigger function {{Name}} processed a request.");
log.LogInformation("Timer trigger function {{Name}} processed a request.");

{{#if TimerCommandFactoryTypeName}}
var commandFactory = (FunctionMonkey.Abstractions.ITimerCommandFactory<{{CommandTypeName}}>)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"generatedBy": "Microsoft.NET.Sdk.Functions-1.0.14",
"generatedBy": "Microsoft.NET.Sdk.Functions-1.0.19",
"configurationSource": "attributes",
"bindings": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<Version>0.12.0-beta000</Version>
<Version>0.13.0-beta000</Version>
<Authors>James Randall</Authors>
<Company>James Randall</Company>
<PackageLicenseUrl>https://raw.githubusercontent.com/JamesRandall/AzureFromTheTrenches.Commanding/master/LICENSE</PackageLicenseUrl>
<PackageProjectUrl>https://commanding.azurefromthetrenches.com/</PackageProjectUrl>
<RepositoryUrl>https://github.com/JamesRandall/FunctionMonkey.git</RepositoryUrl>
<AssemblyVersion>0.12.0.0</AssemblyVersion>
<FileVersion>0.12.0.0</FileVersion>
<AssemblyVersion>0.13.0.0</AssemblyVersion>
<FileVersion>0.13.0.0</FileVersion>
</PropertyGroup>

<ItemGroup>
Expand Down
6 changes: 3 additions & 3 deletions Source/FunctionMonkey/FunctionMonkey.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<Version>0.12.1-beta000</Version>
<Version>0.13.0-beta000</Version>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
<Company />
<Authors>James Randall</Authors>
<PackageLicenseUrl>https://raw.githubusercontent.com/JamesRandall/AzureFromTheTrenches.Commanding/master/LICENSE</PackageLicenseUrl>
<PackageProjectUrl>https://commanding.azurefromthetrenches.com/</PackageProjectUrl>
<RepositoryUrl>https://github.com/JamesRandall/FunctionMonkey.git</RepositoryUrl>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<AssemblyVersion>0.12.1.0</AssemblyVersion>
<FileVersion>0.12.1.0</FileVersion>
<AssemblyVersion>0.13.0.0</AssemblyVersion>
<FileVersion>0.13.0.0</FileVersion>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<AzureFunctionsVersion>v2</AzureFunctionsVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="1.0.14" />
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="1.0.19" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Source\FunctionMonkey.Abstractions\FunctionMonkey.Abstractions.csproj" />
Expand Down
4 changes: 4 additions & 0 deletions docfx/guides/storage/blobs.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit df4d193

Please sign in to comment.