Using Microsoft Azure OpenAI to facilitate tasks with relational databases
This page discusses how to use Azure AI when working with relational databases. It walks through the steps to create an API key and then uses that key with WinSQL to chat with Azure OpenAI.
Azure OpenAI serves as the backbone for tools like Microsoft Copilot 365, which is integrated with products like MS Word, Excel, Teams, and others.
Benefits of Using Azure OpenAI vs calling an LLM directly
Using Azure offers the following benefits:
- Enterprise-grade security and compliance: Azure provides built-in security features, enterprise-grade SLAs, and helps meet compliance requirements like GDPR and HIPAA.
- Responsible AI guardrails: The platform includes safety systems and content filtering to help detect and mitigate harmful or ungrounded content before deployment.
- Integrated ecosystem: Azure AI services are deeply integrated with other Azure services, making it easier to build end-to-end AI solutions.
Prerquisites
You will need the following before using Azure OpenAI
Instructions For Creating An API Key
- Visit https://portal.azure.com and log in.
- In the search bar towards the top, search for Microsoft Foundry.
- Click the Create a resource button, as shown below.
- Select an existing Subscription, Resource group, and specify a default project name.
- Using the Network tab, you can specify IP addresses or a private endpoint to limit access to this resource.
- Leave the default values for the remaining tabs.
- Finally, click the Create button. This will deploy the resource, which may take a few seconds. You should see a screen like this.
- Next, you need to assign the AI models that you wish to use with this resource. Click the Go to Foundry portal button, as shown below.
- The following page lists two important pieces of information: your API Key and your project endpoint, as shown below.
- Next, you must assign one or more AI models to this resource. Click the Model Catalog link on the left-hand pane. For example, you can choose gpt-5-chat, as shown below.
- Finally, click the Create resource and deploy button. This step will take a few seconds to complete.
Configuration in WinSQL
- Open WinSQL and connect to a desired database
- Click the AI Chat tab, then click the Configure button.