Hi @Amol Harde ,
Thank you for reaching out to the Microsoft Q&A forum!
To migrate from the 2022-06-30-preview API version to the latest 2023-07-31 (GA) API version using the SDK, update to the current version of the language specific SDK. The Document Intelligence SDK enables the use and management of the Document Intelligence service in your application. The SDK builds on the underlying Document Intelligence REST API allowing you to easily use those APIs within your programming language paradigm. Here's how you use the Document Intelligence SDK for your preferred language:
- Install the SDK client library
- Import the SDK client library into your application
- Set up authentication There are two supported methods for authentication
- Use a Document Intelligence API key with AzureKeyCredential from azure.core.credentials.
- Use a token credential from azure-identity to authenticate with Azure Active Directory. Use your API key Here's where to find your Document Intelligence API key in the Azure portal:
Use an Azure Active Directory (Azure AD) token credential
Note: Regional endpoints do not support AAD authentication. Create a custom subdomain for your resource in order to use this type of authentication.
Authorization is easiest using the DefaultAzureCredential
. It provides a default token credential, based upon the running environment, capable of handling most Azure authentication scenarios.
Here's how to acquire and use the DefaultAzureCredential for Java applications:
1. Install the Azure Identity library for Java:
2.Register an Azure AD application and create a new service principal.
3.Grant access to Document Intelligence by assigning the Cognitive Services User
role to your service principal.
4.Set the values of the client ID, tenant ID, and client secret of the Azure AD application as environment variables: AZURE_CLIENT_ID
, AZURE_TENANT_ID
, and AZURE_CLIENT_SECRET
, respectively.
5.Create your DocumentAnalysisClient
instance and TokenCredential
variable:
For more information, see Authenticate the client
- Build your application Create a client object to interact with the Document Intelligence SDK, and then call methods on that client object to interact with the service. The SDKs provide both synchronous and asynchronous methods. For more insight, try a quickstart in a language of your choice.
I hope this information helps! Please kindly accept the answer and vote 'yes' if you feel helpful to support the community, Thanks.