Skip to content
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

Add support for externally supplied worker extensions project #2763

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

jviau
Copy link
Contributor

@jviau jviau commented Oct 9, 2024

Issue describing the changes in this PR

resolves #2601
resolves #1252
resolves #1888
resolves #2125

Pull request checklist

  • My changes do not require documentation changes
    • Otherwise: Documentation issue linked to PR -- TODO
  • My changes should not be added to the release notes for the next release
    • Otherwise: I've added my notes to release_notes.md -- TODO
  • 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 refactors the SDK to address multiple issues while introducing the ability to have the worker extension project externally supplied.

  1. SDK targets now calculate the output path of the inner build by using msbuild target outputs.
  2. Externally supplying the extension project is now supported. This will address no-network builds and authenticated feed issues. To supply an external extension project follow these steps:
    1. Add the properties <FunctionsGenerateExtensionProject>false</FunctionsGenerateExtensionProject> and <ExtensionsCsProj>{{PATH OF EXTERNAL PROJECT}}</ExtensionsCsProj>
    2. Run dotnet build -t:GenerateExtensionProject on the function project. This will one-time generate the extension project to the ExtensionsCsProj path. It is then assumed that the generated project is checked into source control and included in solution files / build projects as necessary.
    3. Whenever making a change to the function apps reference closure, it is recommended to run dotnet build -t:GenerateExtensionProject again.
    4. IMPORTANT when providing an external extension project, this project is no longer kept up to date automatically. It is up to the user to re-run the GenerateExtensionProject target as necessary or to manually update webjobs extensions.

@pregress
Copy link

Can this be reviewed/merged ? Blocks .net 9 upgrades

@jviau
Copy link
Contributor Author

jviau commented Nov 19, 2024

@pregress how does this block .net9 upgrades for you?

@pregress
Copy link

pregress commented Nov 20, 2024

@pregress how does this block .net9 upgrades for you?

#2601 (comment)

Can't upgrade what doesn't compile.

If you use the 1.17.2 version, which doesn't have the problem with dotnet 9 you get the following error:

.nuget/packages/microsoft.azure.functions.worker.sdk/1.17.2/build/Microsoft.Azure.Functions.Worker.Sdk.targets(64,9): error : Invalid combination of TargetFramework and AzureFunctionsVersion is set.

When you use version 1.17.3 or greater with dotnet 8 or 2.0.0 with dotnet 9 you get the following error:

Could not copy the file "/redacted/obj/Release/net9.0/linux-x64/extensions.json" because it was not found.

@jviau jviau requested a review from fabiocav December 5, 2024 18:24
@pregress
Copy link

@fabiocav & @jviau could you provide an update on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants