C
C#15mo ago
J.

❔ Syntactical Difference In Azure Function Scripts

I have syntax for two files:
[Function("CreatePrivateMessage")]
public HttpResponseData Run([HttpTrigger(AuthorizationLevel.Function, new string[]
{
"get",
"post"
})] HttpRequestData req)
{...
[Function("CreatePrivateMessage")]
public HttpResponseData Run([HttpTrigger(AuthorizationLevel.Function, new string[]
{
"get",
"post"
})] HttpRequestData req)
{...
[FunctionName("CreatePrivateMessage")]
public static async Task<IActionResult> Run(
[HttpTrigger(AuthorizationLevel.Function, "get", "post", Route = null)] HttpRequest req,
ILogger log) {...

[FunctionName("CreatePrivateMessage")]
public static async Task<IActionResult> Run(
[HttpTrigger(AuthorizationLevel.Function, "get", "post", Route = null)] HttpRequest req,
ILogger log) {...

They both work, but it seems that there is significant difference in the syntax. What's up with this? ChatGPT says that the first one (the one that returns HttpResponseData) is Azure Functions v4, whereas the async Task<IActionResult> one is Azure Functions v3. Is this true?
2 Replies
J.
J.OP15mo ago
found out it's Isolated Mode Syntax vs In Process mode syntax. am even more confused now
Accord
Accord15mo ago
Looks like nothing has happened here. I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server