をSDK:Azureの機能は、任意のコードを変更せず1.0.1 CLIツールにアップグレードした後、私は突然、次のエラーを取得するために始めた
ResizeImage: Microsoft.Azure.WebJobs.Host: Error indexing method 'Functions.ResizeImage'.
Microsoft.Azure.WebJobs.Extensions.DocumentDB:
'Id' is required when binding to a DocumentClient property.
次のコード:
[FunctionName(nameof(ResizeImage))]
public static async Task RunAsync([BlobTrigger("profile-pictures/{name}")] CloudBlockBlob myBlob, string name, [DocumentDB(databaseName: "x", collectionName: "UserProfile", CreateIfNotExists = true)] DocumentClient client, [Blob("profile-pictures/resized-{name}", FileAccess.ReadWrite)] CloudBlockBlob resizedBlob, TraceWriter log)
を私はIdがあると思いましたオプション?少なくともそれはドキュメントが言うことです。ドキュメントによると
:The properties id and sqlQuery cannot both be specified. If neither id nor sqlQuery is set, the entire collection is retrieved.
生成されたJSON:
{
"bindings": [
{
"type": "blobTrigger",
"path": "profile-pictures/{name}",
"direction": "in",
"name": "myBlob"
},
{
"type": "documentDB",
"databaseName": "x",
"collectionName": "UserProfile",
"createIfNotExists": true,
"direction": "out",
"name": "client"
},
{
"type": "blob",
"path": "profile-pictures/resized-{name}",
"direction": "inout",
"name": "resizedBlob"
}
],
"disabled": false,
"scriptFile": "..\\X.Functions.dll",
"entryPoint": "X.Functions.ResizeImage.RunAsync"
}
私が使用している1.0.0 SDK
ご回答のおかげで、私は私が私の機能の属性および型定義に依存するため、その場でそれを生成するためのSDKを使用していますように私はちょうど生成されたJSONを変更することはできません。 –
バインドタイプをIEnumerableに変更しましたか?これで問題は解決しますか? –
Amor
はい、そうではありませんでした。これは明らかに既知のバグであり、将来修正される予定です。 –