QuestionQ19

Implement AI capabilities in database solutions

You have a Microsoft SQL Server 2025 instance with a managed identity enabled. You have a database containing a table named dbo.ManualChunks. dbo.ManualChunks contains product manuals.

A retrieval query already returns the five best-matching chunks as nvarchar(max) text. You need to invoke an Azure OpenAI REST endpoint for chat completions. The solution must deliver the highest level of security.

You write the following Transact-SQL code.

Question Image

What should you add at line 02?

Explanation

A managed-identity database-scoped credential lets SQL Server acquire and send a Microsoft Entra access token without storing an Azure OpenAI API key. For Azure OpenAI, the managed-identity credential uses IDENTITY = 'Managed Identity' and a resourceid of https://cognitiveservices.azure.com; the managed identity must be granted an appropriate Azure OpenAI data-plane role, such as Cognitive Services OpenAI User.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!