class_docstr: A component for converting files to Documents using Azure's Document Intelligence service.
  Supported file formats are: PDF, JPEG, PNG, BMP, TIFF, DOCX, XLSX, PPTX, and HTML.
  
  In order to be able to use this component, you need an active Azure account
  and a Document Intelligence or Cognitive Services resource. Please follow the steps described in the
  [Azure documentation](https://learn.microsoft.com/en-us/azure/ai-services/document-intelligence/quickstarts/get-started-sdks-rest-api)
  to set up your resource.
  
  Usage example:
  ```python
  from haystack.components.converters.azure import AzureOCRDocumentConverter
  
  converter = AzureOCRDocumentConverter()
  results = converter.run(sources=["image-based-document.pdf"], meta={"date_added": datetime.now().isoformat()})
  documents = results["documents"]
  print(documents[0].content)
  # 'This is a text from the PDF file.'
  ```
class_docstr_tok: ["A","component","for","converting","files","to","Documents","using","Azure","'s","Document","Intelligence","service",".","Supported","file","formats","are",":","PDF",",","JPEG",",","PNG",",","BMP",",","TIFF",",","DOCX",",","XLSX",",","PPTX",",","and","HTML",".","In","order","to","be","able","to","use","this","component",",","you","need","an","active","Azure","account","and","a","Document","Intelligence","or","Cognitive","Services","resource",".","Please","follow","the","steps","described","in","the","[","Azure","documentation","]","(","https",":","\/\/learn.microsoft.com\/en-us\/azure\/ai-services\/document-intelligence\/quickstarts\/get-started-sdks-rest-api",")","to","set","up","your","resource",".","Usage","example",":","``","`","python","from","haystack.components.converters.azure","import","AzureOCRDocumentConverter","converter","=","AzureOCRDocumentConverter","(",")","results","=","converter.run","(","sources=","[","``","image-based-document.pdf","''","]",",","meta=","{","``","date_added","''",":","datetime.now","(",")",".isoformat","(",")","}",")","documents","=","results","[","``","documents","''","]","print","(","documents","[","0","]",".content",")","#","'This","is","a","text","from","the","PDF","file",".","'","``","`"]
docstr: Create an AzureOCRDocumentConverter component.
  
  :param endpoint: The endpoint of your Azure resource.
  :param api_key: The key of your Azure resource. It can be
  explicitly provided or automatically read from the
  environment variable AZURE_AI_API_KEY (recommended).
  :param model_id: The model ID of the model you want to use. Please refer to [Azure documentation](https://learn.microsoft.com/en-us/azure/ai-services/document-intelligence/choose-model-feature)
      for a list of available models. Default: `"prebuilt-read"`.
docstr_tok: ["Create","an","AzureOCRDocumentConverter","component",".",":","param","endpoint",":","The","endpoint","of","your","Azure","resource",".",":","param","api_key",":","The","key","of","your","Azure","resource",".","It","can","be","explicitly","provided","or","automatically","read","from","the","environment","variable","AZURE_AI_API_KEY","(","recommended",")",".",":","param","model_id",":","The","model","ID","of","the","model","you","want","to","use",".","Please","refer","to","[","Azure","documentation","]","(","https",":","\/\/learn.microsoft.com\/en-us\/azure\/ai-services\/document-intelligence\/choose-model-feature",")","for","a","list","of","available","models",".","Default",":","`","``","prebuilt-read","''","`","."]
code: def __init__(
      self,
      endpoint: str,
      api_key: Optional[str] = None,
      model_id: str = "prebuilt-read",
  ):
      """
      Create an AzureOCRDocumentConverter component.
  
      :param endpoint: The endpoint of your Azure resource.
      :param api_key: The key of your Azure resource. It can be
      explicitly provided or automatically read from the
      environment variable AZURE_AI_API_KEY (recommended).
      :param model_id: The model ID of the model you want to use. Please refer to [Azure documentation](https://learn.microsoft.com/en-us/azure/ai-services/document-intelligence/choose-model-feature)
          for a list of available models. Default: `"prebuilt-read"`.
      """
      azure_import.check()
  
      api_key = api_key or os.environ.get("AZURE_AI_API_KEY")
      # we check whether api_key is None or an empty string
      if not api_key:
          msg = (
              "AzureOCRDocumentConverter expects an API key. "
              "Set the AZURE_AI_API_KEY environment variable (recommended) or pass it explicitly."
          )
          raise ValueError(msg)
  
      self.document_analysis_client = DocumentAnalysisClient(
          endpoint=endpoint, credential=AzureKeyCredential(api_key)
      )
      self.endpoint = endpoint
      self.model_id = model_id
  
file_path: haystack/haystack/components/converters/azure.py
imports: from pathlib import Path
  from typing import List, Union, Dict, Any, Optional
  import logging
  import os
  from haystack.lazy_imports import LazyImport
  from haystack import component, Document, default_to_dict
  from haystack.dataclasses import ByteStream
  from haystack.components.converters.utils import get_bytestream_from_source, normalize_metadata
label_desc: Use image node_id 1 to create a new AzureOCRDocumentConverter object  with example: obj = AzureOCRDocumentConverter(endpoint, api_key, model_id)