Azure / Azure/azure-functions-dotnet-worker
AWARENESS: OneBranch Pipelines RoslynAnalyzer task is incompatible with dotnet isolated function apps
- Dominant language
- C#
- Stars
- 466
- Forks
- 215
- Avg merge
- 3d 10h
- Merged PRs (30d)
- 7
Description
### Description
Function app encounters runtime issues, particularly around unable to resolve services during dependency injection.
We are engaging with the OneBranch team to avoid this issue in the future. See mitigation below to address this issue now.
### Who is impacted?
**THIS IMPACTS INTERNAL MICROSOFT TEAMS ONLY**
You are using the OneBranch pipelines `RoslynAnalyzer` task to build your function app
### Root cause / Impact
Dotnet isolated function apps rely on source generators to emit startup hooks to configure extensions. Without these hooks extensions are in a partially configured state and will encounter runtime issues (depends on extension logic). Using OneBranch pipelines `RoslynAnalyzer` task to build will **not** run source generators, leading to these startup hooks never being ran.
When deployed you will see various DI exceptions. The exact exception you encounter depends on what extensions you see. See #2408 for an example exception.
### Mitigation
To mitigate, please replace `RoslynAnalyzer` build task with `DotNetCli` task. Roslyn analyzers are included in the SDK and the OB task is not necessary for static analysis. Please follow [this guide](https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/overview?tabs=net-8) for enabling analyzers.
Contributor guide
No contributing guide indexed for this repository
Research direction
Read the issue alongside #2408 and the linked .NET code-analysis guide, then verify how the OneBranch RoslynAnalyzer and DotNetCli tasks differ for isolated function apps. No repository file or test is named; done requires identifying the appropriate documentation location and recording the stated task replacement and its impact.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- build-system, ci-cd
- Issue type
- Documentation
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100