GitHub Actions Workflow for an SDK-Style SQL Database Project

DP-800 By islever Editorial Last updated

Implement CI/CD by using SQL Database Projects

Short answer

The three selections are Yes, Yes, and Yes: schema validation occurs during Build and again during Deploy, unit tests run after a successful build, and deployment is gated to pushes to main.

Question

HOTSPOT
You have a database named db1. The schema is stored in a Git repository as an SDK-style SQL database project. The repository contains the following GitHub Action workflow.
Exhibit: GitHub Actions Workflow for an SDK-Style SQL Database Project
For each of the following statements, select Yes if the statement is true. Otherwise, select No.
NOTE: Each correct selection is worth one point.
Exhibit: GitHub Actions Workflow for an SDK-Style SQL Database Project

Key Takeaways

You must read GitHub Actions triggers, job dependencies, and SQL project build/publish behavior to recognize that the workflow validates the schema in both Build and Deploy and does not deploy on pull requests.

This DP-800 hotspot tests how a GitHub Actions workflow builds, tests, and deploys an SDK-style SQL database project. The three statements are all Yes: schema validation happens during Build and Deploy, unit tests follow a successful build, and deployment is tied to pushes to main.

Common mistake: Assuming the deploy job runs for every workflow run, including pull requests, or that schema validation occurs only at deployment; the `needs` and branch conditions plus `dotnet build` prove otherwise.

Expert Analysis

Build phase validates the project

The SDK-style SQL database project is compiled with dotnet build. That step loads the project model and resolves schema objects; unresolved references or invalid object definitions fail the build. The statement that schema validation occurs during Build is therefore Yes.

Deploy phase also validates

Deployment to db1 uses the SQL action/SqlPackage publish path. SqlPackage computes a deployment plan against the target and verifies that the built DACPAC can be applied. The tempting wrong answer is to treat validation as a Build-only concern because compilation is obvious there; the publish step is a second validation point. A supplied learner note reaches the same Yes/Yes/Yes conclusion and highlights validation in both Build and Deploy.

Tests and deployment ordering

dotnet test follows the build step, so unit tests run after a successful build; a failed build skips them. The deploy job is separate and gated to pushes to main, so pull requests can build and test without publishing to db1. The attractive trap is seeing a deploy job in the workflow and assuming it runs on every trigger; the job dependency and branch condition control that.

Verdict

All three selections are Yes: unit tests follow a successful build, schema validation occurs during both Build and Deploy, and deployment is tied to pushes to main through the workflow's job dependency/condition.

Official Reference

Exam Strategy

For GitHub Actions hotspots, first read the on: block, then the jobs and any if: or needs: conditions, before evaluating each statement. Match each statement to a specific YAML line: triggers control when the workflow starts, job dependencies control order, and dotnet build/SqlPackage actions control schema validation. Do not assume a job runs just because it is present—conditional jobs are the usual trap.

Frequently Asked Questions

Does building an SDK-style SQL database project validate the schema?

Yes. dotnet build compiles the project model and fails on unresolved objects or invalid schema references, so validation is not limited to the deployment action.

Why does the workflow not deploy on a pull request?

The deploy job depends on a successful build and is gated to pushes to main; pull requests can still run the build and test steps without publishing to db1.

What is the role of SqlPackage in the deploy job?

SqlPackage publishes the built DACPAC to db1 and computes a deployment plan, which also verifies that the schema change can be applied to the target database.

More DP-800 FAQ →

Discussion 1 contributions

Compiled from public community threads and reader submissions, lightly edited for clarity. Handles and vote tallies are shown as recorded, and comments reflect the views of individual contributors.

From public community threads 1

  1. a13b6ea 👍 1
    Answers: Yes / Yes / Yes. Unit tests run after a successful build and deployment on pushes to main; schema validation occurs during both Build and Deploy.

Reader comments & corrections

No reader corrections yet — spotted an error or have a note? Share it below.

Log in to comment, report an error, or add a note about this question.

Submitted for moderation before publishing. Keep it helpful and respectful.

← Back to DP-800 Study Guide