Skip to content

Commit f8bc2dc

Browse files
committed
adding info on troubleshooting pipelines for sqlpackage
1 parent 58f8420 commit f8bc2dc

5 files changed

Lines changed: 68 additions & 8 deletions

File tree

docs/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9740,6 +9740,8 @@
97409740
href: tools/release-notes-sqlpackage.md
97419741
- name: sqlpackage ref
97429742
href: tools/sqlpackage.md
9743+
- name: SqlPackage in development pipelines
9744+
href: tools/sqlpackage.md
97439745
- name: SQL Server Profiler
97449746
href: tools/sql-server-profiler/sql-server-profiler.md
97459747
items:
18.2 KB
Loading

docs/tools/sqlpackage-download.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ ms.prod: sql
66
ms.prod_service: sql-tools
77
ms.technology: tools-other
88
ms.topic: conceptual
9-
author: "pensivebrian"
10-
ms.author: "broneill"
11-
ms.reviewer: "drskwier; sstein"
9+
author: "dzsquared"
10+
ms.author: "drskwier"
11+
ms.reviewer: "maghan; sstein"
1212
ms.date: 10/02/2020
1313
---
1414

docs/tools/sqlpackage-pipelines.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
---
2+
title: SqlPackage in development pipelines
3+
description: Learn how to troubleshoot database development pipelines with SqlPackage.exe by checking the installed build number.
4+
ms.prod: sql
5+
ms.prod_service: sql-tools
6+
ms.technology: tools-other
7+
ms.topic: conceptual
8+
ms.assetid: 198198e2-7cf4-4a21-bda4-51b36cb4284b
9+
author: "dzsquared"
10+
ms.author: "drskwier"
11+
ms.reviewer: "maghan; sstein"
12+
ms.date: 11/4/2020
13+
---
14+
15+
# SqlPackage in Development Pipelines
16+
17+
**SqlPackage.exe** is a command-line utility that automates several database development tasks and can be incorporated into CI/CD pipelines.
18+
19+
## Managed virtual environments for Azure Pipelines and GitHub Actions
20+
21+
The virtual environments used for GitHub Actions hosted runners and Azure Pipelines VM images are managed in the [virtual-environments](https://github.com/actions/virtual-environments) GitHub repository. SqlPackage is included in the `windows-latest` environment and updates to the images are made within a few weeks of each SqlPackage release.
22+
23+
## Checking the SqlPackage version in a virtual environment
24+
25+
During troubleshooting efforts, it is important to know the SqlPackage version in use. Capturing this information can be done by adding a step to the pipeline to run SqlPackage with the `/version` parameter. Examples are given below based on the Microsoft and GitHub managed environments, self-hosted environments may have different installation paths for the working directory.
26+
27+
### Azure Pipelines
28+
29+
By leveraging the [script](https://docs.microsoft.com/azure/devops/pipelines/yaml-schema#script) keyword in an Azure Pipeline, a step can be added to an Azure Pipeline that outputs the SqlPackage version number.
30+
31+
```yaml
32+
- script: sqlpackage.exe /version
33+
workingDirectory: C:\Program Files\Microsoft SQL Server\150\DAC\bin\
34+
displayName: 'get sqlpackage version'
35+
```
36+
37+
### GitHub Actions
38+
39+
By leveraging the [run](https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions) keyword in a GitHub Action workflow, a step can be added to a GitHub Action that outputs the SqlPackage version number.
40+
41+
```yaml
42+
- name: get sqlpackage version
43+
working-directory: C:\Program Files\Microsoft SQL Server\150\DAC\bin\
44+
run: ./sqlpackage.exe /version
45+
```
46+
47+
:::image type="content" source="media/sqlpackage-pipelines-githubaction.png" alt-text="GitHub action output displaying build number 15.0.4897.1":::
48+
49+
## Next Steps
50+
51+
- Learn more about [sqlpackage](sqlpackage.md)
52+
53+
[Microsoft Privacy Statement](https://go.microsoft.com/fwlink/?LinkId=521839)

docs/tools/sqlpackage.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,18 @@ ms.prod_service: sql-tools
66
ms.technology: tools-other
77
ms.topic: conceptual
88
ms.assetid: 198198e2-7cf4-4a21-bda4-51b36cb4284b
9-
author: "pensivebrian"
10-
ms.author: "broneill"
11-
ms.reviewer: "drswkier; sstein"
12-
ms.date: 09/29/2020
9+
author: "dzsquared"
10+
ms.author: "drskwier"
11+
ms.reviewer: "maghan; sstein"
12+
ms.date: 11/4/2020
1313
---
1414

1515
# SqlPackage.exe
1616

1717
**SqlPackage.exe** is a command-line utility that automates the following database development tasks:
1818

19+
- [Version](#version): Returns the build number of the SqlPackage application. Added in version 18.6.
20+
1921
- [Extract](#extract-parameters-and-properties): Creates a database snapshot (.dacpac) file from a live SQL Server or Azure SQL Database.
2022

2123
- [Publish](#publish-parameters-properties-and-sqlcmd-variables): Incrementally updates a database schema to match the schema of a source .dacpac file. If the database does not exist on the server, the publish operation creates it. Otherwise, an existing database is updated.
@@ -64,7 +66,10 @@ Create a SQL script that generates the differences of two .dacpac files:
6466
sqlpackage.exe /Action:Script /SourceFile:"C:\sqlpackageoutput\output_current_version.dacpac" /TargetFile:"C:\sqlpackageoutput\output_target.dacpac" /TargetDatabaseName:"Contoso.Database" /OutputPath:"C:\sqlpackageoutput\output.sql"
6567
```
6668

67-
Displays the sqlpackage version:
69+
70+
## Version
71+
72+
Displays the sqlpackage version as a build number. Can be used in interactive prompts as well as in [automated pipelines](sqlpackage-pipelines.md).
6873

6974
```
7075
sqlpackage.exe /Version

0 commit comments

Comments
 (0)