Back when we did the first Integrating AI in Business Central: A Step-By-Step Guide we authenticated to Azure OpenAI and all our work, and costs, were associated with an Azure Subscription. After that post Microsoft and the Business Central team granted us the ability to use the Managed OpenAI Resource associated with Business Central, which is the authentication we use in later examples like Enhancing Business Central with Address Validation AI.

When we authenticate using the Set Authorization procedure, we are telling Business Central to use our Azure OpenAI implementation. The costs will be attributed to the associated subscription.

SetAuthorization(ModelType: Enum “AOAI Model Type”, Endpoint: Text, Deployment: Text, ApiKey: SecretText)

The benefit here is that we control the model deployment as well as the update cadence. We control the location the OpenAI system is running in. We can see the utilization and tune the model in the backend if needed. We can extend it with more data sources if we like. This is our AI Model, and nobody else has access to it.

Alternately, we can authenticate with the Set Managed Resource Authorization procedure. We need to provide an Account Name and API key in order to use the Managed service, which is odd. To quote Microsoft this is “to ensure that the partner is aware of and has accepted Azure OpenAI Service data, privacy and security policies”.

SetManagedResourceAuthorization(ModelType: Enum “AOAI Model Type”, AOAIAccountName: Text, ApiKey: SecretText, ManagedResourceDeployment: Text)

Why go through all the effort of creating an Azure OpenAI instance if you are not going to use it? For one, cost. The Managed Resource is part of your Business Central allotment and is not billed to your Azure Subscription. Secondly, the Azure OpenAI system is maintained and optimized by Microsoft. If you don’t have the time or inclination to monitor and maintain your Azure OpenAI system this is great. The final reason to use the Managed Resource over your own is Grounded Bing Search.

When you ask a question to an OpenAI chat system, you aren’t getting the latest information. My GPT 4o only knows things up to 11/20/2024. If I ask it for details like the current weather or news events it provides generic answers and points me to a relevant site for up-to-date information.

Prompt: What is the weather in New Hampshire?

Response: I currently cannot access real-time data, such as the current weather in New Hampshire. However, you can check the latest weather conditions by visiting a reliable weather website, such as [Weather.com](https://weather.com) or the [National Weather Service](https://www.weather.gov/), or by using a weather app on your phone.  
  
Let me know if you'd like help with anything else!

What Grounded Bing Search does is provide the ability for the OpenAI Agent to utilize a search engine to supplement its response.

Now you can add this to an OpenAI instance. But it is complex, increases the cost, and the stock Business Central objects for OpenAI don’t have the ability to connect to it, so you will need to write your own interface layer. This is a lot of additional work.

Microsoft released an update to Business Centrals AI capabilities, including Searching the web with Copilot. It so turns out that if you enable this feature, and use the Managed Resource, you also get Grounded Bing Search capabilities!

With this activated, a question about the weather will return details about the current weather conditions. It seamlessly integrates search results with AI generated text. I have a project using this that I will be presenting soon, so stay tuned.

A few things to consider. One this does add another layer to your OpenAI communication, and if you are concerned about data containment, this is not a feature you want. Two, at the time of this writing, this is a preview feature.

The last things to be aware of is the managed resource will move up in OpenAI models as older ones are deprecated. AI Models are not always upgrades, 4o is not necessarily better than 3o. What works for prompting in one model may not work correctly in a newer model. If you are not willing to maintain your model and re-tune and retest you may want to go with a user managed implementation.

More details in the Microsoft Learn article here: Use developer tools for Copilot in Business Central AI resources – Business Central | Microsoft Learn

I hope this helps shed some light on the two authentication methods and the pro/con of Managed vs Unmanaged OpenAI implementation. Let me know if you have any questions in the comments below.

One response to “Azure OpenAI in Business Central AL: Managed vs Unmanaged”

  1. […] Integrating AI in Business Central: A Step-by-Step Guide Enhancing Business Central with Address Validation AI Azure OpenAI in Business Central AL: Managed vs Unmanaged […]

    Like

Leave a reply to Using CoPilot to Upgrade Service Notes for Invoices in Business Central AL – Aardvark Labs Cancel reply

Trending