Skip to content

feat(sdk): emit AZFW0110 warning when FunctionsEnableWorkerIndexing is set#3449

Open
jviau wants to merge 2 commits into
mainfrom
u/jviau/sdk-warn-functionsenableworkerindexing-d
Open

feat(sdk): emit AZFW0110 warning when FunctionsEnableWorkerIndexing is set#3449
jviau wants to merge 2 commits into
mainfrom
u/jviau/sdk-warn-functionsenableworkerindexing-d

Conversation

@jviau

@jviau jviau commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Summary

Closes #3395.

Adds a new AZFW0110 SDK warning that is emitted when the FunctionsEnableWorkerIndexing property is set in a project using the new Azure.Functions.Sdk. Worker indexing is always enabled with this SDK, so the property no longer has any effect — the warning announces its deprecation and tells the user to remove it.

Changes

Warning implementation (follows the existing AZFW01xx diagnostic pattern):

  • Strings.resx — added the AZFW0110_Warning_FunctionsEnableWorkerIndexingDeprecated message.
  • LogMessage.cs — added the Warning_FunctionsEnableWorkerIndexingDeprecated field and wired it into FromId.
  • Targets/Azure.Functions.Sdk.targets — emit the warning via FuncSdkLog in _ValidateFunctionsVersion when '$(FunctionsEnableWorkerIndexing)' != ''. The SDK never sets this property itself, so a non-empty value means the user set it.

Docs:

  • docs/sdk-rules/AZFW0110.md — new rule page (cause, description, how-to-fix, suppression guidance).
  • docs/sdk-rules/index.md — added the AZFW0110 row.
  • src/Azure.Functions.Sdk/README.md — migration note that the property is deprecated.
  • release_notes.md — feat entry.

Test:

  • SdkEndToEndTests.Build.csBuild_FunctionsEnableWorkerIndexing_Deprecated_Warning, following the existing Build_NoRestoreHook_Warning pattern.

Testing

  • SDK builds clean (0 warnings/errors), confirming the generated Strings.AZFW0110_... resource resolves.
  • LogMessageTests62/62 pass. These reflection-driven tests automatically assert the new resource string and LogMessage field are correctly wired.

Note: The integration test suite could not be executed locally because the long worktree directory name pushes the SDK resolver's generated paths past Windows' 260-char MAX_PATH limit during restore. This was confirmed to be environmental — the pre-existing Build_Success test fails identically. The added test follows the established, passing pattern and should run in CI.

…s set

The FunctionsEnableWorkerIndexing property is deprecated with Azure.Functions.Sdk. Worker indexing is always enabled, so setting the property has no effect. Emit a new AZFW0110 warning when it is set and document the rule.
Copilot AI review requested due to automatic review settings July 2, 2026 21:04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 adds a new SDK diagnostic (AZFW0110) to warn users that FunctionsEnableWorkerIndexing is deprecated and has no effect when using Azure.Functions.Sdk, and updates documentation and integration tests accordingly.

Changes:

  • Introduces AZFW0110 warning text + LogMessage wiring for the new diagnostic.
  • Emits the warning from MSBuild targets when FunctionsEnableWorkerIndexing is set.
  • Adds rule documentation and an end-to-end integration test validating the warning behavior.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
test/Azure.Functions.Sdk.Tests/Integration/SdkEndToEndTests.Build.cs Adds an integration test asserting AZFW0110 is emitted when the deprecated property is set.
src/Azure.Functions.Sdk/Targets/Azure.Functions.Sdk.targets Emits AZFW0110 via FuncSdkLog during validation when FunctionsEnableWorkerIndexing is non-empty.
src/Azure.Functions.Sdk/Strings.resx Adds the AZFW0110 warning message resource string.
src/Azure.Functions.Sdk/release_notes.md Notes the new AZFW0110 warning in release notes.
src/Azure.Functions.Sdk/README.md Adds a migration note pointing users to AZFW0110 and advising removal of the property.
src/Azure.Functions.Sdk/LogMessage.cs Adds Warning_FunctionsEnableWorkerIndexingDeprecated and maps it in FromId.
docs/sdk-rules/index.md Adds AZFW0110 to the SDK rules index table.
docs/sdk-rules/AZFW0110.md Adds a new rule documentation page describing cause, impact, and fix.

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

Comment thread src/Azure.Functions.Sdk/Targets/Azure.Functions.Sdk.targets
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[SDK] Emit SDK warning whenFunctionsEnableWorkerIndexing is used, announcing it is deprecated.

3 participants