-
Notifications
You must be signed in to change notification settings - Fork 6
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
F# dotnet 8 isolated not working with attributes #73
Comments
Pull request here: #74 |
I am having the same problem. It seems that FunctionsAuthorizationExtensionStartup is not configured on startup, when F# is used. Somehow the F# isolated worker model startup is not as automatic as with C#. I am currently trying to manually configure the mentioned extension, but it is a bit problematic due to classes/extensions being internal in DarkLoop. EDIT: The code is not pretty, as the FunctionsAuthorizationExtensionStartup is a public class, which needs to be initialized for nothing here. DarkLoop would need some extension method for F# configuration to make it prettier, but at least this seems like a workaround for the problem. |
I will update my Sample for F# code with this. Great find @miikka-valkonen ! Thanx! |
The sample is updated with working code as per now. Not sure if this issue is still valid, whether it as a F# problem or a Darkloop functions authorize problem so you may decide to close this issue @artmasa as it is working. Although the documentation should reflect this related to Azure Functions and F#. Added one line to the documentation for F#. |
@helgeu, this is awesome! I will merge soon. |
@helgeu and @miikka-valkonen, just curious, do other functions extensions require the same (manual registration)? I'm wondering if something is missing in this package for auto-discovery in F# |
I made this code work on @miikka-valkonen. @miikka-valkonen did find something around this related to other triggers in Azure functions. He may have some more background info and could possibly add to this issue with some links or otherwise? |
It seems this limitation is due to F# code not being compiled with roslyn, which detects all the startup attributes involved in solution at compile time and generates initialization code when compiling your project. I think this project will need to include extension method to handle this in a more elegant way. |
@artmasa @helgeu I don't think there is anything auto-discovery related missing from this package. Microsoft has stated the following: "If you're writing your application using F#, some trigger and binding extensions require extra configuration.". Statement is rather vague, but in general F# func apps are required to do some configurations manually, for example here is what MS says you must declare in startup for using Blob Storage binding w/ F#:
These additional F# configuration calls always reside in ConfigureFunctionsWorkerDefaults/ConfigureFunctionsWebApplication. I think that MS has added that ConfigureBlobStorageExtension in the example just for F# func apps. I don't think MS is going to provide the same auto-discovery support for F#, like it is in C#, as they are stating these things. You are instead supposed to add extension methods to perform the startup of extensions/bindings. .... and now I see what @artmasa just found out and commented, which is probably the answer as to why the situation is like I stated above. :) |
We are using f# and Darkloop extension and this works very nicely with Azure functions in process mode. We are now moving over to dotnet 8 and isolated but this seems to not work as expected.
I have created a PR with basic code for same F# code as in the C# samples. The expected is that this should give 401s but the attribute is not at all honored as with this code.
Thanks for your great work btw!
The text was updated successfully, but these errors were encountered: