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

Binding custom model in Azure HttpTrigger Isolated Function #1803

Closed
ranjeetkpGit opened this issue Aug 4, 2023 · 4 comments
Closed

Binding custom model in Azure HttpTrigger Isolated Function #1803

ranjeetkpGit opened this issue Aug 4, 2023 · 4 comments
Labels
area: http Items related to experience improvements for HTTP triggers

Comments

@ranjeetkpGit
Copy link

ranjeetkpGit commented Aug 4, 2023

Hi,
Is it possible to use custom model along with HttpRequestData in Azure Http Trigger Isolated function with get and post methods?
I tried a custom DTO SessionToken as below but it is always null.

image

@mattchenderson mattchenderson added the area: http Items related to experience improvements for HTTP triggers label Aug 9, 2023
@mattchenderson
Copy link
Contributor

We're planning an update soon which should enable support. Just to clarify, in your example, you'd want to have something like

public async Task<SessionDocresult> Run( [ <http trigger attribute> ] HttpRequestData request, SessionToken token)

Is that correct?

@ranjeetkpGit
Copy link
Author

We're planning an update soon which should enable support. Just to clarify, in your example, you'd want to have something like

public async Task<SessionDocresult> Run( [ <http trigger attribute> ] HttpRequestData request, SessionToken token)

Is that correct?

Yes Matthew, Its correct. SessionToken is a custom class.
At present its two step process.

  1. Get Body content from HttpRequestData (Stream)
  2. Deserialize it to required types

@JeroenvdBurg
Copy link

JeroenvdBurg commented Aug 11, 2023

this is solved #1712 (not released yet)

@fabiocav
Copy link
Member

Closing this as resolved as the feature has been released.

Here's a link to the documentation: https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-http-webhook-trigger?tabs=python-v2%2Cisolated-process%2Cfunctionsv2&pivots=programming-language-csharp#usage

Please let us know if you have any questions or problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: http Items related to experience improvements for HTTP triggers
Projects
None yet
Development

No branches or pull requests

4 participants