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

error AZF0001: Async void can lead to unexpected behavior, Return Task instead. #77

Open
yoheng opened this issue Mar 7, 2022 · 2 comments

Comments

@yoheng
Copy link

yoheng commented Mar 7, 2022

the below function got an error when I try to build it.

[FunctionName("ProcessHubToDTEvents")]
public async void Run([EventGridTrigger]EventGridEvent eventGridEvent, ILogger log)

@cranberry13
Copy link

Change the code to:

public async Task Run(...

and then add the following to the top of the file:

using System.Threading.Tasks;

In addiiton, use the VS terminal to add the System.Threading.Tasks package to your workspace.

The error should go away.

@Satya-Kolluri
Copy link
Contributor

Satya-Kolluri commented Mar 25, 2022

@yoheng - Is the error related to EventGridEvent? We've updated the using statements in the sample source code. Please try to get the latest and retry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants