脸 API "Access denied due to invalid subscription key..."

Face API "Access denied due to invalid subscription key..."

我已经尝试使用与两个不同的电子邮件地址和 "Pay as you go" 账单关联的免费试用密钥。他们都返回了同样的信息:

Access denied due to invalid subscription key. Make sure you are subscribed to an API you are trying to call and provide the right key.

我正在使用这个FACE API getting started tutorial

private readonly IFaceServiceClient faceServiceClient = new FaceServiceClient("39a8b...0fd1");
var faces = await faceServiceClient.DetectAsync(imageFileStream);

I have an endpoint defined in the Portal "eastus2.api.cognitive.microsoft.com/face/v1.0"; but I don't know how to associated this endpoint with my service calls. What am I missing, please?

如果你得到端点,你可以把它放在FaceServiceClient的构造函数中。以下代码供您参考。

private readonly IFaceServiceClient faceServiceClient = 
    new FaceServiceClient("your_key", "https://eastus2.api.cognitive.microsoft.com/face/v1.0");

我已将 URL 更改为“https://westcentralus.api.cognitive.microsoft.com/face/v1.0”并且有效

KEY 似乎没有复制到所有位置