Я пытался позвонить Azure Computer Vision API , используя приведенный ниже код C#, но получил следующий ответ:
{"code":"404","message":"Resource not found"}
Любой совет, чтобы получить эту работу?
using System;
using System.IO;
using System.Threading.Tasks;
using AzureFunctions.Extensions.CognitiveServices.Bindings.Vision.Analysis;
using Microsoft.Azure.WebJobs;
using Microsoft.Azure.WebJobs.Host;
using Microsoft.Extensions.Logging;
using Microsoft.WindowsAzure.Storage.Table;
namespace myCognitiveFunction
{
public static class myCognitiveFunction
{
[FunctionName("myCognitiveFunction")]
public static async Task RunAsync(
[BlobTrigger("images/{name}", Connection = "storageAccount")]Stream myBlob,
[VisionAnalysis(VisionKey = "Key", VisionUrl = "Url")]VisionAnalysisClient visionClient,
[Table("VisionAnalysis", Connection = "storageAccount")]IAsyncCollector<VisionResult> results,
string name, ILogger log)
{
var request = new VisionAnalysisRequest(myBlob);
var result = await visionClient.AnalyzeAsync(request);
var visionResult = new VisionResult(Guid.NewGuid().ToString(), "VisionAnalysis") { ResultJson = result.ToString() };
await results.AddAsync(visionResult);
log.LogInformation($"Results: {result.ToString()}");
}
}
public class VisionResult : TableEntity
{
public VisionResult(string id, string partitionKey)
{
this.RowKey = id;
this.PartitionKey = partitionKey;
}
public string ResultJson { get; set; }
}
}
URL: https://mycognitive1000.cognitiveservices.azure.com/