Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Note
Azure AI Search is available through the Azure portal, REST APIs, and Azure SDKs. It also underpins Foundry IQ, the managed knowledge layer that transforms enterprise content into reusable, permission-aware knowledge bases for agents in the Microsoft Foundry portal.
The optical character recognition (OCR) skill recognizes printed and handwritten text in image files. This article is the reference documentation for the OCR skill. See Extract text from images for usage instructions.
Azure AI Search is updating OCR processing to use Azure Document Intelligence in Foundry Tools. The update uses its Read model (prebuilt-read) through the Document Intelligence REST API, version 2024-11-30 (generally available). Processing uses the Document Models Analyze Document operation.
Previously, OCR processing used Azure Vision in Foundry Tools. Its v3.2 GA Read API receives no further updates, and Microsoft recommends Document Intelligence Read for document OCR.
The official Azure Vision Image Analysis retirement notice sets September 25, 2028 as the retirement date for Image Analysis. The Azure AI Search OCR skill isn't retiring as part of this update. Azure AI Search manages the OCR backend service update to Document Intelligence Read.
Sometime after November 5, 2026, OCR processing is expected to be billed as Document Intelligence usage instead of Azure Vision usage. The timing depends on when the update reaches your search service.
You don't need to migrate your environment, replace your attached Foundry resource, or change your existing OCR skill configuration. The skill type, image inputs, and text and layoutText output structures remain unchanged. No Azure AI Search REST API version or SDK upgrade is required.
The OCR skill extracts text from image files and embedded images. Supported file formats include:
- .JPEG
- .JPG
- .PNG
- .BMP
- .TIFF
Supported data sources for OCR and image analysis are blobs in Azure Blob Storage and Azure Data Lake Storage (ADLS) Gen2, and image content in Microsoft OneLake. Images can be standalone files or embedded images in a PDF or other files.
Note
This skill is bound to Foundry Tools. It requires a billable resource for transactions that exceed 20 documents per indexer per day. For current OCR processing rates, see Document Intelligence pricing.
In addition, image extraction is billable by Azure AI Search.
Skill parameters
Parameters are case sensitive.
| Parameter name | Description |
|---|---|
detectOrientation |
Retained for compatibility with existing skill definitions. Valid values are true or false. This parameter applies only to the legacy OCR version 3.2 API. |
defaultLanguageCode |
Language code of the input text. Supported languages include all of the generally available languages of Azure Vision. You can also specify unk (Unknown). If the language code is unspecified or null, the language is set to English. If the language is explicitly set to unk, all languages found are auto-detected and returned. |
lineEnding |
The value to use as a line separator. Possible values: "Space", "CarriageReturn", "LineFeed". The default is "Space". |
In previous versions, the textExtractionAlgorithm parameter selected printed or handwritten text. This parameter is deprecated because the skill recognizes both types without it. You don't need to remove it from an existing skill definition, but it isn't used during execution.
Skill inputs
| Input name | Description |
|---|---|
image |
Complex Type. Currently only works with "/document/normalized_images" field, produced by the Azure blob indexer when imageAction is set to a value other than none. |
Skill outputs
| Output name | Description |
|---|---|
text |
Plain text extracted from the image. |
layoutText |
Complex type that describes the extracted text and the location where the text was found. |
If you call OCR on images embedded in PDFs or other application files, the OCR output will be located at the bottom of the page, after any text that was extracted and processed.
Sample definition
{
"skills": [
{
"description": "Extracts text (plain and structured) from image.",
"@odata.type": "#Microsoft.Skills.Vision.OcrSkill",
"context": "/document/normalized_images/*",
"defaultLanguageCode": null,
"detectOrientation": true,
"inputs": [
{
"name": "image",
"source": "/document/normalized_images/*"
}
],
"outputs": [
{
"name": "text",
"targetName": "myText"
},
{
"name": "layoutText",
"targetName": "myLayoutText"
}
]
}
]
}
Sample text and layoutText output
{
"text": "Hello World. -John",
"layoutText":
{
"language" : "en",
"text" : "Hello World. -John",
"lines" : [
{
"boundingBox":
[ {"x":10, "y":10}, {"x":50, "y":10}, {"x":50, "y":30},{"x":10, "y":30}],
"text":"Hello World."
},
{
"boundingBox": [ {"x":110, "y":10}, {"x":150, "y":10}, {"x":150, "y":30},{"x":110, "y":30}],
"text":"-John"
}
],
"words": [
{
"boundingBox": [ {"x":110, "y":10}, {"x":150, "y":10}, {"x":150, "y":30},{"x":110, "y":30}],
"text":"Hello"
},
{
"boundingBox": [ {"x":110, "y":10}, {"x":150, "y":10}, {"x":150, "y":30},{"x":110, "y":30}],
"text":"World."
},
{
"boundingBox": [ {"x":110, "y":10}, {"x":150, "y":10}, {"x":150, "y":30},{"x":110, "y":30}],
"text":"-John"
}
]
}
}
Sample: Merging text extracted from embedded images with the content of the document
Document cracking, the first step in skillset execution, separates text and image content. A common use case for Text Merger is merging the textual representation of images (text from an OCR skill, or the caption of an image) into the content field of a document. This is for scenarios where the source document is a PDF or Word document that combines text with embedded images.
The following example skillset creates a merged_text field. This field contains the textual content of your document and the OCRed text from each of the images embedded in that document.
Request Body Syntax
{
"description": "Extract text from images and merge with content text to produce merged_text",
"skills":
[
{
"description": "Extract text (plain and structured) from image.",
"@odata.type": "#Microsoft.Skills.Vision.OcrSkill",
"context": "/document/normalized_images/*",
"defaultLanguageCode": "en",
"detectOrientation": true,
"inputs": [
{
"name": "image",
"source": "/document/normalized_images/*"
}
],
"outputs": [
{
"name": "text"
}
]
},
{
"@odata.type": "#Microsoft.Skills.Text.MergeSkill",
"description": "Create merged_text, which includes all the textual representation of each image inserted at the right location in the content field.",
"context": "/document",
"insertPreTag": " ",
"insertPostTag": " ",
"inputs": [
{
"name":"text",
"source": "/document/content"
},
{
"name": "itemsToInsert",
"source": "/document/normalized_images/*/text"
},
{
"name":"offsets",
"source": "/document/normalized_images/*/contentOffset"
}
],
"outputs": [
{
"name": "mergedText",
"targetName" : "merged_text"
}
]
}
]
}
The above skillset example assumes that a normalized-images field exists. To generate this field, set the imageAction configuration in your indexer definition to generateNormalizedImages as shown below:
{
//...rest of your indexer definition goes here ...
"parameters": {
"configuration": {
"dataToExtract":"contentAndMetadata",
"imageAction":"generateNormalizedImages"
}
}
}