0
カスタムConsumerGroupでEventHubTriggerを使いたいと思います。デフォルトConsumerGroupを使用した場合EventHubTriggerを使用してカスタムConsumerGroupを設定してください
コードは次のようになります。
public static async Task ProcessQueueMessage([EventHubTrigger("%EventHubName%")] TelemetryEvent[] messages, TextWriter log)
{}
EventHubTriggerAttribute
クラスを設定することができConsumerGroupプロパティがあります。しかしどうですか?あなたはEventHubTriggerでConsumerGroupプロパティを設定したい場合は
[AttributeUsage(AttributeTargets.Parameter)]
public sealed class EventHubTriggerAttribute : Attribute
{
//
// Summary:
// Create an instance of this attribute.
//
// Parameters:
// eventHubName:
// Event hub to listen on for messages.
public EventHubTriggerAttribute(string eventHubName);
//
// Summary:
// Name of the event hub.
public string EventHubName { get; }
//
// Summary:
// Optional Name of the consumer group. If missing, then use the default name, "$Default"
public string ConsumerGroup { get; set; }
}