---
id: object/codeunit/2020
type: object
title: Codeunit 2020 "Image Analysis Management"
summary: Codeunit 2020 "Image Analysis Management" in Base Application (System.AI). 24 public procedures, 3 events. Present since at least BC23, still in BC30, changed in BC24, BC27.
tier: official
language: en
tags:
  - codeunit
  - base application
versions:
  introduced: null
  last_changed: "27"
  deprecated: null
review:
  state: derived
  by: null
  at: null
  flags: []
generated:
  at: "2026-10-11T00:31:51.816Z"
  pipeline: 0.2.0
  prompts: {}
  input_hash: 90a45263f73630a9b79d3d4cb030ccb958c0b66ca2fa68e16ba42dd8511363ae
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Layers/W1/BaseApp/System/AI/ImageAnalysis/ImageAnalysisManagement.Codeunit.al
    title: src/Layers/W1/BaseApp/System/AI/ImageAnalysis/ImageAnalysisManagement.Codeunit.al (releases/29.x)
    date: null
    commit: ea08af5ef2d6a9b5c5af4a029288abbe2c883220
    t: null
    quote: null
links:
  learn: []
  objects: []
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
object_type: codeunit
object_id: 2020
name: Image Analysis Management
namespace: System.AI
app: Base Application
extends: null
first_version: "23"
last_version: "30"
present_in:
  - "23"
  - "24"
  - "25"
  - "26"
  - "27"
  - "28"
  - "29"
  - "30"
changed_in:
  - "24"
  - "27"
source_major: "29"
obsolete: null
countries: []
ms_search_form_ids: []
counts:
  fields: 0
  procedures: 31
  events: 3
  subscribers: 0
relations:
  out: 0
  referenced_by: 0
  pages: 0
  extended_by: 0
  event_subscribers: 2
  calls: 5
  called_by: 5
  implements: 0
---

# Codeunit 2020 "Image Analysis Management"

> Codeunit 2020 "Image Analysis Management" in Base Application (System.AI). 24 public procedures, 3 events. Present since at least BC23, still in BC30, changed in BC24, BC27.

Base Application · System.AI · BC23-30 · [source at ea08af5e](https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Layers/W1/BaseApp/System/AI/ImageAnalysis/ImageAnalysisManagement.Codeunit.al) · facts from BC29

## Events published

- `OnBeforeImageAnalysis()` (integration)
  - subscribers: [Codeunit 2002 "Azure AI Tracing"](../codeunit/2002.md) TraceImageAnalysisStart
- `OnAfterImageAnalysis(ImageAnalysisResult: Codeunit "Image Analysis Result")` (integration)
  - subscribers: [Codeunit 2002 "Azure AI Tracing"](../codeunit/2002.md) TraceImageAnalysisEnd
- `OnBeforeSendImageAnalysisRequest(HttpContent: HttpContent; RequestUrl: Text; var HttpStatusCode: Integer; var HttpResponseContentText: Text; var Handled: Boolean)` (internal)

## Procedures

- `Initialize()`
- `Initialize(InputImageAnalysisProvider: Enum "Image Analysis Provider")`
- `SetMedia(MediaId: Guid)`
- `SetImagePath(Path: Text)`
- `SetBlob(TempBlob: Codeunit "Temp Blob")`
- `SetUriAndKey(UriValue: Text; KeyValue: SecretText)`
- `SetLimitInYears(Value: Integer)`
- `SetLimitInMonths(Value: Integer)`
- `SetLimitInDays(Value: Integer)`
- `SetLimitInHours(Value: Integer)`
- `AnalyzeTags(var ImageAnalysisResult: Codeunit "Image Analysis Result"): Boolean`
- `AnalyzeColors(var ImageAnalysisResult: Codeunit "Image Analysis Result"): Boolean`
- `AnalyzeFaces(var ImageAnalysisResult: Codeunit "Image Analysis Result"): Boolean`
- `Analyze(var ImageAnalysisResult: Codeunit "Image Analysis Result"; AnalysisType: Enum "Image Analysis Type"): Boolean`
- `Analyze(var ImageAnalysisResult: Codeunit "Image Analysis Result"; AnalysisTypes: List of [Enum "Image Analysis Type"]): Boolean`
- `SetHttpMessageHandler(NewHttpMessageHandler: DotNet HttpMessageHandler)`
- `GetLastError(var Message: Text; var IsUsageLimitError: Boolean): Boolean`
- `GetTelemetryCategory(): Text`
- `GetNoImageErr(): Text`
- `HasError(): Boolean`
- `GetLimitParams(var LimitTypeOut: Option Year,Month,Day,Hour; var LimitValueOut: Integer)`
- `IsCurrentUserLanguageSupported(AnalysisTypes: List of [Enum "Image Analysis Type"]): Boolean`
- `GetImageAnalysisCredentials(var ApiKey: SecretText; var ApiUri: Text; var LocalLimitType: Option; var LocalLimitValue: Integer)`
- `ToCommaSeparatedList(ImageAnalysisTypes: List of [Enum "Image Analysis Type"]): Text` (internal)

Plus 4 local procedures.

## Calls

From the extracted call graph of BC29 (graphify-al on the snapshot checkout): calls whose target is known from a declared type or an `Object::"Name"` argument. Interface dispatch and calls through events are not counted, so the list is not complete.

- [Codeunit 419 "File Management"](../codeunit/419.md) (4 calls: `SetBlob → BLOBExportToServerFile`, `SetBlob → ServerTempFileName`, `SetImagePath → IsAllowedPath`, …)
- [Codeunit 2200 "Azure Key Vault"](../codeunit/2200.md) (3 calls: `GetImageAnalysisCredentials → GetAzureKeyVaultSecret`, `TryAcquireOAuth2Token → GetAzureKeyVaultCertificate`, `TryAcquireOAuth2Token → GetAzureKeyVaultSecret`)
- [Codeunit 2004 "Machine Learning KeyVaultMgmt."](../codeunit/2004.md) (2 calls: `GetImageAnalysisCredentials → GetLimitTypeOptionFromText`, `TryAcquireOAuth2Token → GetLimitTypeOptionFromText`)
- [Codeunit 2024 "Image Analysis Wrapper V1.0"](../codeunit/2024.md) (1 call: `SetHttpMessageHandler → SetHttpMessageHandler`)
- [Codeunit 501 "OAuth2"](../codeunit/501.md) (1 call: `TryAcquireOAuth2Token → AcquireTokensWithCertificate`)

## Called by

- [Codeunit 7499 "Item From Picture"](../codeunit/7499.md) (8 calls: `AnalyzeImage → Analyze`, `AnalyzeImage → GetLastError`, `AnalyzeImage → GetLimitParams`, …)
- [Codeunit 2027 "Image Analyzer Ext. Mgt."](../codeunit/2027.md) (7 calls: `AnalyzePicture → AnalyzeFaces`, `AnalyzePicture → AnalyzeTags`, `AnalyzePicture → GetLastError`, …)
- [Codeunit 2023 "Image Analysis Wrapper V3.2"](../codeunit/2023.md) (4 calls: `BuildUri → ToCommaSeparatedList`, `IsMediaSupported → GetTelemetryCategory`, `LogCorrelationToTelemetry → GetTelemetryCategory`, …)
- [Codeunit 2002 "Azure AI Tracing"](../codeunit/2002.md) (2 calls: `TraceImageAnalysisEnd → GetLastError`, `TraceImageAnalysisEnd → GetLimitParams`)
- [Codeunit 2005 "Azure AI Usage Impl."](../codeunit/2005.md) (1 call: `GetSingleInstance → GetImageAnalysisCredentials`)

## Across versions

- Present in: BC23-30
- Changed (declaration) in: BC24, BC27

Source: AL metadata extracted from the code (names, ids, signatures, properties); no code bodies (D10).

## Ask your agent

Procedure bodies are not stored here (D10). The call sections above are our own, per object, from the BC29 call graph. For a procedure body or the calls of one procedure, ask bc-code-atlas (external, by Stefan Maron, MIT; default corpus w1-28), which the bc-observatory plugin connects: `bcatlas_resolve_node(object_type: "codeunit", object_name: "Image Analysis Management")`, then `bcatlas_get_procedure_body` or `bcatlas_get_neighbors` on the returned id.
