c# - 人脸API "Access denied due to invalid subscription key..."

标签 c# api azure face

我已经尝试过使用与两个不同电子邮件地址关联的免费试用 key 和“即用即付”计费方式。他们都返回了相同的消息:

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");

enter image description here

关于c# - 人脸API "Access denied due to invalid subscription key...",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43918434/

相关文章:

c# - 在 ASP.Net 中静态或作为单例使用 XML Webservices

c# - 你如何使用 MVC/Razor 封装 logic/html

c# - C# 我的应用程序中崩溃报告的最佳实践

c# - 节点如何添加到链表中并成为它的新头?

python-3.x - 使用 Python 解决验证码问题

c# - C# 中的 Google 网站站长工具 API

powershell - Azure 自动化 Powershell Runbook 无法进行 LoadAssembly

Azure Web API 数据库用户导入和密码哈希

api - 使用 Instagram 权限的情况下的示例应用程序

java - 通过 Java SDK 列出我的 Azure 帐户上的虚拟机