When using the Azure Event Hubs output binding for Azure Functions, is it possible to specify a partition key?
I have code similar to the below, but I don't see any way to specify a partition key prior to send.
Alternatively, is there any way I could use the Function parameters to bind an EventHubProducerClient, with an identity-based connection? This would be useful as the client allows for multiple ways to specify a partitionId.
I'm aware that it's possible to wire up dependency injection, and to use that to get the client, but I was curious if I could avoid that.
[FunctionName("EventHubOutput")]
[return: EventHub("outputEventHubMessage", Connection = "EventHubConnectionAppSetting")]
public static string Run([TimerTrigger("0 */5 * * * *")] TimerInfo myTimer, ILogger log)
{
log.LogInformation($"C# Timer trigger function executed at: {DateTime.Now}");
return $"{DateTime.Now}";
}