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

Azure Functions Documentation #10041

Closed
kerenkhatiwada opened this issue May 15, 2024 · 6 comments · Fixed by #10089
Closed

Azure Functions Documentation #10041

kerenkhatiwada opened this issue May 15, 2024 · 6 comments · Fixed by #10089
Assignees
Labels
Product Area: SDKs - Native Type: Content Issues about the contents of our docs

Comments

@kerenkhatiwada
Copy link
Member

Core or SDK?

Platform/SDK

Which part? Which one?

https://docs.sentry.io/platforms/dotnet/guides/azure-functions-worker/#configure

Description

Reproted by user:"Not really knowing what I'm doing I tried to add Sentry to my basic Azure Functions app. The documentation suggested I use ConfigureFunctionsWorkerDefaults but there was already a call on ConfigureFunctionsWebApplication so I added the recommended the ConfigureFunctionsWorkerDefaults call before it. This is a bad idea, it compiles and all the functions appear to be callable and return "OK" results but with no data! This is because they are not actually called! Once you figure it out the fix is easy, just use ConfigureFunctionsWebApplication INSTEAD of ConfigureFunctionsWorkerDefaults. So I don't have a problem, just wanted to let someone know."

Suggested Solution

Clarify in the documentation, that users can choose between ConfigureFunctionsWorkerDefaults and ConfigureFunctionsWebApplication, depending on their specific app configuration.

@kerenkhatiwada kerenkhatiwada added the Type: Content Issues about the contents of our docs label May 15, 2024
@getsantry
Copy link
Contributor

getsantry bot commented May 15, 2024

Assigning to @getsentry/support for routing ⏲️

@getsantry
Copy link
Contributor

getsantry bot commented May 15, 2024

Routing to @getsentry/product-owners-sdks-native for triage ⏲️

@david-maw
Copy link

I reported this, and as I said the workaround, once I figured it out, was easy. If the incorrect code I chose (call ConfigureFunctionsWorkerDefaults then ConfigureFunctionsWebApplication) had failed to compile, or run with an error, I'd have probably figured it out earlier, but because it seemed to work, but actually didn't, diagnosis took more work. As far as I can tell in the failed configuration my function code was never invoked, the infrastructure just returned status code OK for all calls with no attached data and my caller just quietly did the wrong thing.

All I would have needed is a hint to use either ConfigureFunctionsWorkerDefaults or ConfigureFunctionsWebApplication, whichever was already there.

@bitsandfoxes
Copy link
Contributor

Thanks for letting us know. I'll update the docs.

@david-maw
Copy link

You're welcome, I'm relatively new to Azure Functions but as far as I can see Microsoft now seem to prefer to use the newer ConfigureFunctionsWebApplication function in order to enable some ASP.NET functionality in Azure Functions but still support ConfigureFunctionsWorkerDefaults, presumably for existing code. In particular, ConfigureFunctionsWebApplication is what they emit if you create a default Azure Functions project in Visual Studio (which is how I stumbled over this).

@bitsandfoxes
Copy link
Contributor

Based on the docs it depends whether you're using the ASP.NET Core integration the ConfigureFunctionsWebApplication is part of.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Product Area: SDKs - Native Type: Content Issues about the contents of our docs
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants