Skip to content

[MSBUILD SDK] Add warning for building generated project in Azure.Functions.Sdk#3347

Merged
jviau merged 4 commits intofeature/msbuild-sdkfrom
jviau/msbuild-sdk/sdk-errors
Mar 17, 2026
Merged

[MSBUILD SDK] Add warning for building generated project in Azure.Functions.Sdk#3347
jviau merged 4 commits intofeature/msbuild-sdkfrom
jviau/msbuild-sdk/sdk-errors

Conversation

@jviau
Copy link
Contributor

@jviau jviau commented Mar 13, 2026

Issue describing the changes in this PR

resolves #issue_for_this_pr

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

  1. Makes building the inner project a no-op. Adds a warning in the project is ever built.
  2. Changes extension package validation from a warning to an error. This shouldn't ever happen in a normal flow, but this is a safeguard to make sure the package collection hasn't been improperly tampered with.

Copilot AI review requested due to automatic review settings March 13, 2026 15:54
@jviau jviau changed the title Add warning for building inner prject [MSBUILD SDK] Add warning for building generated project in Azure.Functions.Sdk Mar 13, 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 makes two changes to the Azure Functions SDK build tooling: (1) it adds a Build target override in the inner generated project (azure_functions.g.csproj) that emits a warning if the project is accidentally built directly, and (2) it promotes the extension package target framework validation from a warning to an error. New documentation for rules AZFW0109 and AZFW0110 is included, along with corresponding test updates.

Changes:

  • Override the Build target in the inner generated project to emit warning AZFW0110 instead of performing a real build.
  • Escalate the missing-target-framework validation (AZFW0109) from warning to error, returning false from the task.
  • Add documentation for AZFW0109 and AZFW0110, plus integration/unit test updates.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/Azure.Functions.Sdk/Targets/Inner/Azure.Functions.Sdk.Inner.targets Adds FuncSdkLog UsingTask and overrides Build target to emit a warning
src/Azure.Functions.Sdk/Tasks/Extensions/ValidateExtensionPackages.cs Changes TFM-missing log from warning to error and returns false
src/Azure.Functions.Sdk/LogMessage.cs Renames warning to error for AZFW0109, adds new AZFW0110 warning message
src/Azure.Functions.Sdk/Strings.resx Renames AZFW0109 resource, adds AZFW0110 resource string
docs/sdk-rules/AZFW0108.md Removes extra blank line
docs/sdk-rules/AZFW0109.md New documentation for AZFW0109 error rule
docs/sdk-rules/AZFW0110.md New documentation for AZFW0110 warning rule
test/.../ValidateExtensionPackagesTests.cs Updates test to expect error instead of warning
test/.../SdkEndToEndTests.Targets.InnerBuild.cs New integration test for inner build warning

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

@jviau jviau force-pushed the jviau/msbuild-sdk/sdk-errors branch from b77f3ca to 17afb92 Compare March 13, 2026 16:07
@jviau jviau merged commit 9dfa35d into feature/msbuild-sdk Mar 17, 2026
29 checks passed
@jviau jviau deleted the jviau/msbuild-sdk/sdk-errors branch March 17, 2026 21:32
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.

4 participants