C#C
C#3y 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)
            {...


    [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?
Was this page helpful?