Skip to content

Conversation

@jviau
Copy link
Contributor

@jviau jviau commented Jan 7, 2026

Issue describing the changes in this PR

resolves #3135

Pull request checklist

  • My changes do not require documentation changes
    • Otherwise: Documentation issue linked to PR
  • My changes should not be added to the release notes for the next release
    • Otherwise: I've added my notes to release_notes.md
  • My changes do not need to be backported to a previous version
    • Otherwise: Backport tracked by issue/PR #issue_or_pr
  • I have added all required tests (Unit tests, E2E tests)

Additional information

Generates extensions.json on build. This new SDK does not perform the same trimming of unused extensions that the current SDK does.

Copilot AI review requested due to automatic review settings January 7, 2026 17:01
@jviau jviau added the area: sdk label Jan 7, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR implements automatic generation of extensions.json during build as part of the MSBuild SDK. The new functionality scans extension assemblies for WebJobs startup attributes and generates the appropriate metadata file without trimming unused extensions (unlike the current SDK).

Key changes:

  • New WriteExtensionMetadata task that scans assemblies and generates extensions.json with incremental build support via hashing
  • New WebJobsReference class to represent extension references with assembly inspection logic
  • Integration of extension metadata generation into MSBuild targets to run during compilation

Reviewed changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
src/Azure.Functions.Sdk/Tasks/Extensions/WriteExtensionMetadata.cs New MSBuild task to generate extensions.json with hash-based incremental build support
src/Azure.Functions.Sdk/WebJobsReference.cs New class representing a WebJobs extension reference
src/Azure.Functions.Sdk/WebJobsReference.FromModule.cs Logic to extract WebJobs references from assemblies using Mono.Cecil
src/Azure.Functions.Sdk/FunctionsAssemblyScanner.cs Enhanced scanner with methods to extract WebJobs references from assemblies
src/Azure.Functions.Sdk/FunctionsAssemblyResolver.cs New custom assembly resolver that skips trusted platform assemblies
src/Azure.Functions.Sdk/MonoExtensions.cs New extension methods for Mono.Cecil type inheritance checking
src/Azure.Functions.Sdk/TaskItemExtensions.cs Added NuGetPackageVersion property and accessor method
src/Azure.Functions.Sdk/Tasks/GenerateWorkerConfig.cs Renamed JSON serialization context class from JsonContext to WorkerConfigContext
src/Azure.Functions.Sdk/Targets/Extensions/Azure.Functions.Sdk.Extensions.targets Added targets for generating and copying extensions.json, removed unused cache property
src/Azure.Functions.Sdk/Targets/Extensions/Azure.Functions.Sdk.Extensions.props Added property definition for extensions.json filename
src/Azure.Functions.Sdk/Strings.resx Added resource strings for extension metadata logging
test/Azure.Functions.Sdk.Tests/Tasks/Extensions/WriteExtensionMetadataTests.cs New unit tests for WriteExtensionMetadata task
test/Azure.Functions.Sdk.Tests/NugetPackage.cs Refactored to introduce WebJobsPackage record with ExtensionName property
test/Azure.Functions.Sdk.Tests/ExpectedFilesHelper.cs Renamed from WorkerConfigHelper and added GetExtensionsJson method
test/Azure.Functions.Sdk.Tests/Integration/SdkEndToEndTests.Build.cs Added validation for extensions.json in build tests including incremental build scenarios
test/Azure.Functions.Sdk.Tests/Tasks/GenerateWorkerConfigTests.cs Updated to use renamed ExpectedFilesHelper
test/Azure.Functions.Sdk.Tests/Integration/SdkEndToEndTests.Targets.WorkerConfig.cs Updated to use renamed ExpectedFilesHelper
Comments suppressed due to low confidence (1)

src/Azure.Functions.Sdk/Targets/Extensions/Azure.Functions.Sdk.Extensions.targets:34

  • The PublishFunctionsExtensionPayload target only depends on GetFunctionsExtensionFiles, but it should also depend on GenerateExtensionMetadata and AssignFunctionsTargetPaths to ensure extensions.json is included in publish output. Without this dependency, the extensions.json file may not be published correctly.
  <Target Name="PublishFunctionsExtensionPayload" Condition="'$(DesignTimeBuild)' != 'true'"
    DependsOnTargets="GetFunctionsExtensionFiles"
    BeforeTargets="GetCopyToPublishDirectoryItems" />

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@jviau jviau force-pushed the jviau/msbuild-sdk/extension-json branch from 9c9fcef to 8e27cdd Compare January 7, 2026 18:22
@jviau jviau force-pushed the jviau/msbuild-sdk/extension-json branch from 8e27cdd to 7cd8600 Compare January 7, 2026 18:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants