Document Intelligence API with Cognitive Services

Seda Aykutlu 0 Reputation points
2024-07-10T11:07:45.5166667+00:00

Hello,

I have an Azure AI services multi-service account, which includes Document Intelligence too as below image.

User's image

And I am trying to use Document Intelligence API and using cognitive services endpoint and key to send API call.

string requestUri = $"{serviceOptions.Endpoint}/documentintelligence/documentModels/{documentIntelligenceModelType}:analyze?api-version={documentIntelligenceApiVersion}&locale=en-US&stringIndexType=textElements";

User's image

However, I have "NotFound" result from API call. I want to avoid creating Document Intelligence resource as I have multi-service account already which includes access to Document Intelligence.

What is the reason of this issue and how can I use Document Intelligence API/SDK's with multi-service account?

Azure AI Document Intelligence
Azure AI Document Intelligence
An Azure service that turns documents into usable data. Previously known as Azure Form Recognizer.
1,713 questions
Azure AI services
Azure AI services
A group of Azure services, SDKs, and APIs designed to make apps more intelligent, engaging, and discoverable.
2,897 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Seda Aykutlu 0 Reputation points
    2024-07-10T12:00:28.4166667+00:00

    Hello,

    yes, I double checked the keys and endpoints and they do exists. Does it has to do anything with location of cognitive service? I have it deployed in uksouth and I am trying to use layout model with docx extension

    0 comments No comments

  2. santoshkc 9,240 Reputation points Microsoft Vendor
    2024-07-11T12:34:47.32+00:00

    Hi @Seda Aykutlu,

    Thank you for your response. I tried to repro the issue and able to use Document Intelligence API without any issues. I recommend you to use the region header for multi service account. When using the multi-service resource key to make a request to api.cognitive.microsoft.com, you must include the region in the URL. For example: westus.api.cognitive.microsoft.com.

    When using a multi-service resource key with Document Intelligence, you must specify the resource region with the Ocp-Apim-Subscription-Region header.
    For more info, see: Authenticate with a multi-service resource key.
    Also see: Analyze document with document model.

    I hope it will work. 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.