-
Notifications
You must be signed in to change notification settings - Fork 317
Description
Describe the issue
The System Application Azure OpenAI integration uses a hardcoded API version 2024-06-01 that cannot be configured or overridden by developers. This prevents Business Central extensions from using:
- Latest GPT-4o models (require API version
2024-12-01-previewor later) - o1-series reasoning models (o1-mini, o1-preview, o1)
- Azure AI Foundry endpoints (
*.inference.ml.azure.com) - New content filter policies and API features
Code Location: System Application 27.0, Codeunit 7767 "AOAI Authorization"
UrlFormatTxt: Label 'https://%1.openai.azure.com/openai/models?api-version=2024-06-01', Locked = true;The codeunit is marked Access = Internal, the procedure is local, and the label is Locked = true, making it impossible to extend or override from AL code.
Critical Compatibility Gap (January 2026):
Models compatible with API version 2024-06-01 (gpt-35-turbo, gpt-4 turbo-2024-04-09) have been deprecated/retired as of September 2025. New models require API versions that BC doesn't support, creating a blocker for AI development.
Expected behavior
Business Central should support modern Azure OpenAI deployments through one of these approaches:
Option 1: Update API Version
Update the hardcoded API version to the latest stable version (2024-10-21 or newer) to support current model generations.
Option 2: Make API Version Configurable (Preferred)
Add a public method to allow developers to specify the API version:
procedure SetApiVersion(ApiVersion: Text)This would provide backward compatibility while enabling access to latest features without waiting for platform updates.
Option 3: Support Multiple Endpoint Formats
Allow Azure AI Foundry and legacy endpoint formats in addition to the current .openai.azure.com restriction.
Steps to reproduce
-
Create Azure OpenAI Resource:
- Navigate to Azure Portal
- Create Azure OpenAI Service resource
- Deploy model:
gpt-4o(version 2024-11-20) oro1-mini - Note the endpoint URL and deployment name
-
Configure Business Central:
- Create AL extension using System Application Azure OpenAI codeunits
- Use
SetAuthorization()with endpoint, deployment name, and API key - Set capability with
SetCopilotCapability()
-
Attempt API Call:
AOAIChatMessages.AddSystemMessage('Test'); AOAIChatMessages.AddUserMessage('Hello'); AzureOpenAI.GenerateChatCompletion(AOAIChatMessages, AOAIChatCompletionParams, AOAIOperationResponse);
-
Observe Result:
- Status Code: 400
- Error: "invalid content filter policy" or similar API version incompatibility error
-
Verification with Python SDK:
# Same Azure resource, deployment, and API key with api_version="2024-12-01-preview" # Result: Works successfully
The issue is confirmed to be the hardcoded API version, not deployment configuration.
Additional context
Environment:
- Business Central: 27.0.38460.44704 (also affects earlier versions)
- System Application: 27.0.0.0
- Deployment: Both SaaS and On-Premises
- Azure OpenAI: All regions
Microsoft Documentation:
- Model Retirements: https://learn.microsoft.com/en-us/azure/ai-foundry/openai/concepts/model-retirements
- Latest stable API version:
2024-10-21 - Preview API version:
2024-12-01-preview - v1 API (August 2025): No api-version required, uses
/openai/v1/path
Source Code Reference (Verified):
- Repository: microsoft/BCApps
- File:
src/System Application/App/AI/src/Azure OpenAI/AOAIAuthorization.Codeunit.al - Line 168:
UrlFormatTxt: Label 'https://%1.openai.azure.com/openai/models?api-version=2024-06-01', Locked = true; - Codeunit 7767 marked
Access = Internal - Procedure
PerformAOAIAccountVerificationislocal
I will provide a fix for a bug
- I will provide a fix for a bug