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

What is the correct way to install a local WebJobs extensions library? #2903

Open
Y-Sindo opened this issue Dec 17, 2024 · 7 comments
Open
Labels
bug Something isn't working Needs: Triage (Functions)

Comments

@Y-Sindo
Copy link
Member

Y-Sindo commented Dec 17, 2024

Description

I need to test my local WebJobs extensions library in dotnet worker.
The previously working way now is not working. I've got extensions not registered error like this:

[2024-12-17T08:34:01.467Z] The 'Broadcast' function is in error: The binding type(s) 'signalRTrigger, signalR' are not registered. Please ensure the type is correct and the binding extension is installed.
[2024-12-17T08:34:01.469Z] The 'JoinGroup' function is in error: The binding type(s) 'signalRTrigger, signalR' are not registered. Please ensure the type is correct and the binding extension is installed.

In Azure JS Functions project, it's easy to install a local WebJobs extensions. We just add an extensions.csproj file to the project like:

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFramework>net8.0</TargetFramework>
    <DefaultItemExcludes>**</DefaultItemExcludes>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator" Version="4.0.1" />
    <ProjectReference Include="C:\Source\azure-sdk-for-net\sdk\signalr\Microsoft.Azure.WebJobs.Extensions.SignalRService\src\Microsoft.Azure.WebJobs.Extensions.SignalRService.csproj" />
  </ItemGroup>
</Project>

What is the correct way to test a local WebJobs extensions library now? @jviau , @fabiocav

@Y-Sindo Y-Sindo added the bug Something isn't working label Dec 17, 2024
@jviau
Copy link
Contributor

jviau commented Dec 17, 2024

@Y-Sindo this is a challenging area today. The idea is that #2763 will enable this scenario as you can then maintain a custom WorkerExtensions.csproj which uses a ProjectReference to your WebJobs csproj.

@manvkaur
Copy link

manvkaur commented Dec 17, 2024

@jviau , @Y-Sindo - does this issue correspond only to dotnet-isolated worker or we can test apps using in-process worker?
I have been testing another preview extension easily in my local using in-process worker.

@jviau
Copy link
Contributor

jviau commented Dec 17, 2024

@manvkaur in-process worker shouldn't need anything special: from your function app have a project reference to your WebJobs extension

@manvkaur
Copy link

manvkaur commented Dec 17, 2024

@Y-Sindo - Would you be able to test your function app using in-process application to unblock yourself?

@Y-Sindo
Copy link
Member Author

Y-Sindo commented Dec 18, 2024

@manvkaur The code paths for in-process and isolated-process application are different. I can test the isolated-process code path in JS function app, but I'm not sure whether there is anything different between JS and dotnet isolated worker model. And there is scenario that I need to the test unique functionality in the dotnet isolated process.

@jviau
Copy link
Contributor

jviau commented Dec 20, 2024

@Y-Sindo I should clarify my comment is more for automating of testing. If you just need to manually test, you have a few options:

  1. Use a local nuget feed on disk and publish your WebJobs package there, then reference it from the worker extension
  2. OR for one off tests, you can build your function app and webjobs package separately, then go to the .azurefunctions folder of your built function app and overwrite the WebJobs .dll with your newly built one.

@Y-Sindo
Copy link
Member Author

Y-Sindo commented Dec 23, 2024

Hello @jviau , I have tried the option 1 but failed with the message "Please ensure the type is correct and the binding extension is installed". Is there any method to troubleshoot the issue?

I have transitive dependency updated in webjobs package, so it's not easy to make sure they are all manually corrected replaced in the .azurefunctions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Needs: Triage (Functions)
Projects
None yet
Development

No branches or pull requests

3 participants