Share via

Azure Document Intelligence - Model Training - InternalServerError: An unexpected error occurred.

Dean Parker 21 Reputation points
2026-06-02T15:34:58.0266667+00:00

We are trying to train a Document Intelligence Model in Azure Document Intelligence Studio.

In the past it has worked fine, but now if we try and Train a model we just see this:

InternalServerError: An unexpected error occurred.

There is no other information. What should we do in this situation? Do we need a support ticket or is there any way for customers to see why Model Training does not work?

Azure Document Intelligence in Foundry Tools

Answer accepted by question author

Anshika Varshney 13,405 Reputation points Microsoft External Staff Moderator
2026-06-02T16:35:40.6166667+00:00

Hello @Dean Parker

The InternalServerError: An unexpected error occurred during Azure Document Intelligence custom model training is a known issue with several root causes.

Step-by-Step Troubleshooting

  1. Check Training Data Limits (Most Common Cause)

Your training dataset exceeds the allowed limits

RequirementCustom Extraction Model--------Max Pages500 pages totalMax Size50 MB for all files combinedFile TypesPDF, JPEG, PNG only [stackoverflow]Action: Reduce your training dataset to ≤500 pages and ≤50 MB total.

  1. Check Input File Requirements
  • Password-protected PDFs → Not supported
  • Encrypted files → Remove encryption
  • Corrupted/malformed files → Test with clean documents
  • Overly scanned or high-DPI images → Can slow processing

Action: Test with a small, clean document first (under 5 MB, 10 pages).[stackoverflow]

  1. Verify Labels.json Alignment

Misaligned labels in your training data is a frequent cause:

  • Ensure labels.json matches your document filenames exactly
  • Check that all labeled fields exist in the document
  • Verify no duplicate or conflicting labels
  1. Customer-Managed Keys (CMK) Issue

If using Azure Key Vault for encryption:

  • Verify the Document Intelligence service has proper Key Vault access permissions
  • Temporarily switch to Microsoft-managed keys to isolate encryption-related problems
  1. Try a Different Azure Region

Some users reported regional instability causing this error. Try deploying your resource in a different region.

  1. Train a New Model (Not Update Existing)

Metadata conflicts can occur when updating existing models:

  • Train a new model with a fresh model ID instead of updating
  1. Check Your Tier
  • F0 (Free tier) has strict limitations and may fail with larger datasets
  • S0 (Pay-As-You-Go) is recommended for custom model training

Hope this helps! Let me know which step resolves your issue. Do let me know if you have any further querieds.
Thankyou!

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.