getting a Microsoft.Azure.CognitiveServices.Vision.Face.Models.APIErrorException: Operation returned an invalid status code Forbidden

Mohammed Usama Maaz (IN) 0 Reputation points
2023-02-03T10:27:59.8833333+00:00

Hi

Iam facing the same issue as in that link, iam just using face detection(open to all) instead of face recoginition, then why iam i getting this error also attached the error snap for your reference.

https://learn.microsoft.com/en-us/azure/cognitive-services/computer-vision/quickstarts-sdk/identity-client-library?tabs=visual-studio&pivots=programming-language-csharp

========IDENTIFY FACES========

Create a person group (35620036-ec3a-4efd-b03c-a1efe36bd5e2).
Unhandled exception. System.AggregateException: One or more errors occurred. (Operation returned an invalid status code 'Forbidden')
 ---> Microsoft.Azure.CognitiveServices.Vision.Face.Models.APIErrorException: Operation returned an invalid status code 'Forbidden'
   at Microsoft.Azure.CognitiveServices.Vision.Face.PersonGroupOperations.CreateWithHttpMessagesAsync(String personGroupId, String name, String userData, String recognitionModel, Dictionary`2 customHeaders, CancellationToken cancellationToken)
   at Microsoft.Azure.CognitiveServices.Vision.Face.PersonGroupOperationsExtensions.CreateAsync(IPersonGroupOperations operations, String personGroupId, String name, String userData, String recognitionModel, CancellationToken cancellationToken)
   at FaceQuickstart.Program.IdentifyInPersonGroup(IFaceClient client, String url, String recognitionModel) in C:\Users\demousr\source\repos\facedetectiondemo\facedetectiondemo\Program.cs:line 105
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at System.Threading.Tasks.Task.Wait()
   at FaceQuickstart.Program.Main(String[] args) in C:\Users\demousr\source\repos\facedetectiondemo\facedetectiondemo\Program.cs:line 38

C:\Users\demousr\source\repos\facedetectiondemo\facedetectiondemo\bin\Debug\net6.0\facedetectiondemo.exe (process 1244) exited with code -532462766.
Press any key to close this window . . .

Azure AI services
Azure AI services
A group of Azure services, SDKs, and APIs designed to make apps more intelligent, engaging, and discoverable.
2,406 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. YutongTie-MSFT 46,986 Reputation points
    2023-02-04T21:54:13.1433333+00:00

    Hello Mohammed Usama Maaz (IN)

    Thanks for reaching out to us. For the Face API, only face detection with parameter returnFaceId=false doesn't require approval, FaceId is part of Face Recognition. Other than this, almost all the remaining APIs require. PersonGroup's purpose is for identify, so it needs limited access.

    I am sorry about the inconvenience, I hope you can understand. If you have already done that but still got the error, please let me know.

    Regards,

    Yutong

    -Please kindly accept the answer if you feel helpful to support the community, thanks a lot.