Azure Functions Core ToolsでFunctionsを使って実行後、HTTPトリガーを呼び出すと以下のエラーが発生します。
An unhandled host error has occurred.
System.Private.CoreLib: Exception has been thrown by the target of an invocation. Microsoft.AspNetCore.Authentication.JwtBearer: Could not load file or assembly 'System.IdentityModel.Tokens.Jwt, Version=6.35.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. 指定されたファイルが見つかりません。.
環境的には
- Azure Functions Core Tools 4.0.5907
- .NET なFunctions(.NET 6, .NET 8 それぞれ In-Proc/Isolated両方)
- HTTPトリガーの呼び出し時に上記エラー
なおVisual Studioからデバッグ実行すると問題ないです。func start とかのコマンドで実行してHTTPトリガーを呼び出すとエラーになります。
ワークアラウンド
いまのところ Azure Functions Core Tools 4.0.5858 を使えば問題なさそう。