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

When to use IAutoConfigureStartup vs WorkerExtensionStartup? #2505

Closed
swettstein opened this issue Jun 3, 2024 · 2 comments
Closed

When to use IAutoConfigureStartup vs WorkerExtensionStartup? #2505

swettstein opened this issue Jun 3, 2024 · 2 comments
Labels
area: migration Items related to migration from the in-process model needs-discussion

Comments

@swettstein
Copy link

What version of .NET does your existing project use?

.NET 6

What version of .NET are you attempting to target?

.NET 6

Description

I am working on migrating an extension library from In-Process to Isolated that will automatically register services and middleware for my users. I started using WorkerExtensionStartup to replace IWebJobsStartup but then I discovered IAutoConfigureStartup. What is the difference between WorkerExtensionStartup and IAutoConfigureStartup and when should I use each of them?

Project configuration and dependencies

Microsoft.Azure.Functions.Worker 1.22.0
Microsoft.Azure.Functions.Worker.Sdk 1.17.2
Microsoft.Azure.Functions.Worker.Extensions.Timer 4.3.0
Microsoft.Azure.Functions.Worker.Extensions.Http.AspNetCore 1.3.1

Link to a repository that reproduces the issue

No response

@swettstein swettstein added the area: migration Items related to migration from the in-process model label Jun 3, 2024
@jviau
Copy link
Contributor

jviau commented Jun 4, 2024

IAutoConfigureStartup: For function app directly. Only the entry assembly is scanned for this, so it is for the function app directly and not extensions. Uses reflection.
WorkerExtensionStartup: For extensions. All loaded assemblies are scanned for this (at compile time via a source generator).

I'll bring this up for discussion with our team as this is confusing and we can revisit this design as part of a major version breaking change.

@swettstein
Copy link
Author

got it. that was my experience when playing around with them but was looking for clarification.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: migration Items related to migration from the in-process model needs-discussion
Projects
None yet
Development

No branches or pull requests

2 participants