Vision API AnnotationUrls and AuthenticationKind not uploading COCO file

Clodagh Lynch 70 Reputation points Microsoft Employee
2024-05-02T13:50:17.3266667+00:00

Getting error message: "message": "AuthenticationKind is required for registering dataset using AnnotationFileUrls." when using Azure Vision AI API.

This is the curl command I'm using

curl.exe -v -X PUT "https://xxx-computer-vision.cognitiveservices.azure.com/computervision/datasets/xxx-dataset?api-version=2023-02-01-preview" -H "Content-Type: application/json" -H "Ocp-Apim-Subscription-Key: xxx" --data-ascii "
{
'annotationKind':'imageObjectDetection',
'annotationFileUris':['https://xxx.blob.core.windows.net/xxx/xxx/train.json'],
'authenticationKind': 'Key',
}"


when I change 'annotationFileUris' to 'annotationFileUrls' the command is successful. However, it does not upload the train.json file as the COCO file on the Vision AI dataset because annotationFileUris is empty (see picture).User's image

Can anyone help solve this please? Thank you.

Azure Computer Vision
Azure Computer Vision
An Azure artificial intelligence service that analyzes content in images and video.
379 questions
{count} votes

Accepted answer
  1. VasaviLankipalle-MSFT 17,471 Reputation points
    2024-05-02T18:32:29.75+00:00

    Hello @Clodagh Lynch , I'm glad that you were able to resolve your issue and thank you for posting your solution so that others experiencing the same thing can easily reference this! Since the Microsoft Q&A community has a policy that "The question author cannot accept their own answer. They can only accept answers by others ", I'll repost your solution in case you'd like to "Accept " the answer.

    Issue: error message: "message": "AuthenticationKind is required for registering dataset using AnnotationFileUrls." when using Azure Vision AI API.

    Solution: Worked once changed "authenticationKind" to "authentication".

    {
      "annotationKind": "imageObjectDetection",
      "annotationFileUris": [
        "https://xxx.blob.core.windows.net/xxx/xxx/train.json"
      ],
      "authentication": {
        "kind": "sas",
        "sasToken": "your_blob_key"
      }
    }
    

    Here is the related documentation: https://learn.microsoft.com/en-us/rest/api/computervision/datasets/register?view=rest-computervision-2023-02-01-preview&tabs=HTTP#request-body

    Thank you again for your time and patience throughout this issue.

    Regards,
    Vasavi

    Please remember to "Accept Answer" if any answer/reply helped, so that others in the community facing similar issues can easily find the solution.


1 additional answer

Sort by: Most helpful
  1. Charlie Wei 3,325 Reputation points
    2024-05-02T16:06:41.9233333+00:00

    Hello Clodagh Lynch,

    Can you help me try the following JSON as the request body?

    {
      "annotationKind": "imageObjectDetection",
      "annotationFileUris": [
        "https://xxx.blob.core.windows.net/xxx/xxx/train.json"
      ],
      "authenticationKind": {
        "kind": "sas",
        "sasToken": "your_blob_key"
      }
    }
    
    Name Type Description
    sasToken string Optional. The sas token to access container. Only needed when Kind = Sas.

    For more detailed information, please refer to this document.

    Best regards,
    Charlie


    If you find my response helpful, please consider accepting this answer and voting yes to support the community. Thank you!

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.