Codeunit 7771 "Azure OpenAI"
System Application · System.AI
Across versions
- BC23present
- BC241 procedures added, 1 procedures changed
- BC251 procedures added
- BC261 procedures changed, 1 procedures added
- BC271 procedures removed
- BC281 procedures changed, 1 procedures added
- BC294 procedures changed, 1 procedures added
- BC30unchanged
Neighbourhood 22 connected objects and pages
System Application · System.AI · BC23-30 · source at ea08af5e · facts from BC29
Properties
| Property | Value |
|---|---|
| Access | Public |
Procedures
IsEnabled(CopilotCapability: Enum "Copilot Capability"): Boolean+ BC25: Checks if the Azure OpenAI API is enabled for the environment and if the capability is active on the environment.IsEnabled(CopilotCapability: Enum "Copilot Capability"; Silent: Boolean): Boolean+ BC25: Checks if the Azure OpenAI API is enabled for the environment and if the capability is active on the environment.IsEnabled(CopilotCapability: Enum "Copilot Capability"; Silent: Boolean; AppId: Guid): Boolean+ BC25: Checks if the Azure OpenAI API is enabled for the environment and if the capability is active on the environment.IsAuthorizationConfigured(ModelType: Enum "AOAI Model Type"): Boolean: Checks if the Azure OpenAI API authorization is configured for the environment.IsInitialized(CopilotCapability: Enum "Copilot Capability"; ModelType: Enum "AOAI Model Type"): Boolean: Checks if the Azure OpenAI API is enabled for the environment and authorization is configured for the modeltype.GetFastPrompt(ConfigKey: Text; var Response: Codeunit "AOAI Fast Prompt Response"): Boolean+ BC29: Resolves fast prompt settings using a configuration key.SetManagedResourceAuthorization(ModelType: Enum "AOAI Model Type"; Endpoint: Text; Deployment: Text; ApiKey: SecretText; ManagedResourceDeployment: Text)+ BC24 Δ BC26 + BC26 Δ BC28 + BC28 (obsolete 26.0: Using Managed AI resources now requires different input parameters. Use the other overload for SetManagedResourceAuthorization instead.): Sets the managed Azure OpenAI API authorization to use for a specific model type. This will send the Azure OpenAI call to the deployment specified in , and will use the other parameters to verify that you have access to Azure OpenAI.SetManagedResourceAuthorization(ModelType: Enum "AOAI Model Type"; AOAIAccountName: Text; ApiKey: SecretText; ManagedResourceDeployment: Text)+ BC24 Δ BC26 + BC26 Δ BC28 + BC28 (obsolete 28.0: Using Managed AI resources now requires only Model Type & Deployment Text as input parameters. Use the other overload for SetManagedResourceAuthorization instead. AOAIAccountName & ApiKey are ignored in the current version of SetManagedResourceAuthorization.): Sets the managed Azure OpenAI API authorization to use for a specific model type. This will send the Azure OpenAI call to the deployment specified in , and will use the other parameters to verify that you have access to Azure OpenAI.SetManagedResourceAuthorization(ModelType: Enum "AOAI Model Type"; ManagedResourceDeployment: Text)+ BC24 Δ BC26 + BC26 Δ BC28 + BC28: Sets the managed Azure OpenAI API authorization to use for a specific model type. This will send the Azure OpenAI call to the deployment specified in , and will use the other parameters to verify that you have access to Azure OpenAI.SetAuthorization(ModelType: Enum "AOAI Model Type"; Endpoint: Text; Deployment: Text; ApiKey: SecretText): Sets the Azure OpenAI API authorization to use for a specific model type and endpoint.SetAuthorization(ModelType: Enum "AOAI Model Type"; Deployment: Text): Sets the Azure OpenAI API authorization to use for a specific model type.GenerateTextCompletion(Prompt: SecretText; var AOAIOperationResponse: Codeunit "AOAI Operation Response"): TextΔ BC29 Δ BC29 Δ BC29 Δ BC29 (obsolete 29.0: Text completion models are retired by Azure OpenAI. Use GenerateChatCompletion instead.): Generates a text completion given a prompt.GenerateTextCompletion(Prompt: SecretText; AOAICompletionParams: Codeunit "AOAI Text Completion Params"; var AOAIOperationResponse: Codeunit "AOAI Operation Response"): TextΔ BC29 Δ BC29 Δ BC29 Δ BC29 (obsolete 29.0: Text completion models are retired by Azure OpenAI. Use GenerateChatCompletion instead.): Generates a completion given a prompt and completion parameters.GenerateTextCompletion(Metaprompt: SecretText; Prompt: SecretText; var AOAIOperationResponse: Codeunit "AOAI Operation Response"): TextΔ BC29 Δ BC29 Δ BC29 Δ BC29 (obsolete 29.0: Text completion models are retired by Azure OpenAI. Use GenerateChatCompletion instead.): Generates a text completion given a prompt.GenerateTextCompletion(Metaprompt: SecretText; Prompt: SecretText; AOAICompletionParams: Codeunit "AOAI Text Completion Params"; var AOAIOperationResponse: Codeunit "AOAI Operation Response"): TextΔ BC29 Δ BC29 Δ BC29 Δ BC29 (obsolete 29.0: Text completion models are retired by Azure OpenAI. Use GenerateChatCompletion instead.): Generates a completion given a prompt and completion parameters.GenerateEmbeddings(Input: SecretText; var AOAIOperationResponse: Codeunit "AOAI Operation Response"): List of [Decimal]: Generates embeddings given an input.GenerateChatCompletion(var AOAIChatMessages: Codeunit "AOAI Chat Messages"; var AOAIOperationResponse: Codeunit "AOAI Operation Response"): Generates a chat completion given a list of chat messages.GenerateChatCompletion(var AOAIChatMessages: Codeunit "AOAI Chat Messages"; AOAIChatCompletionParams: Codeunit "AOAI Chat Completion Params"; var AOAIOperationResponse: Codeunit "AOAI Operation Response"): Generates a chat completion given a list of chat messages and completion parameters.SetCopilotCapability(CopilotCapability: Enum "Copilot Capability"): Sets the copilot capability that the API is running for.
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 7772 “Azure OpenAI Impl” (9 calls:
GenerateChatCompletion → GenerateChatCompletion,GenerateEmbeddings → GenerateEmbeddings,GetFastPrompt → GetFastPrompt, …)
Called by
- Codeunit 324 “No. Series Copilot Impl.” (6 calls:
GenerateAndReviewToolCompletionWithRetry → GenerateChatCompletion,GenerateNoSeries → GenerateChatCompletion,GenerateNoSeries → IsEnabled, …) - Codeunit 4402 “SOA Output Message Setup” (6 calls:
AddSignatureToMessageBody → GenerateChatCompletion,AddSignatureToMessageBody → SetAuthorization,AddSignatureToMessageBody → SetCopilotCapability, …) - Codeunit 7275 “Sales Lines Suggestions Impl.” (5 calls:
AICall → GenerateChatCompletion,AICall → IsEnabled,AICall → SetAuthorization, …) - Codeunit 7330 “Item Subst. Suggestion Impl.” (5 calls:
AICall → GenerateChatCompletion,AICall → IsEnabled,AICall → SetAuthorization, …) - Codeunit 2012 “Entity Text Impl.” (4 calls:
GenerateCompletion → GenerateChatCompletion,GenerateCompletion → SetAuthorization,GenerateCompletion → SetCopilotCapability, …) - Codeunit 7251 “Bank Acc. Rec. Trans. to Acc.” (4 calls:
GetCompletionResponse → GenerateChatCompletion,GetMostAppropriateGLAccountNos → IsEnabled,GetMostAppropriateGLAccountNos → SetAuthorization, …) - Codeunit 4399 “SOA Annotation” (3 calls:
CheckIfMessageRelevant → GenerateChatCompletion,CheckIfMessageRelevant → SetAuthorization,CheckIfMessageRelevant → SetCopilotCapability) - Codeunit 4417 “SOA Item Selector” (3 calls:
TrySelectBestMatchingItems → GenerateChatCompletion,TrySelectBestMatchingItems → SetAuthorization,TrySelectBestMatchingItems → SetCopilotCapability) - Codeunit 4421 “SOA Attachment MLLM” (3 calls:
TryExtractAttachmentContent → GenerateChatCompletion,TryExtractAttachmentContent → SetAuthorization,TryExtractAttachmentContent → SetCopilotCapability) - Codeunit 4596 “SOA Broader Item Search” (3 calls:
AICall → GenerateChatCompletion,AICall → SetAuthorization,AICall → SetCopilotCapability) - Codeunit 6331 “Sustainability Chat Completion” (3 calls:
GenerateChatCompletion → GenerateChatCompletion,GenerateChatCompletion → SetAuthorization,GenerateChatCompletion → SetCopilotCapability) - Codeunit 7774 “Copilot Capability Impl” (2 calls:
GetCopilotCapabilityInfo → IsEnabled,GetCopilotCapabilityStatus → IsEnabled) - Page 6991 “Expense Agent Setup Wizard” (2 calls:
OnOpenPage → IsEnabled,ValidateCapabilityIsEnabled → IsEnabled) - Codeunit 2011 “Entity Text AOAI Settings” (1 call:
IsEnabled → IsEnabled) - Codeunit 4584 “SOA Recovery” (1 call:
RunSOARecovery → IsEnabled) - Codeunit 4586 “SOA Dispatcher” (1 call:
CanRunTask → IsEnabled) - Codeunit 6299 “Sustainability AI” (1 call:
AICall → IsEnabled) - Codeunit 6938 “EA Agent Dispatcher” (1 call:
CanRunTask → IsEnabled) - Page 3304 “Payables Agent Setup” (1 call:
OnOpenPage → IsEnabled) - Page 4350 “Custom Agent Setup” (1 call:
OnOpenPage → IsEnabled) - Page 4400 “SOA Setup” (1 call:
OnOpenPage → IsEnabled)
Recent changes
- 2026-08-20 #9969 Add AL fast prompt interface and wrappers (main, BC30, feature)
- 2026-08-17 #10205 Deprecate Text Completion API in AI SDK (work item 621038) (main, BC30, obsoletion)
Deprecations
- procedure SetManagedResourceAuthorization: Pending 26.0 (#if not CLEAN26), “Using Managed AI resources now requires different input parameters. Use the other overload for SetManagedResourceAuthorization instead.”
- procedure SetManagedResourceAuthorization: Pending 28.0 (#if not CLEAN28), “Using Managed AI resources now requires only Model Type & Deployment Text as input parameters. Use the other overload for SetManagedResourceAuthorization instead. AOAIAccountName & ApiKey are ignored in the current version of SetManagedResourceAuthorization.”
- procedure GenerateTextCompletion: Pending 29.0 (#if not CLEAN29), “Text completion models are retired by Azure OpenAI. Use GenerateChatCompletion instead.”
- procedure GenerateTextCompletion: Pending 29.0 (#if not CLEAN29), “Text completion models are retired by Azure OpenAI. Use GenerateChatCompletion instead.”
- procedure GenerateTextCompletion: Pending 29.0 (#if not CLEAN29), “Text completion models are retired by Azure OpenAI. Use GenerateChatCompletion instead.”
- procedure GenerateTextCompletion: Pending 29.0 (#if not CLEAN29), “Text completion models are retired by Azure OpenAI. Use GenerateChatCompletion instead.”
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: "Azure OpenAI"), then bcatlas_get_procedure_body or bcatlas_get_neighbors on the returned id.