私は、Visual Studioツールを使用している関数入力バインドで奇妙な問題を抱えています。これは正常に動作し、私が欲しいデータを取得Azure関数での奇妙な衝突
[FunctionName("Scaling")]
public static HttpResponseMessage Run([HttpTrigger(AuthorizationLevel.Function, "get", "post", Route = "HttpTriggerCSharp/name/{name}")]HttpRequestMessage req, string name, [Table("scalingdatawesteurope", Connection = "scalingdataStorage")]CloudTable scalingDataTable, TraceWriter log)
{
log.Info("C# HTTP trigger function processed a request.");
var customerScaleData = GetScaleData(name, scalingDataTable);
log.Info("Sub:" + customerScaleData.Subscription);
// Fetching the name from the path parameter in the request URL
return req.CreateResponse(HttpStatusCode.OK, "Hello " + name);
}
:私は、HTTPトリガーとテーブル格納用のバインディングを入力した簡単な関数を作成しました。しかし、今私がやりたいことは、このデータを使用して、ARM APIを使用して他のAzureリソースに対していくつかの操作を実行することです。ですから、Microsoft.Azure.Management.FluentパッケージをNugetでインポートして、これを行うことができます。このパッケージをインポートして依存関係として追加すると、私の関数は失敗します。私がそれを取り除くと、それはすべて再び働く。
[23/10/2017 12:23:14] A ScriptHost error has occurred
[23/10/2017 12:23:14] Microsoft.Azure.WebJobs.Host: Error indexing method 'Scaling.Run'. Microsoft.Azure.WebJobs.Host: Can't bind Table to type 'Microsoft.WindowsAzure.Storage.Table.CloudTable'.
[23/10/2017 12:23:14] Error indexing method 'Scaling.Run'
[23/10/2017 12:23:14] Microsoft.Azure.WebJobs.Host: Error indexing method 'Scaling.Run'. Microsoft.Azure.WebJobs.Host: Can't bind Table to type 'Microsoft.WindowsAzure.Storage.Table.CloudTable'.
[23/10/2017 12:23:14] No job functions found. Try making your job classes and methods public. If you're using binding extensions (e.g. ServiceBus, Timers, etc.) make sure you've called the registration method for the extension(s) in your startup code (e.g. config.UseServiceBus(), config.UseTimers(), etc.).
[23/10/2017 12:23:14] Job host started
[23/10/2017 12:23:14] The following 1 functions are in error:
[23/10/2017 12:23:14] Run: Microsoft.Azure.WebJobs.Host: Error indexing method 'Scaling.Run'. Microsoft.Azure.WebJobs.Host: Can't bind Table to type 'Microsoft.WindowsAzure.Storage.Table.CloudTable'.
[23/10/2017 12:23:14]
[23/10/2017 12:23:14]
[23/10/2017 12:23:14] Host lock lease acquired by instance ID '000000000000000000000000F195573C'.
Debugger listening on [::]:5858
ここには何らかの矛盾があるようですが、私はそれを見つけたり修正したりするのに苦労しています。
使用しているストレージSDKのバージョンは何ですか? https://stackoverflow.com/questions/42284705/precompiled-azure-function-and-cloudtable-binding-output-doesnt-work – DavidG