Skip to content

Deploy dacpac package to Azure SQL #2

Deploy dacpac package to Azure SQL

Deploy dacpac package to Azure SQL #2

Workflow file for this run

## Secrets Required: Azure SQL Connection String:
# AZURE_SQL_CONNECTION_STRING: 'Server=tcp:yourserver.database.windows.net,1433;Initial Catalog=yourdatabase;Persist Security Info=False;User ID=yourusername;Password=yourpassword;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;'
name: Deploy dacpac package to Azure SQL
on:
workflow_dispatch:
inputs:
environment:
description: 'Environment'
required: true
default: 'dev'
options:
dev:
- 'dev'
staging:
- 'staging'
prod:
- 'prod'
jobs:
build:
runs-on: ubuntu-latest
environment:
name: ${{ github.event.inputs.environment }}
steps:
- uses: actions/checkout@v4
- uses: azure/[email protected]
with:
connection-string: ${{ secrets.AZURE_SQL_CONNECTION_STRING }}
path: './DbProject/DbProject.sqlproj'
action: 'publish'
build-arguments: '-c Release' # Optional build options passed to dotnet build
arguments: '/p:DropObjectsNotInSource=true' # Optional properties and parameters for SqlPackage Publish