Skip to content

[MSBUILD SDK] Add support for multi-targeted function apps#3333

Merged
jviau merged 9 commits intofeature/msbuild-sdkfrom
jviau/msbuild-sdk/multi-target
Mar 12, 2026
Merged

[MSBUILD SDK] Add support for multi-targeted function apps#3333
jviau merged 9 commits intofeature/msbuild-sdkfrom
jviau/msbuild-sdk/multi-target

Conversation

@jviau
Copy link
Contributor

@jviau jviau commented Mar 4, 2026

Issue describing the changes in this PR

resolves #3331

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

This PR adds support for multi-targeted function apps. When a multi-targeted app is detected, an extension project will be generated and restored per TFM.

Important

Microsoft.NET.Sdk/10.0.200 includes NuGet 7.3, which introduces a new TFM alias concept. This concept may allow us to switch back to a single project, but multiple TFM aliases to create separate restore graphs. TFM Alias will not be fully supported until 10.0.300 though.

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

Adds MSBuild SDK support for multi-targeted Azure Functions apps by generating/restoring a Functions extensions project per TFM.

Changes:

  • Update extension generation pipeline to operate on per-TFM project items (projects + packages tagged with TFMs).
  • Extend validation/resolution tasks and targets to carry TFM metadata through restore/build.
  • Expand unit + integration tests to cover multi-target restore/build and incremental behavior.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
test/Azure.Functions.Sdk.Tests/Tasks/Extensions/WriteExtensionProjectTests.cs Updates tests for new per-TFM project/hash outputs and adds multi-target coverage.
test/Azure.Functions.Sdk.Tests/Tasks/Extensions/ValidateExtensionPackagesTests.cs Updates package creation to include TFMs; adds warnings/behavior tests for missing/different TFMs.
test/Azure.Functions.Sdk.Tests/Tasks/Extensions/ResolveExtensionPackagesTests.cs Ensures resolved extension packages carry TFM metadata; adds multi-target scan test.
test/Azure.Functions.Sdk.Tests/ProjectCreatorExtensions.cs Adds helper APIs for multi-target project creation and per-TFM extension project directory resolution.
test/Azure.Functions.Sdk.Tests/Integration/SdkEndToEndTests.Restore.cs Expands restore E2E tests across TFMs and multi-target scenarios; centralizes generated project path logic.
test/Azure.Functions.Sdk.Tests/Integration/SdkEndToEndTests.Build.cs Expands build E2E tests across TFMs and multi-target scenarios, including incremental checks.
src/Azure.Functions.Sdk/Tasks/Extensions/WriteExtensionProject.cs Refactors task to write one extension project per TFM and include TFM in hashing.
src/Azure.Functions.Sdk/Tasks/Extensions/ValidateExtensionPackages.cs Validates packages per TFM; warns and filters out packages missing TFM metadata.
src/Azure.Functions.Sdk/Tasks/Extensions/ResolveExtensionPackages.cs Tags resolved extension packages with TFM metadata.
src/Azure.Functions.Sdk/TaskItemExtensions.cs Adds strongly-typed accessor for TargetFramework item metadata.
src/Azure.Functions.Sdk/Targets/Extensions/Azure.Functions.Sdk.Extensions.targets Updates targets to generate/restore per-TFM extension projects and markers; backfills assets path for multi-target.
src/Azure.Functions.Sdk/Targets/Extensions/Azure.Functions.Sdk.Extensions.props Removes single-project path properties now replaced by per-TFM item metadata.
src/Azure.Functions.Sdk/Strings.resx Adds warning string for missing extension package TFM metadata.
src/Azure.Functions.Sdk/LogMessage.cs Registers new warning log message identifier.

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

# Conflicts:
#	src/Azure.Functions.Sdk/Targets/Extensions/Azure.Functions.Sdk.Extensions.targets
#	test/Azure.Functions.Sdk.Tests/Integration/SdkEndToEndTests.Build.cs
@jviau jviau merged commit 8511793 into feature/msbuild-sdk Mar 12, 2026
29 checks passed
@jviau jviau deleted the jviau/msbuild-sdk/multi-target branch March 12, 2026 22:00
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.

3 participants