Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix SDK bug that causes bad extensions.json
Browse files Browse the repository at this point in the history
This bug prevented proper functions parsing by Azure (everything worked
locally). This has something to do with the target framework. See

Azure/azure-functions-host#3386
nikolamilekic committed Dec 15, 2018
1 parent 3bc926e commit 05854a1
Showing 4 changed files with 20 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build.fsx
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@ open FSharp.Data

let productName = "N26DirectImport"
let solution = productName + ".sln"
let binPath = "src/N26DirectImport/bin/Release/netstandard2.0"
let binPath = "src/N26DirectImport/bin/Release/netcoreapp2.1"
let publishPath = binPath </> "publish"
let zipFileName = "publish.zip"
let buildNumber = Environment.environVarOrNone "APPVEYOR_BUILD_NUMBER"
9 changes: 9 additions & 0 deletions src/N26DirectImport/Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<Project>
<Target Name="CopyExtensionsJson" AfterTargets="_GenerateFunctionsAndCopyContentFiles">
<Message Importance="High" Text="Overwritting extensions.json file with one from build." />

<Copy SourceFiles="$(PublishDir)extensions.json"
DestinationFiles="$(PublishDir)bin\extensions.json"
OverwriteReadOnlyFiles="true" />
</Target>
</Project>
5 changes: 4 additions & 1 deletion src/N26DirectImport/N26DirectImport.fsproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFramework>netcoreapp2.1</TargetFramework>
<AzureFunctionsVersion>v2</AzureFunctionsVersion>
<UseNETCoreGenerator>true</UseNETCoreGenerator>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
@@ -18,6 +18,9 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<CopyToPublishDirectory>Never</CopyToPublishDirectory>
</None>
<None Include="extensions.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<Compile Include="AssemblyInfo.fs" />
<Compile Include="Helpers.fs" />
<Compile Include="Constants.fs" />
6 changes: 6 additions & 0 deletions src/N26DirectImport/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extensions":[
{ "name": "AzureStorage", "typeName":"Microsoft.Azure.WebJobs.Extensions.Storage.AzureStorageWebJobsStartup, Microsoft.Azure.WebJobs.Extensions.Storage, Version=3.0.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"},
{ "name": "Startup", "typeName":"N26DirectImport.Functions+Startup, N26DirectImport, Culture=neutral, PublicKeyToken=null"}
]
}

0 comments on commit 05854a1

Please sign in to comment.