I am trying to use azure's document analysis client but I don't use credentials for my form recognizer. I can make a simple request call to it and it works fine, like so:
import requests
my_endpoint = "http://form_recognizer...?api-version=2022-08-31"
data = "some data"
params = "some params"
requests.post(my_endpoint, headers={'Content-Type': 'application/octet-stream'}, data=data, params=params)
The request works and it gives me the results I need. However, I would prefer to use DocumentAnalysisClient because it comes with several methods that would save me weeks of coding. However, this class requires a credential argument but I am not using credentials for this endpoint. It is an open HTTP endpoint, so how exactly can I use the class without providing any credentials?
from azure.ai.formrecognizer import DocumentAnalysisClient
client = DcoumentAnalysisClient(endpoint=my_endpoint, credential=...)
According to this MS-Document, it is not possible to access
DocumentAnalysisClientwithout credentials.The
DocumentAnalysisClientrequires a credential to authenticate with the Azure service, either withAzureKeyCredentialorAzure Active Directory credential.For key credential, you need to pass the
keyof your Document intelligence AI service.Code:
For Active Directory credential, you need to use azure-identity to authenticate with Document intelligence AI service.
Code:
Now, using the above authentication process, you can build all intelligent document processing solutions.
Reference: Quickstart: Document Intelligence (formerly Form Recognizer) SDKs - Azure AI services | Microsoft Learn