-
Notifications
You must be signed in to change notification settings - Fork 203
Add package README for Microsoft.Azure.Functions.Worker.Sdk #3357
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| # Microsoft.Azure.Functions.Worker.Sdk | ||
|
|
||
| This package provides development-time support for Azure Functions .NET isolated worker apps, including MSBuild build and publish targets, a Roslyn source generator for function metadata, and analyzers. | ||
|
|
||
| ## Getting Started | ||
|
|
||
| This package is typically added via the Azure Functions project template. To add it manually: | ||
|
|
||
| ```dotnet | ||
| dotnet add package Microsoft.Azure.Functions.Worker.Sdk | ||
| ``` | ||
|
|
||
| For more information, see the [Azure Functions .NET isolated worker guide](https://learn.microsoft.com/azure/azure-functions/dotnet-isolated-process-guide). | ||
|
|
||
| ## What's Included | ||
|
|
||
| ### Build & Publish Targets | ||
|
|
||
| The SDK adds MSBuild targets that run during build and publish: | ||
|
|
||
| - **Function indexing** — Analyzes your compiled assembly and generates function metadata (`functions.metadata`) so the Azure Functions host can discover your functions without runtime reflection. | ||
| - **Extension bundling** — Auto-generates a `WorkerExtensions` project that compiles all binding extension packages into a single assembly. | ||
| - **Publish support** — Configures output for deployment, including Docker base image assignment for container scenarios. | ||
|
|
||
| ### Source Generators | ||
|
|
||
| Three Roslyn source generators run at compile time: | ||
|
|
||
| - **FunctionMetadataProvider** — Generates a `IFunctionMetadataProvider` implementation that returns metadata for all `[Function]`-attributed methods. This enables build-time indexing for fast cold starts. | ||
| - **FunctionExecutor** — Generates strongly-typed wrapper methods for invoking user functions with correct parameter binding. | ||
| - **ExtensionStartupRunner** — Generates a startup orchestrator that calls `Configure()` on all extension startup types. | ||
|
|
||
| ### Analyzers | ||
|
|
||
| | Diagnostic | Severity | Description | | ||
| |------------|----------|-------------| | ||
| | AZFW0001 | Error | WebJobs binding attributes (in-process) used instead of isolated worker attributes | | ||
| | AZFW0002 | Error | Async function method returns `void` instead of `Task` | | ||
| | AZFW0009 | Error | `SupportsDeferredBinding` applied to an output binding | | ||
| | AZFW0010 | Warning | Parameter type not supported by the binding attribute | | ||
| | AZFW0011 | Error | Blob container path requires an iterable type or `BlobContainerClient` | | ||
|
|
||
| ## Configuration | ||
|
|
||
| The SDK exposes MSBuild properties you can set in your `.csproj` to control its behavior: | ||
|
|
||
| ```xml | ||
| <PropertyGroup> | ||
| <!-- Azure Functions runtime version (default: v4) --> | ||
| <AzureFunctionsVersion>v4</AzureFunctionsVersion> | ||
|
|
||
| <!-- Disable build-time function indexing (default: true) --> | ||
| <FunctionsEnableWorkerIndexing>true</FunctionsEnableWorkerIndexing> | ||
|
|
||
| <!-- Control metadata source generation independently (default: mirrors FunctionsEnableWorkerIndexing) --> | ||
| <FunctionsEnableMetadataSourceGen>true</FunctionsEnableMetadataSourceGen> | ||
|
|
||
| <!-- Control executor source generation independently (default: true) --> | ||
| <FunctionsEnableExecutorSourceGen>true</FunctionsEnableExecutorSourceGen> | ||
|
|
||
| <!-- Namespace for generated code (default: your project's RootNamespace) --> | ||
| <FunctionsGeneratedCodeNamespace>MyApp.Generated</FunctionsGeneratedCodeNamespace> | ||
| </PropertyGroup> | ||
| ``` | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't AZFW0017 #3359 also be documented? (even the same author)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh good catch I looked at both independently, I will create a follow up pr tomorrow to adjust this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is covered here #3370 thanks @Frulfump for noticing this!