-
Notifications
You must be signed in to change notification settings - Fork 357
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
Complete Invocation Filters Feature #1284
Comments
We should split "Finalize design for FunctionResultException" into a separate work item. |
@MikeStall - Moved the Result work out into its own issue here: #1314 |
Has there been any progress on this? I noticed FunctionInvocationFilterAttribute is still marked Obsolete ("..in preview..."). Any idea when it will be finished up? |
Yeah! Very strange that it is taking this long. Is it because of the latest changes on DI forAzure functions? |
Yes, we want to finish the feature up properly, integrating it with the new DI work naturally. The feature was marked Obsolete because we anticipated there might be some breaking changes as we finished it up. I'd like to complete this in the next major release. @fabiocav |
Any update on this? When is the next Major release? |
Will it be implemented in 3.0 version? |
Any update on this feature? Will this be part of V3? |
Any updates on this feature? |
This feature has not been prioritized as part of the 3.0 work. This is not currently part of the immediate roadmap, so we don't have an ETA we can share. |
Thanks for the update @fabiocav. |
That's too bad because this is something useful that I would like to see in the platform. |
any update on this? |
Seems like the lack of update indicates that this feature is dead. |
Filters are not constructed using DI. I.e., you must use service location to "inject" dependencies into them. |
@davidpeden3 , thank you. I'll note here a few observations about global filters for others who are interested.
In
|
Following this. |
Why this is not based on attribute? |
@MrMaheshwari, I haven't tried it myself, but I believe you can implement invocation filters as attributes. See the example here: |
Thanks for sharing such a nice article |
Any ETA to release this feature? |
@NSouth Here is a limitation, we can not return back the HttpResponseMessage object |
Microsoft Azure dev team: issues "preview" of highly-requested feature Have you guys, you know, considered hiring more devs so work actually gets done in a reasonable timeframe? It's not as if you work for a small mom-and-pop shop... |
I can see some interest in this and so going to give the answer that may help folks plan the best, but things can always change. We don't have any plans to bring functions filters as currently implemented as this preview feature forward. That said, the scenario that many people are interested in using function filters for, namely to add some logic and middleware before an execution triggers, is something we do want to solve for. We have recently prototyped some features as part of the upcoming out of process .NET work that allows users to add some middleware to execute before a function triggers for something like token validation or whatnot. If you were to ask me today that's what I would say is the future of this scenario, and not function filters as implemented. I'm happy to keep this issue open to continue discussion around it, but don't want folks to hold out thinking we are holding out and waiting to move this from preview to GA. There were always some tradeoffs with the approach we took with filters and we feel we may be able to provide the benefits in a more flexible way with something like middleware. // @anthonychu as FYI who is helping PM these features. |
Honestly, that's exactly how I'd want it to work. Not to be a downer or fail to give credit where it's due to you guys for your efforts, but for better or worse the ASP.NET Core "way" of doing dependency injection, middleware, etc. is effectively the standard in the .NET world, and Azure Functions' differences (seemingly at times just for the sake of being different) and limitations compared to ASP.NET Core have always frustrated me. Converging Azure Functions towards the way that ASP.NET Core works is probably the best decision that could be made in terms of helping adoption and maintainability. In an ideal world, I'd love to be able to write an ASP.NET Core web API application - then simply add an Azure Functions NuGet package(s), annotate the endpoints with attributes from that package, and when I press F5 in Visual Studio, |
Yes. Yes. A million times Yes. At its core, Azure Functions should just be an ASP.NET Core app with an extra service (plus configuration), i.e.: services.AddAzureFunctions(options => { ... }); |
@jeffhollan @anthonychu is there somewhere where work on middleware is being planned or tracked? |
@jeffhollan where is our middleware? |
It might be worth noticing that Azure Function in .NET 5 will have support for middleware directly. My guess would be that supporting both approaches might not be in the pipeline for the future, though I don't know of course |
@MartinWickman Middlewares definitely help out with cross-cutting concerns, although they currently lack any real substance right now to make them useful. E.g., no access to the request/response and no ability to terminate the pipeline. Also, they don't really make sense as a replacement for filters that are intended to be applied to a specific function (e.g., an authorization-type filter). |
We have HTTP endpoints in Azure Functions that use Durable Functions. What is the path forward for middleware or something to check a JWT bearer token when the HTTP endpoint is called? |
This feels like a desperately needed feature. It's now 2022 and this is still unresolved since 2017. I have a function app with 3 HTTP functions and more on the way soon. I'm using model binding rather than the clunky and unnecessary
This works, but the downside is that if the incoming request is in an invalid format (i.e. bad JSON), the function returns server 500 and nothing else. I'm trying to catch JSON serialisation errors so that I can return a 400 Bad Request and helpful message (i.e. what part/path of the JSON request is invalid). To do this with a |
Is there any update on this? |
not sure why @mathewc hasn't officially updated this thread but it appears that this feature is doa: |
Sounds good, thanks for the prompt response. -Ben |
Thanks. Yes the issue referenced above states our position on this feature. |
For WebJobs v2, bulk of the work for Invocation Filters was checked in via #980. However, there are some remaining work items we're tracking before the feature can be considered complete:
In v3 the Filters feature is currently marked Obsolete due to the above issues: #1912. The feature is not going away - we applied Obsolete because we had to GA v3 before the feature was complete, so we wanted to convey that there may be breaking changes in this area as we complete the work above.
The text was updated successfully, but these errors were encountered: