This page is outdated and thus confusing for new Azure users (students!).
New function apps have async in their signature, e.g.
"public static async Task<IActionResult> Run(HttpRequest req, ILogger log)"
You can't have 'out' parameters in async methods. So the example code in the paragraph "Update the function code" does not show how to use the created output binding to Cosmos DB.
⚠Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
@jovabel Thanks for the feedback! We will review and update accordingly.
@jovabel While the default template created now are async functions, the code present in the tutorial will work when replaced as the document instructs.
For async functions, you will have to use IAsyncCollector as described in the docs.
@jovabel Just following up here... Hope my previous comment clears things up.
@jovabel We will now proceed to close this thread. If there are further questions regarding this matter, please tag me in your reply. We will gladly continue the discussion and we will reopen the issue.
Thanks for clearing up. However it took me some time to find the solution that uses the IAsyncCollector. For programmers starting with Azure, it would be nice if code examples in the official documentation match the latest standards / templates /....
@jovabel Just following up here... Hope my previous comment clears things up.
I am looking for a working introduction or example for this but whole MS examples are not working. Also official azure functions output for cosmos db snippets are not running! It's really hard to understand why every documentation is wrong here!!
Most helpful comment