Azure / Azure/azure-functions-dotnet-worker

FunctionMetadataProviderGenerator can't consider FunctionTriggers that are generated using source generators

Open
#3,023 1 comment 1 reaction 0 assignees View on GitHub
Needs: Triage (Functions)
Dominant language
C#
Stars
466
Forks
215
Avg merge
3d 10h
Merged PRs (30d)
7

Description

We played around with using roslyn source generators to generate Functions with ServiceBusTrigger.
We soon realized that the new wokers use this FunctionMetadataProviderGenerator to do its indexing.
As far as I understand it, roslyn source generators are by design independend from each other. So it should by design not be possible to have one generator create some function triggers, and another one generade the metadata based on the generated functions.

Am I the first one to trip over this?
Is there a way to get this done which I have overlooked in the documentation?

Workaround:
a)
I am aware, that I could just disable the new source generator indexing with.
```
false
false
false
```
But if this is the new way of indexing I would like to avoid having my project rely on the old (maybe soon obsolete) approach.

b)
Write some build tasks that will take the output of the function trigger generator and add it as source code to the project so that the metadata generator can read it. But this eigther means having the generated code permanetly in my version control. Or having to always run the build process twice for this whole chain to complete.
(already implemented it, it works. But the double build step is a pain i do not want to go forward with.)

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by tracing FunctionMetadataProviderGenerator and the Roslyn source-generator indexing path, then review how FunctionsEnableWorkerIndexing, FunctionsEnableMetadataSourceGen, and FunctionsEnableExecutorSourceGen affect the build. Done means establishing whether generated FunctionTriggers can be consumed without a second build, or documenting the supported limitation and workaround.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, csharp
Domain
cloud
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.