AZF0001: Avoid async void

This rule is triggered when the void return type is used in an async function definition.

Value
Rule ID AZF0001
Severity Error

Rule description

Defining async functions with a void return type make it impossible for the Functions runtime to track invocation completion or catch and handle exceptions thrown by the function method.

Refer to this article for general async void information: https://msdn.microsoft.com/magazine/jj991977.aspx

How to fix violations

To fix violations, change the function's return type from void to Task and make the necessary code changes to appropriately return a Task.

When to suppress the rule

This rule should not be suppressed. Use of async void will lead to unpredictable behavior.