How to deploy Azure Document Intelligence endpoints and integrate them into CI/CD pipelines

Thaenraj Packiamani 0 Reputation points
2024-08-26T14:24:12.7766667+00:00

For the past few weeks, I have been building and analyzing models using the Document Intelligence Administrative Client and Analyze Client services. I understand that Azure Document Intelligence services are PaaS offerings that manage prebuilt and custom models, including the invocation requests and responses for their admin and client SDK services.

Should I route the model's admin and analyze services through Azure API Management (APIM) to track and manage all invocations, or is it better to call the endpoints directly, similar to other SaaS services? Moreover, since the document analysis processing happens asynchronously and the response time varies based on the size of the document, is it advisable to route these endpoints through APIM for processing? Or would it be more efficient to call these endpoints directly and monitor their usage via Azure Cognitive Services API? I have not encountered any deployment patterns that address this specific use case, particularly concerning CI/CD integration. I appreciate your guidance on this

Azure AI Document Intelligence
Azure AI Document Intelligence
An Azure service that turns documents into usable data. Previously known as Azure Form Recognizer.
1,629 questions
{count} votes

1 answer

Sort by: Most helpful
  1. navba-MSFT 23,895 Reputation points Microsoft Employee
    2024-08-27T05:52:22.97+00:00

    @Thaenraj Packiamani Welcome to Microsoft Q&A Forum, Thank you for posting your query here!

    .

    Please find below the answers inline to your questions:

    How to deploy Azure Document Intelligence endpoints and integrate them into CI/CD pipelines?

    Create Azure Document Intelligence Resources: Start by creating the necessary resources in the Azure portal. This includes setting up your Document Intelligence resource and any associated storage accounts.

    Set Up CI/CD Pipelines:

    • Azure DevOps: Use Azure Pipelines to automate the deployment process. Create a pipeline that includes steps for deploying your Document Intelligence models and endpoints.
    • GitHub Actions: Alternatively, you can use GitHub Actions to set up workflows that automate the deployment of your models and endpoints.
    • Integrate with CI/CD:
      1. Build Pipeline: Include steps to build and validate your models.
      2. Release Pipeline: Deploy the models to your Document Intelligence resource. Use ARM templates or Bicep files to manage your infrastructure as code.
    • Monitor and Manage: Use Azure Monitor and Application Insights to track the performance and usage of your deployed models.

    The similar discussion / ask has been raised here:

    https://learn.microsoft.com/en-us/answers/questions/1530702/document-intelligence-ci-cd

    .

    .

    .

    Should I route the model’s admin and analyze services through Azure API Management (APIM) to track and manage all invocations, or is it better to call the endpoints directly, similar to other SaaS services?

    Routing your model’s admin and analyze services through Azure API Management (APIM) can provide several benefits:

    • Centralized Management: APIM allows you to manage all your API endpoints in one place, providing a unified interface for monitoring and managing API calls. See here.
    • Security: APIM offers enhanced security features, including authentication, authorization, and throttling, which can help protect your endpoints. See here.
    • Analytics and Monitoring: APIM provides detailed analytics and monitoring capabilities, allowing you to track usage patterns and performance metrics. See here.

    However, calling the endpoints directly can be more efficient in some cases, especially if you have low latency requirements or if the additional overhead of APIM is not justified for your use case. See here.

    .

    .

    .

    Is it advisable to route these endpoints through APIM for processing? Or would it be more efficient to call these endpoints directly and monitor their usage via Azure Cognitive Services API?

    Routing through APIM can be beneficial for:

    • Load Balancing: APIM can help distribute the load across multiple instances of your service, improving reliability and performance. See here
    • Retry Mechanisms: APIM can implement retry policies to handle transient failures, ensuring higher availability. See here.

    .

    .

    However, for asynchronous document processing where response times can vary significantly, calling the endpoints directly might be more efficient. This approach reduces the additional latency introduced by APIM and allows you to monitor usage directly via the Azure Cognitive Services API.

    .

    In summary, the choice between using APIM and calling endpoints directly depends on your specific requirements for security, management, and performance. For CI/CD integration, both approaches can be automated using Azure DevOps or GitHub Actions.

    .

    Hope this helps. If you have any follow-up questions, please let me know. I would be happy to help.

    **

    Please do not forget to "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.

    1 person found this answer helpful.
    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.