{"title":"Business Central AI resources (preview)","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/ai-dev-tools-resources/","by":"JOP-AL","license":"Copyright (c) Microsoft Corporation. CC BY 4.0, https://creativecommons.org/licenses/by/4.0/; code samples MIT. From https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/ai-dev-tools-resources, MicrosoftDocs/dynamics365smb-devitpro-pb at 828b6ee (2026-11-19). Changed: includes filled in, links to this site, and for agents shortened without dropping a fact.","credit":"Microsoft Corporation, CC BY 4.0","origin":"https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/ai-dev-tools-resources","source":{"name":"Business Central developer and IT pro docs","repo":"https://github.com/MicrosoftDocs/dynamics365smb-devitpro-pb","commit":"828b6ee72fcd75755627cd6011f3d20899217ab2","date":"2026-11-19"},"checked":"2026-11-19","description":"Learn how you can use the developer tools for Copilot in Business Central AI resources in your own Marketplace extensions to create Copilot experiences in Business Central","date":"2026-10-02","meta":{"topic":"article"},"outline":[{"level":1,"title":"Business Central AI resources (preview)","slug":"business-central-ai-resources-preview","at":0,"chars":14084},{"level":2,"title":"Supported models","slug":"supported-models","at":1210,"chars":409},{"level":2,"title":"Benefits of relying on the Business Central AI resources","slug":"benefits-of-relying-on-the-business-central-ai-resources","at":1619,"chars":1178},{"level":2,"title":"Consumption-based customer billing when using Business Central AI resources","slug":"consumption-based-customer-billing-when-using-business-central-ai-resources","at":2797,"chars":2780},{"level":3,"title":"Gracefully handle errors if there is overconsumption","slug":"gracefully-handle-errors-if-there-is-overconsumption","at":4277,"chars":1300},{"level":2,"title":"Use your own subscription with customers","slug":"use-your-own-subscription-with-customers","at":5577,"chars":470},{"level":2,"title":"Differences between Business Central AI resources and custom Azure OpenAI subscriptions","slug":"differences-between-business-central-ai-resources-and-custom-azure-openai-subscriptions","at":6047,"chars":3412},{"level":2,"title":"Mandatory to migrate to newer models as older ones are deprecated","slug":"mandatory-to-migrate-to-newer-models-as-older-ones-are-deprecated","at":9459,"chars":422},{"level":2,"title":"Using the Business Central AI resources and your own subscription in AL","slug":"using-the-business-central-ai-resources-and-your-own-subscription-in-al","at":9881,"chars":1402},{"level":2,"title":"Use your own subscription during development","slug":"use-your-own-subscription-during-development","at":11283,"chars":2267},{"level":3,"title":"Code snippet","slug":"code-snippet","at":12970,"chars":580},{"level":2,"title":"Samples","slug":"samples","at":13550,"chars":179},{"level":2,"title":"Related information","slug":"related-information","at":13729,"chars":355}],"text":"# Business Central AI resources (preview)\n[This article is prerelease documentation and is subject to change.]\nA key feature of the Business Central developer tools for Copilot is that Business Central partners can use Large Language Models (LLMs) via Microsoft-managed Azure OpenAI resources for their Marketplace extensions that extend Copilot in Business Central. This approach eliminates the need to independently procure and manage Azure OpenAI subscriptions for customers.\nUsing the Business Central AI resources is the default and recommended approach.\nIn certain cases, partners or customers might need to use their own Azure OpenAI (AOAI) subscription for production environments, or when developing and testing in sandbox environments. Business Central developer tools for Copilot fully support this option when specific requirements make it necessary.\n> IMPORTANT\n > This is a preview feature.\n > Preview features aren't meant for production use and might have restricted functionality. These features are subject to supplemental terms of use<https://go.microsoft.com/fwlink/?linkid=2189520>, and are available before an official release so that customers can get early access and provide feedback.\n## Supported models\nThe following Azure OpenAI models are supported when using the Business Central developer tools for Copilot and Business Central AI resources.\nAzure OpenAI model|Supported\nGPT-4.1|Yes\nGPT-4.1-mini|Yes\nYou can read more about each of the models here Azure OpenAI Models<https://learn.microsoft.com/azure/ai-services/openai/concepts/models?tabs=global-standard%2Cstandard-chat-completions>.\n## Benefits of relying on the Business Central AI resources\nUsing the AI resources provides several benefits, including:\n Reduced operational overhead\nAvoid the need to handle infrastructure management, updates, monitoring, troubleshooting, or maintenance of custom Azure OpenAI subscriptions, freeing up resources to focus on core business operations and providing value-adding IP to customers.\n Simplified onboarding\nQuickly integrate AI capabilities into your solutions without having to navigate the complexities of setting up and managing your own Azure OpenAI subscription.\n Improved reliability\nProactive scaling, throttling, load balancing, and fault tolerance measures, ensuring consistent performance during peak demand.\n Enhanced security compliance\nBuilt-in compliance measures and governance, including robust protection from malicious and harmful content, ensuring compliance with data residency requirements, reducing the burden of ensuring regulatory compliance for ISVs.\n Streamlined experience for customers\nCustomers experience a more seamless AI resource management process, avoiding the need to maintain different configurations for separate ISV solutions.\n## Consumption-based customer billing when using Business Central AI resources\nBy using the Business Central AI resources, you can deliver a cohesive AI consumption tracking and billing experience for Business Central customers. Customers who use AI resources across multiple AI-enabled solutions built with Business Central developer tools for Copilot benefit from a unified approach to AI consumption monitoring and invoicing, thereby they avoid the need to reconcile multiple invoices or metrics from separate ISVs.\nThis allows customers to:\n Track AI consumption at a granular level, per Copilot feature.\n Receive a consolidated invoice for AI consumption.\nBusiness Central AI resources are billed in alignment with Copilot Studio message billing, and follow the AI Tools rates, that depends on the underlying language model of the Copilot feature prompts.\nBusiness Central AI resources model|AI Tools rate\nGPT-4.1|Standard\nGPT-4.1-mini|Basic\nLearn more about the rates under AI Tools in Billing rates and management<https://learn.microsoft.com/microsoft-copilot-studio/requirements-messages-management#message-scenarios>\n> NOTE\n> It's important to note that the AI billing model isn't intended to replace the existing Marketplace monetization pathway for Business Central apps. Instead, it serves as another option to simplify AI consumption for customers and partners, with the Marketplace monetization option available to ISVs to monetize their intellectual property (IP).\n### Gracefully handle errors if there is overconsumption\nWhen using Business Central AI resources, developers can easily react and handle cases of overconsumption. Overconsumption can happen, for example, when the customer provides nonvalid billing information, or when a user is using AI resources too fast.\nTo identify and handle these scenarios, developers can use the codeunit `AOAI Operation Response`, which is returned when using the Business Central developer tools for Copilot.\nHere are some examples of using an instance of `AOAI Operation Response` to identify errors related to AI consumption.\nAL code check|scenario\n`AOAIOperationResponse.IsSuccess()`|The operation was successful and no more error handling is needed.\n`AOAIOperationResponse.GetStatusCode() = 402`|The operation wasn't successful because the current Microsoft Entra tenant ran out of AI resources and has no valid billing setup.\n`AOAIOperationResponse.GetStatusCode() = 429`|The current user is issuing requests to Copilot too fast. This can be an indication of automations or scheduled tasks that the user isn't aware of. This error disappears after a few seconds.\n`AOAIOperationResponse.GetStatusCode() = 503`|The Business Central backend is temporarily unavailable; this is a rare occurrence and typically transient.\n## Use your own subscription with customers\nFor most ISVs, the default Business Central AI resources are enough, However, if you have needs that aren't fulfilled with the Business Central AI resources, such as specific models including fine-tuned ones, you can bring your own (BYO) subscription to customers. If that's the case, the ISV is responsible for the deployment, maintenance, scaling, and security of the service - and the billing of AI resources to customers.\n## Differences between Business Central AI resources and custom Azure OpenAI subscriptions\nBy using the Business Central developer tools for Copilot, partners can easily get access to AI resources when they extend Copilot in Business Central.\nBusiness Central AI resources are identical to those used in base application Copilot features and are the recommended default option. Partners, however, might sometimes need to use their own or customer-owned Azure OpenAI subscription in production environments when they have specific requirements. The following section provides an overview of the major differences between using the AI resources in the toolkit and using your own Azure OpenAI subscription and model deployment.\n<br><br>\nArea|Business Central AI resources|Your own AOAI subscription\nDeployment|Microsoft manages the AI resources. <br><br>We ask you to have an active Azure OpenAI subscription for sign-up, but no model.|You must handle deploying models, keep them up to date, set up Azure subscriptions, take care of geography and data residency, etc. <br><br>You're charged for deployed models even if they aren't used.\nModel support|Production-ready models available (today GPT-4.1, GPT-4.1 mini and their preview equivalent, more in the future). <br><br> Get notified via developer telemetry when new models are coming, and old models are obsoleted. Observe that when models are no longer supported, partners are accountable for migrating to newer models and model versions as dictated by Microsoft within communicated SLA.<br><br>Embeddings aren't yet available.|All Azure OpenAI models are available. <br><br>Follow Azure OpenAI model deprecation timelines. <br><br>Embeddings and fine tuning are available depending on your model.\nResponsible AI|Azure OpenAI content filters predefined by Business Central. <br><br>Microsoft automatically appends safeguard prompts to your system prompt that increase protection against typical harms such as generation of harmful content and prompt injection attacks.|Azure OpenAI content filters, configurable by you. <br><br>Microsoft automatically appends safeguard prompts to your system prompt that increase protection against typical harms such as generation of harmful content and prompt injection attacks in Saas\nEnvironments|SaaS only|Can be used in SaaS, and for testing in containers.\nBilling|Microsoft charges the customer when they use AI. <br><br> Customers can track usage, set limits, and get a single, detailed invoice across Copilot features that use the toolkit AI resources. <br><br>You charge the customer for your IP.|You must track billing, split billing if multiple customers share the same subscription, manage spending limits, provide usage statistics etc.\nGeographic availability|AI model endpoints are available in limited Azure geographies, managed by Microsoft, that might change over time. You can find the list of currently supported Azure geos /ai-copilot-data-movement#how-data-movement-across-geographies-works. <br><br> Customer environments in all other geos connect to endpoints in the US and are managed by the data governance controls provided to administrators in Business Central.|Availability follows the general availability of the chosen model in Azure OpenAI. See Azure OpenAI Models<https://learn.microsoft.com/azure/ai-services/openai/concepts/models?tabs=global-standard%2Cstandard-chat-completions> for more.\n## Mandatory to migrate to newer models as older ones are deprecated\nModels evolve and are replaced over time. By using the Business Central AI resources, partners are accountable for migrating to newer models and model versions as dictated by Microsoft within the communicated SLA. Failure to do so can lead to Copilot features using the deprecated model in Business Central AI resources to no longer work in production.\n## Using the Business Central AI resources and your own subscription in AL\nThe default and recommended approach is to use the developer toolkit AI resources when extending Copilot in Business Central. All you need to do is to authenticate with the SetManagedResourceAuthorization method in the AI Module AzureOpenAI<https://learn.microsoft.com/dynamics365/business-central/application/system-application/codeunit/system.ai.azure-openai> codeunit.\n```al\n// Example of using the default toolkit AI resources in AL\nAzureOpenAI.SetManagedResourceAuthorization(Enum::\"AOAI Model Type\"::\"Chat Completions\", AOAIDeployments.GetGPT41Latest());\n```\nView more examples in BCTech samples<https://github.com/microsoft/BCTech/tree/master/samples/AzureOpenAI>.\n> NOTE\n> The previous signature of SetManagedResourceAuthorization that required AzureOpenAIAccountName and AzureOpenAIApiKey parameters is obsolete. Partners no longer need to provide their own Azure OpenAI subscription details when using the Business Central AI resources.\nIf you instead want to use your own subscription, whether for a customer, or just when you develop or test, you must authenticate with your own subscription using the SetAuthorization method.\n```al\n// Example of using your own Azure OpenAI subscription in AL\nAzureOpenAI.SetAuthorization(Enum::\"AOAI Model Type\"::\"Chat Completions\",GetEndpoint(),GetDeployment(),GetApiKey());\n```\n## Use your own subscription during development\nThe Business Central AI resources can only be used in customer production environments. Therefore, it's recommended that partners create and use their own Azure OpenAI subscriptions as part of noncustomer usage, for example, when prototyping, developing, testing, and supporting AI capabilities.\n> NOTE\n> You must have an Azure subscription in order to use the AI development toolkit in Business Central. If you don't have the Azure subscription, you might not use the AI development toolkit in Business Central. Azure OpenAI Service is made available to customers under the terms governing their subscription to Microsoft Azure Services, including Product Terms such as the Universal License Terms applicable to Microsoft Generative AI Services and the product offering terms for Azure OpenAI. Review these terms carefully as they contain important conditions and obligations governing your use of Azure OpenAI Service. Unless otherwise indicated in the service, all Azure customers are eligible for access to Azure OpenAI models, and all uses consistent with the Product Terms and Code of Conduct are permitted. If you're using the AI development toolkit in Business Central to develop features that run on managed AI resources, you should enable app/extension-level telemetry, so we can directly communicate the underlying AI model changes to you in a timely manner.\nThe Business Central developer tools for Copilot easily allow conditionally branching on the Azure OpenAI subscription used, for example, using the Business Central AI resources when running in customer environments and a custom Azure OpenAI subscription for the rest.\n### Code snippet\nThe following code snippet demonstrates how to use the EnvironmentInformation to use a custom Azure OpenAI subscription during prototyping, developing, and testing, and the Business Central AI resources in customers production environments.\n```al\nIf not EnvironmentInformation.IsSaaSInfrastructure() then\n    AzureOpenAI.SetAuthorization(Enum::\"AOAI Model Type\"::\"Chat Completions\",GetEndpoint(),GetDeployment(),GetApiKey());\nelse\n    AzureOpenAI.SetManagedResourceAuthorization(Enum::\"AOAI Model Type\"::\"Chat Completions\", AOAIDeployments.GetGPT41Latest());\n```\n## Samples\nYou can find further AL code examples on using and calling LLM resources on https://aka.ms/BCTech<https://github.com/microsoft/BCTech/tree/master/samples/AzureOpenAI>.\n## Related information\nIntegrating AI using Developer Tools for Copilot<https://learn.microsoft.com/dynamics365/business-central/dev-itpro/developer/ai-integration-landing-page>\nTransparency note: Developer tools for Copilot in Business Central<https://learn.microsoft.com/dynamics365/business-central/dev-itpro/ai/transparency-note-dev-tools-for-copilot>"}