Skip to content

Add support for authoring Azure Functions as .NET Core class library #805

Description

Add support to the "Azure Functions and Web Jobs Tools" extension within Visual Studio for authoring Azure Functions as a .NET Core class library. This issue is a spin off from a conversation started in #686 and is possibly, semi-related to #790.

When creating a new Azure Function app, you must select between the versions "v1 (.NET Framework)" or "v2 (.NET Standard)".

  1. If v1 is selected, you can target any version of the .NET Framework <= 4.6.1
  2. If v2 is selected, you can target any version of .NET Standard <= 2.0

Neither option allows the resulting Azure Function project to target .NET Core 2.x.

Scenario
Given the following VS solution/project architecture for Company Xyz:

  • Xyz.Common .NET Core 2.x shared library leveraging EF Core and various 3rd party packages
  • Xyz.Web ASP.NET Core Web Application leveraging AspNetCore.All, EF Core, Controllers, etc.
  • Xyz.Functions v2 Azure Functions project with HTTP, timer, and queue triggers

Problem
When a project reference is added from Xyz.Functions to Xyz.Common Visual Studio generates a "project not compatible" build error as these two projects reference different frameworks (i.e. .NET Standard != .NET Core).

Reasoning
In a "real word" enterprise-level application, it's a very realistic expectation for a developer to centralize the logic for a specific processing routine and want to leverage that code from an IActionResult in a MVC app and a [TestMethod] in a MSTest project. Continuing with that approach, AF should allow a developer to leverage their .NET Core code from a Trigger as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions