Azure document Intelligence - Invoice Model stopped returning Date data we rely on

Joe Roddy 20 Reputation points
2025-04-11T17:49:17.6066667+00:00

Until very recently, the invoice model returned two fields that are critical to our service's value:

fields.ServiceStartDate

fields.ServiceEndDate

^ These represent the start and end date of the service. This was being extracted perfectly, until today, we noticed the dates weren't coming back at all anymore. We've re-tested with some of the same exact documents that previously were correctly returning these fields and confirmed they're no longer available.

This is a huge issue for our app and represents a big reason why we chose the invoice model / azure in the first place.

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

Accepted answer
  1. santoshkc 14,260 Reputation points Microsoft External Staff
    2025-04-14T14:26:55.13+00:00

    Hi @Joe Roddy,

    We understand the importance of the ServiceStartDate and ServiceEndDate fields, are currently not being returned, even for documents where they were previously extracted. This may be due to a recent model update or internal change. If these fields are critical, you might consider creating a custom model to ensure consistent extraction.

    I tried to repro the issue with the below code and able to extract ServiceStartDate and ServiceEndDate fields:

    from azure.core.credentials import AzureKeyCredential
    from azure.ai.documentintelligence import DocumentIntelligenceClient
    from azure.ai.documentintelligence.models import AnalyzeDocumentRequest
    
    # Replace with your values
    endpoint = "YOUR_ENDPOINT"
    key = "YOUR_KEY"
    
    # Image URL
    form_url = "XXXXXX/invoice_sample.jpg"
    
    # Create client
    client = DocumentIntelligenceClient(endpoint=endpoint, credential=AzureKeyCredential(key))
    
    # Create request object and call with correct argument position
    request = AnalyzeDocumentRequest(url_source=form_url)
    poller = client.begin_analyze_document("prebuilt-invoice", request)
    
    # Get result
    result = poller.result()
    
    # Display results
    # Assuming doc is a Document object from the analysis result
    for idx, doc in enumerate(result.documents):
        print(f"\n-------- Recognizing invoice #{idx + 1} --------")
        
        # Extract and print main fields with their confidence values
        fields_to_print = [
            "VendorName", "VendorAddress", "VendorAddressRecipient",
            "CustomerName", "CustomerId", "CustomerAddress", "CustomerAddressRecipient",
            "InvoiceId", "InvoiceDate", "InvoiceTotal", "DueDate", "PurchaseOrder",
            "BillingAddress", "BillingAddressRecipient", "ShippingAddress", "ShippingAddressRecipient",
            "ServiceStartDate", "ServiceEndDate", "RemittanceAddress", "RemittanceAddressRecipient"
        ]
        
        for field_name in fields_to_print:
            field = doc.fields.get(field_name)
            if field:
                content = getattr(field, 'content', None)
                confidence = getattr(field, 'confidence', None)
                print(f"{field_name.replace('Address', ' Address')}: {content if content else 'Not found'} has confidence: {confidence if confidence else 'Not found'}")
        
        # For invoice items (if present, assuming it's an array)
        items = doc.fields.get("Items")
        if items:
            print("\nInvoice items:")
            for i, item in enumerate(items.value_array):
                print(f"...Item #{i + 1}")
                for item_field_name, item_field in item.items():
                    item_content = getattr(item_field, 'content', None)
                    item_confidence = getattr(item_field, 'confidence', None)
                    print(f"......{item_field_name}: {item_content if item_content else 'Not found'} has confidence: {item_confidence if item_confidence else 'Not found'}")
        
        print("-------------------------------------")
    

    Output: User's image

    I hope this helps. Thank you.

    1 person found this answer helpful.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Joe Roddy 20 Reputation points
    2025-04-15T13:11:51.6733333+00:00

    Thanks for the reply @santoshkc

    The fields started appearing again a few hours after I originally posted this. We're getting them back again, ty so much for the code sample, appreciate your time!


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.