Search code examples
azureazure-form-recognizer

API Authentication for Azure Form Recognizer


For API authentication, I understand that Azure Form Recognizer uses "Ocp-Apim-Subscription-Key" which is the Azure Subscription ID. Also, shouldn't there be an API key as well, which we should be using for accessing any API across the subscription? Or is it there? Also, once the authentication is successful, do we have a kind of token which ensure the user remains authenticated for some time? How does this work? Moreover, as per the attached image, there are two API keys involved while using the AFR APIs. What is the use of those two keys?

AFR API issue


Solution

  • Basically, we use key1 or key2 as Ocp-Apim-Subscription-Key as below :

    enter image description here enter image description here

    If you want to use the Azure AD access token to call this API, see this doc.