Azureイベントハブに接続し、イベントハブに受信するたびにメッセージを書き出す単純なトリガベースのAzure関数があります。C#WebアプリケーションとしてのAzure関数のデバッグ
私は下のポストに基づいてC#Webアプリケーションとしてこれを作成し、ローカルでこの機能をデバッグしようとしています: - https://blogs.msdn.microsoft.com/appserviceteam/2017/03/16/publishing-a-net-class-library-as-a-function-app/
ここでは私の機能コードです: - ここに
using Microsoft.Azure.WebJobs.Host;
using System;
using System.Threading.Tasks;
namespace FunctionLibrary
{
public class EventHubProcessorFunction
{
public static void Run(string myEventHubMessage, TraceWriter log)
{
log.Info($"C# Event Hub trigger function processed a Vineet message: {myEventHubMessage}");
}
}
}
は私ですfunction.json
{
"disabled": false,
"scriptFile": ".\\bin\\FunctionAsWebApp.dll",
"entryPoint": "FunctionLibrary.EventHubProcessorFunction.Run",
"bindings": [
{
"type": "eventHubTrigger",
"name": "myEventHubMessage",
"direction": "in",
"path": "edpvineethub",
"connection": "AzureWebJobsServiceBus"
}
]
}
私のフォルダ構造は次のとおりです。 - Webアプリケーションプロジェクトに次のファイルを含めました: -
ローカルで実行しようとしたとき、私は以下のエラーメッセージを取得していますがbin\FunctionAsWebApp.dll
NameOfYourFunction\function.json
AnotherFunctionIfYouHaveOne\function.json
appsettings.json
host.json
; -
No job functions found. Try making your job classes and methods public. If you'r
e using binding extensions (e.g. ServiceBus, Timers, etc.) make sure you've call
ed the registration method for the extension(s) in your startup code (e.g. confi
g.UseServiceBus(), config.UseTimers(), etc.).
任意の助けをいただければ幸いです。フォルダ構造は次のようになります
サービスバスのトピックにアクセスしようとしているだけで、同じエラーが発生しています。私は、VSがfunction.jsonのtypeの "serviceBusTrigger"の値を気に入らないことにも気付きました。サポートされていないだけですか? – jemerick