Tag: AI-Assisted Development

Connect to MCP server endpoints, including Microsoft SQL Server and Fabric lakehouse (DP-800 Exam Prep)

This post is a part of the DP-800: Developing AI-Enabled Database Solutions Exam Prep Hub.
This topic falls under these sections:
Design and develop database solutions (35–40%)
   --> Design and implement SQL solutions by using AI-assisted tools
      --> Connect to MCP server endpoints, including Microsoft SQL Server and Fabric lakehouse


Note that there are 10 practice questions (with answers) at the end of each section to help you solidify your knowledge of the material. Also, there are 4 practice tests with 30 questions each available from the hub's main page below the exam topics section.

Introduction

As AI-powered development tools continue to evolve, developers increasingly need AI assistants that can interact with live enterprise systems rather than relying solely on the knowledge contained within large language models. The Model Context Protocol (MCP) provides a standardized way for AI assistants, such as GitHub Copilot and Microsoft Copilot, to securely connect to external tools, databases, services, and applications.

For DP-800 candidates, understanding how MCP enables AI-assisted database development is becoming increasingly important. Rather than simply generating SQL code, AI assistants can use MCP to retrieve database metadata, inspect schemas, execute approved queries, explore Fabric Lakehouse data, and assist with troubleshooting in real time.

This article explains how MCP works, how to connect to MCP server endpoints, common use cases involving Microsoft SQL Server and Microsoft Fabric Lakehouse, and best practices for secure implementation.


Learning Objectives

After studying this topic, you should be able to:

  • Understand the purpose of the Model Context Protocol (MCP)
  • Explain the relationship between AI clients and MCP servers
  • Describe how GitHub Copilot and Microsoft Copilot use MCP
  • Connect AI assistants to SQL Server MCP endpoints
  • Connect AI assistants to Microsoft Fabric Lakehouse MCP endpoints
  • Understand authentication and authorization requirements
  • Follow security best practices
  • Troubleshoot common MCP connection issues

What is the Model Context Protocol (MCP)?

The Model Context Protocol (MCP) is an open protocol that standardizes communication between AI applications and external systems.

Instead of building custom integrations for every database or service, AI clients communicate with MCP servers using a consistent protocol.

Think of MCP as a standardized “USB-C connector” for AI applications.

Without MCP:

AI Client
|
Custom SQL Connector
Custom Fabric Connector
Custom REST Connector
Custom File Connector

With MCP:

AI Client
|
MCP
|
-------------------------------------
SQL Server
Fabric Lakehouse
REST APIs
Files
GitHub
Azure Services

This standardized approach simplifies integration while improving maintainability and interoperability.


Why MCP Matters

Traditional AI coding assistants only generate code based on:

  • User prompts
  • Training data
  • Conversation history

Using MCP, AI assistants can also access:

  • Database schemas
  • Table definitions
  • Views
  • Stored procedures
  • Lakehouse metadata
  • Files
  • Documentation
  • Business knowledge
  • External APIs

This enables AI to generate more accurate, context-aware responses.


MCP Architecture

An MCP solution consists of three primary components.

MCP Client

The MCP client is the AI application.

Examples include:

  • GitHub Copilot
  • Microsoft Copilot
  • Visual Studio Code
  • Visual Studio
  • Other MCP-compatible AI assistants

The client sends requests to one or more MCP servers.


MCP Server

The MCP server exposes tools and resources that AI assistants can access.

Examples:

  • SQL Server
  • Fabric Lakehouse
  • Azure services
  • GitHub repositories
  • File systems
  • REST APIs

The server determines which operations are available.


Resource or Tool

Resources exposed by an MCP server may include:

  • Database tables
  • Views
  • Stored procedures
  • SQL execution tools
  • Schema information
  • Lakehouse metadata
  • Documentation
  • APIs

MCP Communication Flow

A typical workflow is:

Developer
GitHub Copilot
MCP Server
SQL Server
Results
GitHub Copilot
Developer

The AI assistant acts as the intermediary, translating user requests into approved tool invocations.


Connecting to an MCP Server

Connecting to an MCP server typically involves:

  1. Configuring the AI client
  2. Registering the MCP endpoint
  3. Authenticating
  4. Discovering available tools
  5. Authorizing access
  6. Using the available resources

Authentication

Authentication verifies the identity of the user or application.

Common authentication methods include:

  • Microsoft Entra ID
  • OAuth
  • Personal Access Tokens (PATs)
  • API Keys (less common)
  • Managed Identity (Azure-hosted scenarios)

Authentication occurs before any tool or data is accessed.


Authorization

Authorization determines what operations the AI may perform.

For example:

Allowed:

  • Read schema
  • Execute SELECT statements
  • View metadata

Denied:

  • DROP TABLE
  • DELETE production data
  • ALTER DATABASE

Least privilege remains an essential security principle.


Connecting to Microsoft SQL Server

An SQL Server MCP server exposes database capabilities to AI assistants.

Common resources include:

  • Tables
  • Views
  • Stored procedures
  • Functions
  • Database metadata
  • Execution plans
  • Query execution tools

Example workflow:

Developer asks:

Show me the Sales schema.

Copilot sends an MCP request.

SQL Server returns:

  • Tables
  • Columns
  • Relationships

Copilot explains the schema.


SQL Server MCP Use Cases

Examples include:

Schema Discovery

Instead of guessing table names:

Copilot retrieves:

  • Customers
  • Orders
  • Products
  • Sales

The generated SQL becomes much more accurate.


Generate SQL

Developer:

Show total revenue by country.

Copilot:

  • Reads schema
  • Finds relationships
  • Generates correct JOIN statements

Explain Stored Procedures

Developer:

Explain usp_ProcessOrders.

Copilot retrieves:

  • Procedure definition
  • Parameters
  • Business logic

Then provides a detailed explanation.


Query Optimization

Copilot can:

  • Inspect indexes
  • Analyze execution plans
  • Suggest rewrites
  • Recommend indexing improvements

Connecting to Microsoft Fabric Lakehouse

Fabric Lakehouse combines:

  • Data Lake
  • Data Warehouse
  • Spark
  • Delta tables

Using MCP, Copilot can interact with Lakehouse metadata.

Available resources may include:

  • Delta tables
  • Shortcuts
  • SQL endpoint metadata
  • Semantic information
  • OneLake structure

Fabric Lakehouse Use Cases

Examples include:

Discover Tables

Developer:

List all sales tables.

Copilot queries metadata.


Generate SQL Analytics Queries

Developer:

Calculate monthly sales growth.

Copilot examines available tables.

Generates optimized SQL.


Explain Lakehouse Structure

Developer:

Explain this Lakehouse.

Copilot can describe:

  • Schemas
  • Delta tables
  • Relationships
  • Storage organization

Data Exploration

Developers can ask:

  • Which tables contain customer data?
  • Which columns contain dates?
  • Which datasets contain revenue?

MCP Tool Discovery

One advantage of MCP is automatic discovery.

After connecting, Copilot can identify available tools such as:

  • Execute SQL
  • Read schema
  • Read documentation
  • Search metadata
  • Retrieve files

The user does not need to manually configure every capability.


Multiple MCP Servers

An AI assistant may connect to multiple MCP servers simultaneously.

Example:

GitHub Copilot
├── SQL Server MCP
├── Fabric Lakehouse MCP
├── GitHub MCP
├── Azure MCP
└── Documentation MCP

This allows a single conversation to span multiple enterprise systems.


Security Considerations

Organizations should never allow unrestricted AI access to production databases.

Best practices include:

  • Read-only access whenever possible
  • Least privilege permissions
  • Entra ID authentication
  • Audit logging
  • Approval workflows for sensitive actions
  • Data classification awareness
  • Secure network connectivity
  • Encryption in transit
  • Regular permission reviews

Network Considerations

Successful MCP connections require:

  • Network connectivity
  • Firewall configuration
  • DNS resolution
  • TLS encryption
  • Endpoint availability

Connection failures often result from blocked network paths or invalid authentication.


Common Connection Issues

Common problems include:

Authentication Failure

Possible causes:

  • Expired token
  • Invalid credentials
  • Missing permissions

Authorization Failure

The user authenticates successfully but lacks permission to use a tool.


Endpoint Unavailable

Possible causes:

  • Incorrect URL
  • Server offline
  • Network outage

Firewall Restrictions

Corporate firewalls may block communication.


Tool Discovery Failure

Possible causes:

  • Unsupported MCP version
  • Server configuration issues
  • Missing capabilities

Best Practices

Microsoft recommends:

  • Connect only trusted MCP servers.
  • Use Microsoft Entra ID when available.
  • Apply least privilege permissions.
  • Validate AI-generated SQL before execution.
  • Audit AI tool usage.
  • Separate development and production environments.
  • Monitor server logs.
  • Keep MCP server software updated.
  • Limit write operations unless required.
  • Review AI responses for correctness before acting on them.

SQL Server vs. Fabric Lakehouse MCP Connections

FeatureSQL Server MCPFabric Lakehouse MCP
Primary purposeRelational databasesLakehouse analytics
ObjectsTables, views, proceduresDelta tables, SQL endpoints
Typical queriesOLTP and reportingAnalytics and big data
MetadataDatabase schemasLakehouse metadata
AI assistanceSQL generation, optimizationAnalytics, exploration, SQL generation

DP-800 Exam Tips

For the exam, remember these key points:

  • MCP is a standardized protocol for connecting AI applications to external tools and data sources.
  • GitHub Copilot and Microsoft Copilot can use MCP servers to access live enterprise resources.
  • SQL Server MCP servers expose relational database metadata and tools.
  • Fabric Lakehouse MCP servers expose Lakehouse metadata, Delta tables, and analytics resources.
  • Authentication verifies identity; authorization determines permitted actions.
  • AI assistants should operate with least privilege.
  • Developers remain responsible for validating all AI-generated code and database operations.
  • Organizations should use secure authentication, auditing, and network protections when deploying MCP-enabled AI solutions.

Summary

The Model Context Protocol (MCP) provides a standardized framework for connecting AI assistants with enterprise resources such as Microsoft SQL Server and Microsoft Fabric Lakehouse. By using MCP, GitHub Copilot and Microsoft Copilot can retrieve live metadata, understand database schemas, generate more accurate SQL, explain existing database objects, and assist with analytics. Proper authentication, authorization, auditing, and adherence to least privilege principles ensure that these powerful capabilities are implemented securely. As AI-assisted database development becomes more prevalent, understanding MCP connectivity and governance is an important skill for DP-800 candidates.


Practice Exam Questions

Question 1

A development team wants GitHub Copilot to retrieve SQL Server table definitions before generating SQL queries. Which technology enables this standardized communication?

A. SQL Server Integration Services (SSIS)

B. Model Context Protocol (MCP)

C. Open Database Connectivity (ODBC)

D. SQL Server Agent

Answer: B

Explanation: MCP provides a standardized protocol that enables AI clients to communicate with external systems such as SQL Server.


Question 2

What is the primary role of an MCP server?

A. Execute operating system updates

B. Store AI model weights

C. Expose tools and resources that AI clients can access

D. Replace Microsoft Entra ID authentication

Answer: C

Explanation: An MCP server exposes resources such as database schemas, SQL execution tools, documentation, and APIs to compatible AI clients.


Question 3

Which authentication mechanism is most commonly recommended for connecting GitHub Copilot to enterprise MCP servers?

A. Anonymous authentication

B. Basic authentication with shared passwords

C. FTP credentials

D. Microsoft Entra ID

Answer: D

Explanation: Microsoft Entra ID provides secure, enterprise-grade authentication with support for modern identity management.


Question 4

An AI assistant successfully authenticates to an SQL Server MCP endpoint but cannot execute a query because of insufficient permissions. Which security concept is responsible?

A. Encryption

B. Compression

C. Authorization

D. Serialization

Answer: C

Explanation: Authentication confirms identity, while authorization determines what actions an authenticated user is permitted to perform.


Question 5

Which capability is most likely exposed by a Microsoft SQL Server MCP server?

A. Reading database schema metadata

B. Azure virtual machine creation

C. Configuring Microsoft Teams

D. Managing Windows updates

Answer: A

Explanation: SQL Server MCP servers commonly expose database metadata, tables, views, stored procedures, and SQL execution tools.


Question 6

Why would an organization use least privilege when configuring MCP server access?

A. To minimize security risks by limiting allowed operations

B. To increase database storage capacity

C. To improve AI response speed

D. To reduce SQL Server licensing costs

Answer: A

Explanation: Least privilege ensures AI assistants receive only the permissions necessary to perform approved tasks.


Question 7

Which Fabric resource is most commonly explored through a Fabric Lakehouse MCP server?

A. Windows Registry

B. Delta tables and Lakehouse metadata

C. DNS records

D. Azure Firewall rules

Answer: B

Explanation: Fabric Lakehouse MCP servers expose Lakehouse metadata, Delta tables, SQL endpoints, and related analytics resources.


Question 8

A developer asks Copilot, “List every customer table in my Lakehouse.” What is the AI assistant most likely doing?

A. Guessing based on its training data

B. Downloading the entire database

C. Using an MCP server to retrieve live metadata

D. Reading Windows Event Logs

Answer: C

Explanation: MCP allows AI assistants to query live metadata rather than relying solely on pretrained knowledge.


Question 9

What is one major advantage of connecting GitHub Copilot to multiple MCP servers?

A. It permanently stores database credentials.

B. It allows a single AI conversation to access multiple enterprise systems and tools.

C. It eliminates the need for authentication.

D. It replaces source control systems.

Answer: B

Explanation: Multiple MCP servers enable AI assistants to work across databases, repositories, documentation, APIs, and other enterprise resources within one workflow.


Question 10

Which statement best reflects Microsoft’s guidance regarding AI-assisted database operations through MCP?

A. AI-generated SQL should be executed automatically without review.

B. Production databases should always grant AI assistants full administrative permissions.

C. MCP eliminates the need for database security controls.

D. Developers should review AI-generated code and queries before executing them.

Answer: D

Explanation: Although MCP provides rich contextual information, developers remain responsible for validating AI-generated code, ensuring correctness, security, and compliance before deployment or execution.


Go to the DP-800 Exam Prep Hub main page

Configure model and Model Context Protocol (MCP) tool options in a GitHub Copilot or Copilot in Fabric chat session – Part 1 (DP-800 Exam Prep)

Part 1 – Configuring AI Models in GitHub Copilot and Microsoft Copilot in Fabric


This post is a part of the DP-800: Developing AI-Enabled Database Solutions Exam Prep Hub.
This topic falls under these sections:
Design and develop database solutions (35–40%)
   --> Design and implement SQL solutions by using AI-assisted tools
      --> Configure model and Model Context Protocol (MCP) tool options in a GitHub Copilot or Copilot in Fabric chat session


Note that there are 10 practice questions (with answers) at the end of each section to help you solidify your knowledge of the material. Also, there are 4 practice tests with 30 questions each available from the hub's main page below the exam topics section.

Introduction

Candidates should understand how to configure and use AI models within GitHub Copilot and Microsoft Copilot in Fabric, select the appropriate model for a task, understand the capabilities and limitations of different models, and use AI effectively when developing SQL solutions.

Unlike traditional SQL development, AI-assisted development requires understanding not only SQL syntax but also how the selected AI model influences the quality, speed, reasoning ability, and accuracy of generated code.


Learning Objectives

After studying this article, you should be able to:

  • Explain how GitHub Copilot and Copilot in Fabric use Large Language Models (LLMs)
  • Describe the role of AI models in SQL development
  • Understand model selection options
  • Compare reasoning-focused models with speed-focused models
  • Choose the appropriate model for database development tasks
  • Understand context windows and token limitations
  • Apply best practices when interacting with AI assistants
  • Recognize exam scenarios involving model configuration

AI-Assisted SQL Development

Modern SQL developers spend significant time performing repetitive tasks such as:

  • Writing CRUD statements
  • Creating stored procedures
  • Building database objects
  • Optimizing queries
  • Writing documentation
  • Generating test data
  • Troubleshooting syntax errors
  • Refactoring legacy SQL

AI assistants accelerate these activities by generating code from natural language.

Instead of writing:

CREATE TABLE Customer
(
CustomerID INT PRIMARY KEY,
FirstName NVARCHAR(100),
LastName NVARCHAR(100),
Email NVARCHAR(200)
)

A developer can simply ask:

Create a customer table with an identity primary key, email validation, audit columns, and an index on Email.

The AI model generates the initial implementation, which the developer reviews and refines.


What Is an AI Model?

An AI model is the language model responsible for interpreting prompts and generating responses.

The model determines:

  • reasoning quality
  • SQL accuracy
  • explanation depth
  • response speed
  • context understanding
  • coding capabilities

Different models are optimized for different workloads.

Some prioritize:

  • speed

Others prioritize:

  • complex reasoning

Others balance both.


GitHub Copilot Architecture

A simplified architecture looks like this:

Developer
GitHub Copilot Chat
Selected AI Model
Generated SQL
Developer Review
Database

The AI never executes SQL automatically.

The developer remains responsible for:

  • reviewing code
  • testing
  • validating security
  • validating performance

Microsoft Copilot in Fabric

Microsoft Copilot in Fabric provides AI assistance across Fabric workloads including:

  • SQL Database
  • Fabric Warehouse
  • Lakehouse
  • Data Engineering
  • Data Science
  • Power BI
  • Notebooks
  • Data Factory
  • Data Warehouse development

For SQL developers, Copilot can:

  • generate SQL
  • explain SQL
  • optimize SQL
  • summarize execution plans
  • generate documentation
  • create sample data
  • troubleshoot errors

Why Model Selection Matters

Different AI models excel at different activities.

For example:

A very fast model may generate:

SELECT *
FROM Orders

A reasoning model might instead suggest:

SELECT
OrderID,
CustomerID,
OrderDate,
TotalAmount
FROM Sales.Orders
WHERE OrderDate >= DATEADD(month,-6,GETDATE());

along with an explanation of:

  • why SELECT * should be avoided
  • indexing recommendations
  • performance implications

The reasoning model produces higher-quality guidance.


Common AI Model Characteristics

Although Microsoft continuously updates available models, most fall into these categories.

Fast Models

Optimized for:

  • rapid responses
  • autocomplete
  • simple SQL
  • syntax correction

Best for:

  • INSERT statements
  • UPDATE statements
  • CREATE TABLE
  • formatting SQL
  • documentation

Advantages

  • very fast
  • low latency
  • excellent for routine work

Disadvantages

  • less detailed reasoning
  • weaker optimization suggestions

Balanced Models

Designed for:

  • coding
  • explanation
  • optimization
  • documentation

Best for:

  • stored procedures
  • views
  • CTEs
  • joins
  • JSON
  • window functions

Advantages

  • good reasoning
  • good speed

Disadvantages

  • may not perform as well as reasoning models on complex architecture questions

Reasoning Models

Reasoning models focus on:

  • architecture
  • optimization
  • debugging
  • security
  • query analysis

Ideal for:

  • execution plans
  • indexing strategy
  • normalization
  • concurrency
  • deadlocks
  • performance tuning

Advantages

  • excellent explanations
  • identifies tradeoffs
  • strong analytical reasoning

Disadvantages

  • slower responses
  • higher computational cost

Choosing the Appropriate Model

A SQL developer should match the model to the task.

TaskRecommended Model Type
Generate CREATE TABLE statementsFast
Explain SQL syntaxBalanced
Write stored proceduresBalanced
Optimize slow queriesReasoning
Analyze execution plansReasoning
Explain indexesReasoning
Generate documentationFast
Review securityReasoning
Refactor codeBalanced
Produce examplesBalanced

Model Selection in GitHub Copilot

Depending on the supported environment and subscription, GitHub Copilot Chat allows users to select from available models.

The workflow generally involves:

  1. Open GitHub Copilot Chat
  2. Open the model selector
  3. Review available models
  4. Choose the appropriate model
  5. Continue the conversation

Changing models changes how future prompts are processed.


Example

Suppose a developer asks:

Optimize this stored procedure.

A reasoning model may return:

  • missing indexes
  • SARGability improvements
  • parameter sniffing considerations
  • execution plan observations
  • rewritten SQL

A fast model may simply reformat the SQL.


Model Selection in Microsoft Copilot in Fabric

Copilot in Fabric similarly enables AI-assisted experiences throughout Microsoft Fabric. Depending on the workload and the capabilities available to your tenant, Copilot uses supported foundation models to generate responses for SQL development, analytics, and data engineering tasks.

When working in Fabric SQL experiences, Copilot can assist with:

  • generating SQL queries
  • explaining existing queries
  • creating tables and views
  • summarizing schemas
  • troubleshooting SQL errors
  • suggesting query improvements
  • documenting database objects

Administrators control whether Copilot features are enabled for a Fabric capacity. Users with access to Copilot interact through the integrated chat interface rather than manually invoking models.


Understanding Context Windows

Every AI model has a maximum amount of information it can process at one time.

This is called the context window.

The context includes:

  • prompts
  • previous conversation
  • SQL scripts
  • schemas
  • documentation

Example:

Prompt
+
Conversation
+
Database Schema
+
SQL Script
=
Context

Larger context windows allow:

  • larger stored procedures
  • multiple tables
  • lengthy conversations
  • larger execution plans

Token Limits

Large Language Models process text as tokens rather than words.

A very large SQL script consumes more tokens than a small query.

If the context exceeds the model’s limit:

  • earlier conversation may be truncated
  • important schema details may be omitted
  • responses may become less accurate

Best practice:

Break very large SQL tasks into smaller requests.


Effective Prompting

Model quality depends heavily on prompt quality.

Poor prompt:

Fix this.

Better prompt:

Optimize this stored procedure for Azure SQL Database. Reduce logical reads while maintaining identical results.

Even better:

Optimize this stored procedure for Azure SQL Database. The Orders table contains 40 million rows. Focus on indexing recommendations, parameter sniffing, and SARGable predicates while preserving the current output.

Specific prompts produce significantly better responses.


Providing Context

Useful context includes:

  • database platform
  • compatibility level
  • schema
  • expected row counts
  • performance goals
  • business rules

Example:

Platform:
Azure SQL Database
Table:
Sales.Orders
Rows:
150 million
Goal:
Reduce CPU utilization
Current execution time:
18 seconds

The more relevant information supplied, the more useful the AI-generated recommendation.


Responsible Use of AI Models

Although AI significantly improves developer productivity, it does not replace professional judgment.

Developers should always:

  • review generated SQL
  • validate security
  • test performance
  • verify business logic
  • confirm permissions
  • review indexes
  • test edge cases

Never assume generated SQL is production-ready without validation.


Common DP-800 Exam Scenarios

The certification exam may present scenarios where you must choose the most appropriate AI model for a particular task.

Examples include:

  • Selecting a reasoning model to analyze an execution plan for a slow query.
  • Choosing a balanced model to generate and explain a stored procedure.
  • Using a fast model to quickly scaffold a set of standard CRUD statements.
  • Understanding that different models may produce different levels of explanation and optimization guidance for the same prompt.

You should also understand that AI-generated SQL should always be reviewed, tested, and validated before deployment.


Best Practices

  • Choose the model that best matches the complexity of the task.
  • Provide detailed prompts with sufficient database context.
  • Include schema information when requesting SQL generation.
  • Break very large requests into smaller, focused prompts.
  • Review all generated SQL for correctness, security, and performance.
  • Validate AI recommendations using execution plans and performance metrics.
  • Avoid sharing sensitive production data unless organizational policies explicitly allow it.
  • Remember that AI assists the developer—it does not replace testing, code review, or database design expertise.

DP-800 Exam Tips

Remember the following points for the exam:

  • AI models differ in reasoning ability, response speed, and context handling.
  • Reasoning-focused models are generally better suited for performance tuning, query optimization, and architectural guidance.
  • Simpler or faster models are appropriate for routine SQL generation and code completion.
  • The quality of AI output depends heavily on the quality of the prompt and the context provided.
  • GitHub Copilot and Copilot in Fabric accelerate development but do not automatically validate correctness or security.
  • Developers remain responsible for reviewing and testing all AI-generated SQL before deployment.

Go to the DP-800 Exam Prep Hub main page

Enable GitHub Copilot and Microsoft Copilot in Fabric (DP-800 Exam Prep)

This post is a part of the DP-800: Developing AI-Enabled Database Solutions Exam Prep Hub.
This topic falls under these sections:
Design and develop database solutions (35–40%)
   --> Design and implement SQL solutions by using AI-assisted tools
      --> Enable GitHub Copilot and Microsoft Copilot in Fabric


Note that there are 10 practice questions (with answers) at the end of each section to help you solidify your knowledge of the material. Also, there are 4 practice tests with 30 questions each available from the hub's main page below the exam topics section.

Introduction

The DP-800 exam expects candidates to understand how to enable, configure, and effectively use GitHub Copilot and Microsoft Copilot in Microsoft Fabric to improve SQL development productivity while maintaining security, governance, and responsible AI practices.

Unlike traditional SQL development topics, this objective focuses on using AI-assisted development tools rather than writing SQL syntax itself.

After studying this topic, you should be able to:

  • Understand the purpose of GitHub Copilot and Microsoft Copilot in Fabric.
  • Identify licensing and prerequisite requirements.
  • Enable GitHub Copilot in supported development environments.
  • Enable Copilot features within Microsoft Fabric.
  • Understand tenant, capacity, and workspace requirements.
  • Use AI assistants to generate SQL code.
  • Use AI to explain, optimize, and troubleshoot SQL.
  • Understand responsible AI and governance considerations.
  • Identify security best practices when using AI-assisted development.

What is GitHub Copilot?

GitHub Copilot is an AI-powered coding assistant that helps developers write software by generating code suggestions based on natural language prompts and existing code.

It can:

  • Generate SQL queries
  • Create stored procedures
  • Suggest table definitions
  • Generate JOIN statements
  • Explain SQL code
  • Generate comments and documentation
  • Help debug errors
  • Recommend code improvements
  • Convert natural language into SQL

GitHub Copilot is integrated into popular development environments, including:

  • Visual Studio
  • Visual Studio Code
  • GitHub.com
  • Azure Data Studio (where supported)
  • SQL development environments that support Copilot extensions

For DP-800, GitHub Copilot is primarily used to accelerate SQL database development.


What is Microsoft Copilot in Fabric?

Microsoft Copilot in Microsoft Fabric is an AI assistant built directly into the Microsoft Fabric platform.

Rather than only generating code, Fabric Copilot helps users:

  • Create SQL queries
  • Build Data Warehouses
  • Generate notebooks
  • Explain SQL statements
  • Create Dataflows
  • Build reports
  • Analyze datasets
  • Summarize data
  • Generate semantic model calculations
  • Create pipelines
  • Produce documentation

For SQL developers, Copilot can assist with creating and refining SQL scripts within Fabric Data Warehouse and SQL analytics experiences.


GitHub Copilot vs. Microsoft Copilot in Fabric

FeatureGitHub CopilotMicrosoft Copilot in Fabric
Primary purposeAI coding assistantAI assistant across Fabric workloads
SQL generationYesYes
Code explanationsYesYes
Natural language promptsYesYes
Notebook assistanceLimitedYes
Data Warehouse assistanceYesYes
Power BI integrationNoYes
Fabric workspace integrationNoYes
Development IDE integrationYesLimited to Fabric experiences

GitHub Copilot Prerequisites

Before GitHub Copilot can be used, developers generally need:

  • A GitHub account
  • A GitHub Copilot subscription or enterprise license
  • A supported IDE (Visual Studio, Visual Studio Code, etc.)
  • Internet connectivity
  • Authentication with GitHub

Organizations may centrally manage Copilot licensing through GitHub Enterprise.


Enabling GitHub Copilot in Visual Studio Code

The general process includes:

  1. Install Visual Studio Code.
  2. Sign in to GitHub.
  3. Install the GitHub Copilot extension.
  4. Authenticate your GitHub account.
  5. Verify that your organization permits Copilot usage.
  6. Open a SQL file.
  7. Begin typing or enter a natural language prompt.

Example:

-- Create a stored procedure that returns all orders placed during the last 30 days.

Copilot suggests SQL code that can then be reviewed and edited.


Enabling GitHub Copilot in Visual Studio

Visual Studio includes built-in support for GitHub Copilot after the extension is installed.

Developers typically:

  • Install the GitHub Copilot extension.
  • Sign in using GitHub credentials.
  • Enable Copilot in the IDE settings if required.
  • Open a SQL project.
  • Accept or reject AI-generated suggestions.

Microsoft Fabric Copilot Requirements

Copilot in Microsoft Fabric requires several prerequisites.

These commonly include:

  • A Microsoft Fabric tenant
  • An eligible Fabric capacity that supports Copilot features
  • Administrator approval for Copilot
  • Appropriate user licensing
  • A supported Fabric experience
  • Access to a Fabric workspace

Not every Fabric environment automatically has Copilot enabled.


Enabling Copilot in Microsoft Fabric

Fabric administrators control whether Copilot features are available within the organization.

Typical steps include:

  1. Open the Fabric Admin Portal.
  2. Navigate to Tenant Settings.
  3. Locate Copilot and AI settings.
  4. Enable Copilot for the organization or selected security groups.
  5. Save configuration changes.
  6. Assign users to workspaces with Copilot-enabled capacities.

Organizations may choose to enable Copilot only for specific departments or security groups.


Workspace Considerations

Users generally require:

  • Workspace access
  • Appropriate workspace role
  • Capacity that supports AI features

Having access to Fabric alone does not guarantee Copilot availability.


Security Permissions

Fabric administrators may control:

  • Who can use Copilot
  • Which workspaces allow AI
  • Which security groups receive access
  • Which users can create AI-assisted content

This supports governance and compliance requirements.


Using GitHub Copilot for SQL Development

GitHub Copilot can assist with:

Creating Tables

Example prompt:

Create a SQL table for storing customer orders.

Copilot generates a table definition including columns, data types, and constraints.


Generating Stored Procedures

Example prompt:

Create a stored procedure that returns orders by customer.

Copilot generates the T-SQL, which should then be reviewed before deployment.


Creating Functions

Developers can request:

  • Scalar functions
  • Table-valued functions
  • Aggregate calculations
  • String manipulation
  • Date calculations

Writing Complex Queries

Copilot can generate:

  • JOIN statements
  • CTEs
  • Window functions
  • Recursive queries
  • JSON queries
  • Graph queries
  • Regular expression queries
  • Error handling logic

Using Copilot in Fabric

Fabric Copilot supports natural language interactions.

Example:

Show the top ten customers by total sales during the last fiscal year.

Copilot may generate the corresponding SQL query automatically.


Explaining SQL Code

One valuable feature is code explanation.

Example prompt:

Explain this stored procedure.

Copilot can summarize:

  • joins
  • filters
  • business logic
  • aggregations
  • performance considerations

This is especially useful when maintaining legacy SQL code.


Optimizing SQL Queries

Copilot can suggest improvements such as:

  • adding indexes
  • eliminating unnecessary scans
  • simplifying joins
  • reducing nested queries
  • replacing cursors
  • improving readability

However, recommendations should always be validated using execution plans and performance testing.


AI-Assisted Documentation

Developers can use Copilot to generate:

  • procedure descriptions
  • function documentation
  • parameter explanations
  • inline comments
  • technical documentation

Good documentation improves maintainability and collaboration.


Responsible AI Considerations

Neither GitHub Copilot nor Fabric Copilot should be considered authoritative.

Developers remain responsible for:

  • correctness
  • performance
  • security
  • compliance
  • testing
  • deployment approval

AI accelerates development but does not replace engineering judgment.


Security Best Practices

When using AI assistants:

  • Never include passwords in prompts.
  • Do not paste connection strings.
  • Remove API keys.
  • Avoid sharing production customer data.
  • Use anonymized sample data whenever possible.
  • Review generated SQL for SQL injection vulnerabilities.
  • Verify permissions follow the Principle of Least Privilege.
  • Follow organizational AI governance policies.

Common Limitations

AI assistants may:

  • Generate inefficient SQL.
  • Hallucinate nonexistent syntax.
  • Recommend deprecated features.
  • Omit indexes.
  • Produce insecure dynamic SQL.
  • Misinterpret business requirements.

Always validate generated code before using it in production.


GitHub Copilot vs Manual Development

TaskManual DevelopmentGitHub Copilot
Create SQLFully manualAI-assisted
Write documentationManualAI-generated drafts
Generate stored proceduresManualAI-assisted
Explain existing codeManual analysisAI explanations
Query optimization suggestionsDBA experienceAI recommendations (review required)
Security validationDeveloper responsibilityDeveloper responsibility

DP-800 Exam Tips

Be familiar with:

  • GitHub Copilot licensing prerequisites
  • Supported development environments
  • Fabric Copilot enablement requirements
  • Tenant settings that control Copilot
  • Workspace and capacity requirements
  • Appropriate use of AI-generated SQL
  • Responsible AI principles
  • Security and governance responsibilities
  • Human review of AI-generated code
  • Organizational approval for AI usage

Remember:

GitHub Copilot primarily assists developers inside coding environments, while Microsoft Copilot in Fabric provides AI assistance across multiple Fabric workloads, including SQL development, analytics, notebooks, and reporting.


Key Takeaways

  • GitHub Copilot is an AI-powered coding assistant that accelerates SQL development.
  • Microsoft Copilot in Fabric provides AI assistance throughout the Microsoft Fabric ecosystem.
  • Fabric administrators control Copilot availability through tenant settings and capacity configuration.
  • Developers need appropriate permissions, licensing, and workspace access.
  • AI-generated SQL should always be reviewed, tested, and validated.
  • Sensitive information should never be included in AI prompts.
  • AI improves productivity but does not replace secure software development practices.

Practice Exam Questions

Question 1

A database developer wants to use GitHub Copilot in Visual Studio Code. Which prerequisite is required before Copilot can provide code suggestions?

A. Install the GitHub Copilot extension and authenticate with a licensed GitHub account

B. Enable Microsoft Fabric capacity

C. Create a SQL Server Agent job

D. Install Azure Data Factory

Correct Answer: A

Explanation: GitHub Copilot requires a GitHub account, an appropriate Copilot license, installation of the GitHub Copilot extension, and authentication before AI-powered code suggestions become available.


Question 2

Who typically enables Microsoft Copilot features for an organization using Microsoft Fabric?

A. Every workspace member individually

B. SQL Server service account

C. Fabric administrator through tenant settings

D. Database owner

Correct Answer: C

Explanation: Microsoft Fabric administrators manage Copilot availability through tenant settings and can enable it for the entire organization or selected security groups.


Question 3

Which task is GitHub Copilot best suited to assist with?

A. Replacing SQL Server security auditing

B. Automatically approving production deployments

C. Generating SQL code and stored procedures from natural language prompts

D. Creating Azure subscriptions

Correct Answer: C

Explanation: GitHub Copilot is designed to help developers generate, explain, and improve code, including SQL statements, stored procedures, and database objects.


Question 4

A developer asks Copilot to optimize a SQL query. What should the developer do before deploying the suggested code?

A. Assume the generated code is correct

B. Skip performance testing

C. Disable indexes

D. Review, test, and validate the generated SQL

Correct Answer: D

Explanation: AI-generated code should always undergo testing, performance evaluation, security review, and validation before being used in production.


Question 5

Which Microsoft Fabric requirement is commonly necessary for users to access Copilot features?

A. Workspace access and a Copilot-supported Fabric capacity

B. SQL Server Express Edition

C. Windows Server Failover Clustering

D. SQL Server Agent enabled

Correct Answer: A

Explanation: Users generally require access to a Fabric workspace that resides on a capacity supporting Copilot features, along with the necessary permissions.


Question 6

What is an appropriate use of Microsoft Copilot in Fabric?

A. Automatically bypassing security reviews

B. Generating SQL queries from natural language requests

C. Granting database administrator privileges

D. Disabling tenant governance

Correct Answer: B

Explanation: Fabric Copilot can translate natural language requests into SQL queries and assist with other Fabric workloads, but it does not replace security or governance processes.


Question 7

Which statement best describes the relationship between GitHub Copilot and Microsoft Copilot in Fabric?

A. They perform exactly the same functions in every environment.

B. GitHub Copilot only works with Power BI.

C. Fabric Copilot replaces all integrated development environments.

D. GitHub Copilot primarily assists with coding, while Fabric Copilot assists across multiple Microsoft Fabric experiences.

Correct Answer: D

Explanation: GitHub Copilot focuses on AI-assisted software development within supported IDEs, whereas Fabric Copilot provides AI capabilities across data engineering, analytics, warehousing, notebooks, reporting, and SQL experiences.


Question 8

Which information should never be included in an AI prompt when requesting SQL assistance?

A. Sample table names

B. General business requirements

C. Production passwords and connection strings

D. Desired query output

Correct Answer: C

Explanation: Sensitive information such as passwords, connection strings, API keys, and confidential customer data should never be shared with AI tools.


Question 9

Which benefit does GitHub Copilot provide during SQL development?

A. It automatically deploys production databases.

B. It generates AI-assisted code suggestions that can improve developer productivity.

C. It permanently replaces code reviews.

D. It guarantees optimal query performance.

Correct Answer: B

Explanation: GitHub Copilot accelerates development by generating code suggestions, but developers remain responsible for testing, reviewing, and validating the generated code.


Question 10

Which statement reflects Microsoft’s recommended approach to AI-assisted database development?

A. AI-generated code should always be deployed without modification.

B. AI eliminates the need for peer reviews.

C. AI-generated code should be treated as a draft that developers validate for correctness, security, and performance.

D. AI guarantees compliance with organizational policies.

Correct Answer: C

Explanation: AI-generated code should be viewed as a productivity aid rather than authoritative output. Developers are responsible for verifying functionality, security, performance, compliance, and adherence to organizational standards before deployment.


Go to the DP-800 Exam Prep Hub main page

Interpret the security impact of using AI-assisted tools (DP-800 Exam Prep)

This post is a part of the DP-800: Developing AI-Enabled Database Solutions Exam Prep Hub.
This topic falls under these sections:
Design and develop database solutions (35–40%)
   --> Design and implement SQL solutions by using AI-assisted tools
      --> Interpret security impact of using AI-assisted tools


Note that there are 10 practice questions (with answers) at the end of each section to help you solidify your knowledge of the material. Also, there are 4 practice tests with 30 questions each available from the hub's main page below the exam topics section.

Introduction

Unlike many traditional SQL development topics, this objective focuses less on writing T-SQL and more on understanding how AI coding assistants affect security, privacy, compliance, and governance throughout the software development lifecycle.

For the DP-800 exam, you should understand:

  • Security risks associated with AI coding assistants
  • Responsible use of AI-generated code
  • Protection of confidential data
  • Compliance considerations
  • Secure prompt engineering
  • Human review requirements
  • Organizational governance for AI-assisted development
  • Microsoft AI tooling security capabilities

Why Security Matters When Using AI-Assisted Tools

Modern AI assistants such as:

  • Microsoft Copilot
  • GitHub Copilot
  • Azure AI Foundry
  • Microsoft Fabric Copilot
  • SQL Database Copilot experiences
  • Azure Data Studio AI extensions
  • Visual Studio AI-assisted development

can dramatically improve developer productivity.

However, they also introduce new risks.

AI systems often process:

  • prompts
  • source code
  • database schema
  • stored procedures
  • configuration files
  • API definitions
  • infrastructure code
  • documentation

If developers expose sensitive information to an AI system, that information could violate organizational security policies.

Therefore:

AI should improve developer productivity—not weaken database security.


Primary Security Risks

The exam expects candidates to recognize several categories of risk.

1. Exposure of Sensitive Information

Never include confidential information inside prompts.

Examples include:

  • passwords
  • connection strings
  • API keys
  • access tokens
  • customer data
  • Personally Identifiable Information (PII)
  • Protected Health Information (PHI)
  • financial records
  • encryption keys

Bad example:

“Optimize this stored procedure that accesses CustomerCreditCards.”

Better:

Replace confidential objects with generic examples.

CustomerTable
OrderTable
SalesTable

instead of production names.


2. Leakage of Intellectual Property

Many organizations consider:

  • SQL code
  • stored procedures
  • business rules
  • AI models
  • algorithms
  • database architecture

to be proprietary.

Developers should avoid submitting confidential business logic into public AI services unless organizational policy permits it.


3. AI Hallucinations

AI-generated code may:

  • invent SQL syntax
  • generate nonexistent functions
  • misuse permissions
  • recommend deprecated features
  • introduce vulnerabilities

Example:

AI may suggest:

GRANT CONTROL TO PUBLIC

This is almost never appropriate.

Always validate AI-generated SQL.


4. Insecure Code Generation

AI sometimes generates code that:

  • lacks input validation
  • uses dynamic SQL unsafely
  • ignores least privilege
  • omits error handling
  • exposes excessive permissions

Example:

Unsafe:

SET @sql =
'SELECT * FROM Orders WHERE CustomerID=' + @CustomerID
EXEC(@sql)

Preferred:

sp_executesql

with parameters.


5. Compliance Violations

Many industries have regulations governing data usage.

Examples:

  • GDPR
  • HIPAA
  • PCI DSS
  • ISO 27001
  • SOC 2

Uploading regulated information into unauthorized AI services may violate compliance requirements.


Human Review is Required

One of the most important DP-800 concepts:

AI assists developers—it does not replace secure code review.

Every AI-generated recommendation should be reviewed for:

  • correctness
  • performance
  • security
  • compliance
  • maintainability

Human approval remains essential.


Secure Prompt Engineering

Prompt engineering also has security implications.

Good prompts avoid exposing sensitive information.

Instead of:

“Here’s our production database schema.”

Use:

“Here’s a simplified example schema.”

Good prompts:

  • remove customer data
  • remove passwords
  • remove secrets
  • anonymize identifiers
  • generalize business logic

Protecting Secrets

Never place secrets into AI prompts.

Examples include:

  • Azure SQL passwords
  • Azure Storage keys
  • SAS tokens
  • API keys
  • OAuth tokens
  • certificates
  • encryption keys

Instead:

<ConnectionString>

or

<MyAPIKey>

as placeholders.


Protect Customer Data

Sensitive customer information includes:

  • names
  • addresses
  • SSNs
  • passport numbers
  • emails
  • phone numbers
  • medical records
  • payment information

Instead of:

John Smith

Use:

Customer A

Instead of:

4111-1111-1111-1111

Use:

<CardNumber>

AI and Least Privilege

Generated SQL should follow the Principle of Least Privilege.

Avoid:

GRANT CONTROL

Prefer:

GRANT SELECT

or

GRANT EXECUTE

only when necessary.

AI suggestions should always be reviewed for excessive permissions.


Verify AI-Generated Security Recommendations

AI may recommend:

  • indexes
  • permissions
  • encryption
  • authentication methods
  • firewall rules

Always verify recommendations against:

  • Microsoft documentation
  • organizational standards
  • security policies
  • current SQL Server capabilities

Secure Development Lifecycle (SDL)

AI should support—not bypass—the Secure Development Lifecycle.

Typical workflow:

  1. Developer writes prompt
  2. AI generates code
  3. Developer reviews
  4. Static code analysis
  5. Security scanning
  6. Peer review
  7. Testing
  8. Deployment

AI does not eliminate security reviews.


AI-Generated SQL Must Still Be Tested

Always test:

  • SQL injection protection
  • permissions
  • transactions
  • rollback behavior
  • concurrency
  • performance
  • indexing
  • execution plans

Never deploy AI-generated code without testing.


Microsoft Copilot Security

Microsoft enterprise AI offerings provide important security capabilities.

Examples include:

  • enterprise authentication
  • Microsoft Entra ID integration
  • tenant isolation
  • role-based access control
  • compliance features
  • auditing
  • encryption
  • responsible AI safeguards

Organizations should understand which AI services are approved for handling sensitive information.


Governance of AI Usage

Organizations should establish governance policies that define:

  • approved AI tools
  • acceptable prompts
  • prohibited data types
  • review requirements
  • logging
  • auditing
  • approval workflows
  • compliance responsibilities

Developers should follow organizational AI usage policies.


Common Security Best Practices

When using AI-assisted SQL development:

  • Never share passwords or secrets.
  • Remove customer information from prompts.
  • Anonymize production schemas when possible.
  • Validate every AI-generated query.
  • Review permissions carefully.
  • Use parameterized queries instead of string concatenation.
  • Test AI-generated code before deployment.
  • Perform peer reviews.
  • Follow organizational governance policies.
  • Verify AI recommendations against Microsoft documentation.

Exam Tips

Know the differences between:

ConceptKey Point
AI AssistanceImproves productivity but requires review
Human ReviewAlways required before deployment
Sensitive DataNever include in prompts
ComplianceAI usage must satisfy organizational regulations
SecretsNever expose passwords, keys, or tokens
Least PrivilegeAI-generated permissions should be minimal
GovernanceOrganizations define approved AI usage
Responsible AIAI outputs must be validated for security and correctness

DP-800 Exam Tips

Expect scenario-based questions such as:

  • Is this prompt safe?
  • Which information should be removed before using Copilot?
  • Which AI recommendation should be rejected?
  • Which code introduces SQL injection?
  • Which permission follows least privilege?
  • How should confidential schemas be shared?
  • What review is still required after AI generates code?
  • Which compliance issue exists?
  • Which AI-generated recommendation is safest?
  • Which governance practice should be followed?

The correct answer almost always favors:

  • protecting sensitive information,
  • minimizing permissions,
  • validating AI-generated code,
  • following organizational security policies, and
  • requiring human review before deployment.

Practice Exam Questions

Question 1

A developer wants to use an AI coding assistant to optimize a stored procedure. Which information should NOT be included in the prompt?

A. Sample table names

B. Production connection string containing credentials

C. Database version

D. Execution plan summary

Correct Answer: B

Explanation:
Connection strings containing usernames, passwords, or other credentials are sensitive secrets and should never be shared with AI tools. Replace them with placeholders before submitting prompts.


Question 2

Which security principle should always be applied when reviewing AI-generated SQL permissions?

A. Full administrative access

B. Principle of Least Privilege

C. Maximum compatibility

D. Public access

Correct Answer: B

Explanation:
AI-generated code should grant only the permissions necessary to perform the required task. Avoid overly broad permissions such as CONTROL or db_owner unless absolutely required.


Question 3

An AI assistant generates a stored procedure that concatenates user input into a SQL statement. What should the developer do?

A. Deploy it because AI generated it

B. Ignore it

C. Replace it with parameterized SQL

D. Disable indexing

Correct Answer: C

Explanation:
Dynamic SQL created through string concatenation is vulnerable to SQL injection. Use parameterized queries or sp_executesql to safely pass user input.


Question 4

A company must comply with GDPR. Which prompt represents the safest practice?

A. Replace customer information with anonymized sample data

B. Include production payment records

C. Upload an entire production database backup

D. Include customer names and addresses

Correct Answer: A

Explanation:
Personally identifiable information should be removed or anonymized before using AI-assisted development tools to reduce compliance and privacy risks.


Question 5

Why should developers review AI-generated SQL before deploying it?

A. AI-generated code is always optimized

B. AI may generate incorrect or insecure code

C. AI always follows organizational standards

D. AI automatically performs penetration testing

Correct Answer: B

Explanation:
AI-generated code can contain logical errors, security vulnerabilities, deprecated syntax, or poor performance choices. Human review remains essential.


Question 6

Which item is generally appropriate to include in an AI prompt?

A. Encryption keys

B. Customer Social Security numbers

C. Generic sample schema with fictional table names

D. Production API tokens

Correct Answer: C

Explanation:
Generic schemas without confidential business information allow AI to provide useful assistance while protecting sensitive organizational data.


Question 7

Which activity remains part of the Secure Development Lifecycle even when AI generates most of the SQL code?

A. Eliminating peer review

B. Skipping security testing

C. Removing code reviews

D. Performing security validation and testing

Correct Answer: D

Explanation:
AI accelerates development but does not replace testing, peer reviews, static analysis, or security validation.


Question 8

What is the primary purpose of organizational AI governance policies?

A. Increase CPU utilization

B. Define approved and secure use of AI tools

C. Eliminate documentation

D. Replace database administrators

Correct Answer: B

Explanation:
Governance policies establish which AI tools are approved, what data may be shared, required review processes, auditing requirements, and compliance expectations.


Question 9

An AI assistant recommends granting CONTROL permissions to simplify application development. What should the developer do first?

A. Apply the recommendation immediately

B. Replace CONTROL with db_owner

C. Review whether a lower permission satisfies the requirement

D. Disable authentication

Correct Answer: C

Explanation:
Broad permissions should be carefully reviewed. Following the Principle of Least Privilege helps reduce security risks by granting only the minimum required permissions.


Question 10

Which statement best describes responsible use of AI-assisted database development?

A. AI-generated code is production-ready without review.

B. AI eliminates the need for security testing.

C. AI guarantees compliance with regulations.

D. AI improves productivity, but developers remain responsible for validating security, correctness, and compliance.

Correct Answer: D

Explanation:
AI is a productivity tool, not an autonomous developer. Developers remain accountable for verifying code quality, security, regulatory compliance, and organizational standards before deployment.


Go to the DP-800 Exam Prep Hub main page