MicrosoftDocs / azure-docs

Open source documentation of Microsoft Azure
https://docs.microsoft.com/azure
Creative Commons Attribution 4.0 International
10.32k stars 21.51k forks source link

Wrong exemple and explanations in EventHub trigger for AZF isolated process #116209

Closed FrederickRies closed 1 year ago

FrederickRies commented 1 year ago

It seems to have an error in the given page as the exemple show a event hub trigger for isolated process with the custom attribute [EventHubOutput] wich is not a trigger but an output binding. The exemple should use [EventHubTrigger] on the function parameter instead.

{ private readonly ILogger _logger;

public EventHubsFunction(ILogger<EventHubsFunction> logger)
{
    _logger = logger;
}

[Function(nameof(EventHubFunction))]
[FixedDelayRetry(5, "00:00:10")]
[EventHubOutput("dest", Connection = "EventHubConnection")]
public string EventHubFunction(

Document Details

Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.

navba-MSFT commented 1 year ago

@FrederickRies Thanks for reaching out to us and raising this issue. The sample shared in this docs is correct and its just a snippet. The complete working sample is available here.

To make the snippet more clear and to avoid the confusion, I am creating the below PR.

navba-MSFT commented 1 year ago

@FrederickRies We have created a PR and a workitem internally to add snippet ID tags in the code examples in the worker repo, which should prevent this from happening in the future.

FrederickRies commented 1 year ago

Thank you @navba-MSFT. Have a great day