1

I can successfully deploy a C# project to an Azure Function app via Continuous Delivery (via Github), and this is compiled automatically and deployed successfully. Here is the csproj:

<Project Sdk="Microsoft.NET.Sdk">
 <PropertyGroup>
  <TargetFramework>netstandard2.0</TargetFramework>
  <AzureFunctionsVersion>v2</AzureFunctionsVersion>
</PropertyGroup>
<ItemGroup>
 <PackageReference Include="Microsoft.NET.Sdk.Functions" 
     Version="1.0.6" />
</ItemGroup>
<ItemGroup>
 <None Update="host.json">
 <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="local.settings.json">
  <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
  <CopyToPublishDirectory>Never</CopyToPublishDirectory>
</None>
</ItemGroup>
</Project>

However, if I include an F# project in the solution, I get the following error messgage:

Project "D:\home\site\repository\MyFunc\MyFunc.fsproj" on node 1 (default targets). D:\Program Files (x86)\MSBuild-15.3.409.57025\MSBuild\Microsoft\VisualStudio\v15.0\FSharp\Microsoft.FSharp.NetSdk.props(3,3): error MSB4019: The imported project "D:\Program Files (x86)\Microsoft SDKs\F#\4.1\Framework\v4.0\Microsoft.FSharp.NetSdk.props" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk. [D:\home\site\repository\MyFunc\MyFunc.fsproj] Done Building Project "D:\home\site\repository\MyFunc\MyFunc.fsproj" (default targets) -- FAILED.

This is the fsproj:

<Project Sdk="Microsoft.NET.Sdk">
 <PropertyGroup>
  <TargetFramework>netstandard2.0</TargetFramework>
 </PropertyGroup>
 <ItemGroup>
  <Compile Include="File.fs" />
 </ItemGroup>
 <ItemGroup>
  <PackageReference Include="Newtonsoft.Json" Version="10.0.3" />
 </ItemGroup>
</Project>

Is there a way of getting Azure to compile the F# project?

Dan O'Leary
  • 2,660
  • 6
  • 24
  • 50
  • 1
    Have you refered to [Precompiled Azure Functions in F#](https://mikhail.io/2017/12/precompiled-azure-functions-in-fsharp/)? – Tom Sun - MSFT Jan 09 '18 at 01:34
  • Yeah I've tried that, but I'm getting the same error. It looks like the F# tools aren't installed wherever it is that the compilation happens. – Dan O'Leary Jan 09 '18 at 19:33

1 Answers1

0

As of now, unfortunately, you can't, since the required file Microsoft.FSharp.NetSdk.props is missing. Deployment script doesn't cut it either since the folder is not accessible. However, it's still possible to build your project on another environment and then deploy it.

You can find more details in this article.

kagetoki
  • 4,339
  • 3
  • 14
  • 17