DP-3020 - Lab 2 - Configure and Deploy CI/CD Pipelines - Issue

Open Beginner friendly
#27 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
62/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
azure, github-actions, sql
Domain
ci-cd, cloud, databases

Research direction

Start with LAB02 Step 3 and its main.yml workflow, comparing the instructed deployment with the edited workflow shown in the issue. Run the workflow against an Azure SQL Database project and confirm the DotNet failure is gone and the build produces and deploys the DACPAC.

Written by the indexing model from the issue text.

Description

LAB02 (CSS): Configure and deploy CI/CD pipelines for Azure SQL Database projects
Task: Create a GitHub Actions workflow
Step. 3: Copy the code below on your main.yml file. The code includes the steps for building and deploying your database project.

User have reported running the deployment with the Main.yml file as instructed fails with a DotNet failure [P1]. I have confirmed this behavior and have been able to bypass the issue using the following edited code in the Main.yml file [P2]:

name: Build and Deploy SQL Database Project

on:
  push:
    branches:
      - main

jobs:
  build:
    permissions:
      contents: read
      id-token: write

    runs-on: windows-latest

    steps:
      - name: Checkout repository
        uses: actions/checkout@v3

      # Install MSBuild (required for .sqlproj)
      - name: Setup MSBuild
        uses: microsoft/setup-msbuild@v2

      # Install sqlpackage (Windows version)
      - name: Install sqlpackage
        run: |
          dotnet tool install -g microsoft.sqlpackage

      - name: Login to Azure
        uses: azure/login@v1
        with:
          creds: ${{ secrets.AZURE_CREDENTIALS }}

      # Build SQL Project using MSBuild
      - name: Build SQL Project
        run: |
          msbuild .\MyDBProj\MyDBProj.sqlproj /p:Configuration=Release

      # Publish DACPAC to Azure SQL
      - name: Deploy DACPAC
        run: |
          sqlpackage /Action:Publish `
            /SourceFile:".\MyDBProj\bin\Release\MyDBProj.dacpac" `
            /TargetConnectionString:"${{ secrets.AZURE_CONN_STRING }}" `
            /p:DropObjectsNotInSource=true

[P1] - Deployment with the code as instructed

Image

[P2] - Deployment with edited code above

Image
Dominant language
No language data
Stars
5
Forks
13
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from MicrosoftLearning/mslearn-sql-dev

All issues in MicrosoftLearning/mslearn-sql-dev

Similar issues

More DevOps issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.