Giter VIP home page Giter VIP logo

azure-functions-dotnet-worker's Issues

Fail build when source generation fails

It seems that any error today with source generation still makes the build be successful and leaves a small info message saying that source wasn't generated. We should force the build to fail in such cases with some helpful message.

We can catch all exceptions and use SourceGeneratorContext.ReportDiagnostic to create a diagnostic with a severity of error.

None is not supported yet

When any binding is unavailable such that the datatype that is received is null, we get a NotSupportedException. We need to also handle the case for TypedData.DataOneofCase.None.

We probably need to handle a bunch of other types as well in future. But None, I think, is more crucial than others.

Improve function metadata generation

Today we use Source Generators... but this won't work for non-C# or if the assembly has been AOT compiled. Need to come up with alternative or fallback...

.NET worker detectors

Issue to track the following:

  • Review existing detectors to identify whether any of them would need to be updated
  • Identify new detectors needed

Fix Functions Host's "/function" APIs and "sync triggers"

All ARM calls related to "/function(s)" API are missing binding information for .NET 5 worker. These API uses the payload created by the Functions Host during a sync triggers call.

When a sync triggers call is made, Functions Host somewhat relies on the physical function.json files to create the config portion of the request. This causes binding information to be missing in Functions that come outside of function.json. Here's the code that relies on function.json.

We need to decouple the call from the physical file and use the FunctionMetadata. All this work needs to happen in the Functions Host, but tracking here because they are crucial for .NET 5 support.

Http[Request/Response]Data contract classes design discussion

Preface: As the title notes, this is probably more of a discussion than an issue, but it doesn't look like discussions are enabled on this repo yet... which is understandable since it's only just recently (i.e. 3 days ago) gone into public beta. 😊

In looking at the samples and what immediately jumped out at me as someone who utilizes HTTP triggered functions the majority of the time is the introduction of two new data contract classes to represent the request and response: HttpRequestData and HttpResponseData.

First, I would like to ask that we could have some kind of short explanation of why these classes were introduced. I believe it's because the SDK does not want to pin itself to a specific version of System.Net.Http, is that correct? If so, would you care to expand on why you think it's a bad idea to tie a specific extension to another dependency? Frankly, I think it would be a big mistake to force new types on .NET developers in the context of an Azure Function when in so many other contexts System.Net.Http is what we all use and which itself has an extension ecosystem built around it.

Second, if it comes down to decoupling, well then I have concerns about the design of these contracts. For example, the Body being a string: this is dangerous for performance on multiple levels. First and most basic, even if I actually do want to return a string... I shouldn't have to build a whole contiguous string like that. Second, if I don't want to return a string and want to return binary data... what option do I have now? I would have to return base-64 encoded bodies and that's just, well, not a good idea from an HTTP perspective and could completely box out some standard HTTP scenarios like file downloads or serving images. I would also suggest that the Headers property being defined as the concrete type Dictionary<string, string> and always allocated even if not used is a terrible idea from a performance perspective. Anyway, we can split off and go into deeper on into this in separate issues once we have the core discussion established, but the point is that so much of this is already well thought out, designed and implemented into the existing System.Net.Http type system and I think it's a mistake to eschew that for an extension where I'm very much opting in to using HTTP in the first place.

Build out mechanism for system logs

In the functions host, everything uses ILogger, which makes it hard to differentiate between System and User logs. We should take a different approach in the worker and make it explicit that logs written by system components do not use the "vanilla" ILogger, but maybe some internal wrapper class that allows us to differentiate.

Add SourceGenerator that generates an implementation of IFunctionProvider

We're going to try to skip over the need for function.json files in dotnet worker projects. In order to do that, we are hoping that we can auto-generate a class that implements IFunctionProvider, which will provide the host with all the function metadata it needs without having an actual json file artifact as part of the deployment.

ACTION REQUIRED: Microsoft needs this private repository to complete compliance info

There are open compliance tasks that need to be reviewed for your azure-functions-dotnet-worker repo.

Action required: 4 compliance tasks

To bring this repository to the standard required for 2021, we require administrators of this and all Microsoft GitHub repositories to complete a small set of tasks within the next 60 days. This is critical work to ensure the compliance and security of your Azure GitHub organization.

Please take a few minutes to complete the tasks at: https://repos.opensource.microsoft.com/orgs/Azure/repos/azure-functions-dotnet-worker/compliance

  • The GitHub AE (GitHub inside Microsoft) migration survey has not been completed for this private repository
  • No Service Tree mapping has been set for this repo. If this team does not use Service Tree, they can also opt-out of providing Service Tree data in the Compliance tab.
  • No repository maintainers are set. The Open Source Maintainers are the decision-makers and actionable owners of the repository, irrespective of administrator permission grants on GitHub.
  • Classification of the repository as production/non-production is missing in the Compliance tab.

You can close this work item once you have completed the compliance tasks, or it will automatically close within a day of taking action.

If you no longer need this repository, it might be quickest to delete the repo, too.

GitHub inside Microsoft program information

More information about GitHub inside Microsoft and the new GitHub AE product can be found at https://aka.ms/gim or by contacting [email protected]

FYI: current admins at Microsoft include @jeffhollan, @pragnagopa, @mhoeger, @fabiocav, @shimedh, @ahmelsayed, @mathewc, @cgillum, @brettsam, @anirudhgarg, @paulbatum, @davidmrdavid, @ehamai

Support for .NET Core 3.1

Currently the preview of Microsoft.Azure.Functions.Worker only targets net5.0.
Is there a plan to support netcoreapp3.1 or netstandard2.0/2.1?

We'd like to be able to update our functions to this new out-of-process mode, but we won't be able to use .NET 5 as it is not an LTS version (EOL is too soon). It would be great if we wouldn't have to wait until .NET 6 is released.

Update to drive Portal UX

  • Plan update to stacks that allows us to specify the language, version, and "mode" (embedded or isolated) for .NET
  • Talk with Elliot/Allison about whether we can update the UX to look more like Web Apps:

Functions:
image

Web Apps:
image

  • This would remove the need for a third dropdown in the Function create flow and move everything to one selection. For example, we'd have ".NET Core 3.1 embedded", ".NET Core 3.1 isolated", and ".NET 5 isolated"

Throw error when using Extension Bundles

If host.json has extension bundle configured, everything works fine except no functions show up. It's really hard to tell the root cause. And this can happen if your app is missing host.json as even the default one has extension bundles.

We likely need to fix this in Host, but tracking here for .NET worker work.

Allow simpler testing with ConfigureFunctionsWorker

Currently, Functions worker is configured with UseFunctionExecutionMiddleware() to provide the necessary infrastructure for triggers and output bindings. I'd like to be able to test my functions w/o running the full middleware when using the container DI based Functions. This will allow simpler testing scenarios that do not require Functions runtime to be installed and bootstrapped.

Handle async Functions

Today we're just assuming that functions are synchronous and we're not awaiting the call.

Review entire public surface

Minimize surface area for v1. Make sure that anything referencing GRPC or that couples us to System.Text.Json isn't exposed. Things like Converters can be all internal and exposed later to give us more time for API design.

FunctionName with hyphen (-) breaks build

FunctionName with hyphen (-) breaks build

To repro, take a working example and just change the function name to something like this:

[FunctionName("CosmosData-Get")]

This is the results that show up in the failed build:

11>C:\Dev\ServiceExtensions\src\Example.Function.Net5\Microsoft.Azure.Functions.Worker.Sdk\SourceGenerator.FunctionProvider\_GeneratedFunctionProvider.cs(42,59,42,60): error CS1002: ; expected
11>C:\Dev\ServiceExtensions\src\Example.Function.Net5\Microsoft.Azure.Functions.Worker.Sdk\SourceGenerator.FunctionProvider\_GeneratedFunctionProvider.cs(42,49,42,59): error CS0818: Implicitly-typed variables must be initialized
11>C:\Dev\ServiceExtensions\src\Example.Function.Net5\Microsoft.Azure.Functions.Worker.Sdk\SourceGenerator.FunctionProvider\_GeneratedFunctionProvider.cs(42,60,42,63): error CS0103: The name 'Get' does not exist in the current context
11>C:\Dev\ServiceExtensions\src\Example.Function.Net5\Microsoft.Azure.Functions.Worker.Sdk\SourceGenerator.FunctionProvider\_GeneratedFunctionProvider.cs(49,12,49,15): error CS0103: The name 'Get' does not exist in the current context
11>C:\Dev\ServiceExtensions\src\Example.Function.Net5\Microsoft.Azure.Functions.Worker.Sdk\SourceGenerator.FunctionProvider\_GeneratedFunctionProvider.cs(56,66,56,69): error CS0103: The name 'Get' does not exist in the current context
11>C:\Dev\ServiceExtensions\src\Example.Function.Net5\Microsoft.Azure.Functions.Worker.Sdk\SourceGenerator.FunctionProvider\_GeneratedFunctionProvider.cs(56,55,56,111): error CS0201: Only assignment, call, increment, decrement, await, and new object expressions can be used as a statement
11>C:\Dev\ServiceExtensions\src\Example.Function.Net5\Microsoft.Azure.Functions.Worker.Sdk\SourceGenerator.FunctionProvider\_GeneratedFunctionProvider.cs(59,57,59,60): error CS0103: The name 'Get' does not exist in the current context
11>C:\Dev\ServiceExtensions\src\Example.Function.Net5\Microsoft.Azure.Functions.Worker.Sdk\SourceGenerator.FunctionProvider\_GeneratedFunctionProvider.cs(59,46,59,102): error CS0201: Only assignment, call, increment, decrement, await, and new object expressions can be used as a statement
11>C:\Dev\ServiceExtensions\src\Example.Function.Net5\Microsoft.Azure.Functions.Worker.Sdk\SourceGenerator.FunctionProvider\_GeneratedFunctionProvider.cs(60,29,60,32): error CS0103: The name 'Get' does not exist in the current context
11>Done building project "Example.Function.Net5.csproj" -- FAILED.

Simply removing the hyphen in the name will allow this to build properly

Wire up function ILogger to logging system

Today we explicitly pass an ILogger to the ExecutionContext.

  • We need to wire this up as an ILoggerProvider, which allows ILoggers used in customer DI services to log back to the host.
  • Investigate how we handle categories, etc, from these loggers as they pass back through the host. For example, does the host respect the category on the RpcLog type and use it for its own logs?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.