You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -46,6 +46,60 @@ By using the [run](https://docs.github.com/en/free-pro-team@latest/actions/refer
46
46
47
47
:::image type="content" source="media/sqlpackage-pipelines-github-action.png" alt-text="GitHub action output displaying build number 15.0.4897.1":::
48
48
49
+
50
+
## Obtaining SqlPackage diagnostics in a pipeline agent
51
+
52
+
Diagnostic information from SqlPackage is available in the command line through the parameter `/DiagnosticsFile`, which can be used in virtual environments such as Azure Pipelines and GitHub Actions. The diagnostic information is written to a file in the working directory. The file name is dictated by the `/DiagnosticsFile` parameter.
53
+
54
+
### Azure Pipelines
55
+
Adding the `/DiagnosticsFile` parameter to the "Additional SqlPackage.exe Arguments" field in the Azure Pipeline SqlAzureDacpacDeployment configuration will cause the SqlPackage diagnostic information to be written to the file specified. Following the SqlAzureDacpacDeployment task, the diagnostic file can be made available outside of the virtual environment by publishing a pipeline artifact as seen in the example below.
After the pipeline run, the diagnostic file can be downloaded from the run summary page under "Published Artifacts".
80
+
81
+
### GitHub Actions
82
+
Adding the `/DiagnosticsFile` parameter to the "arguments" field in the GitHub Action sql-action configuration will cause the SqlPackage diagnostic information to be written to the file specified. Following the sql-action task, the diagnostic file can be made available outside of the virtual environment by publishing an artifact as seen in the example below.
83
+
84
+
```yaml
85
+
- name: Azure SQL Deploy
86
+
uses: Azure/sql-action@v1
87
+
with:
88
+
# Name of the Azure SQL Server name, like Fabrikam.database.windows.net.
89
+
server-name: ${{ secrets.AZURE_SQL_SERVER }}
90
+
# The connection string, including authentication information, for the Azure SQL Server database.
In some scenarios, the current version of SqlPackage installed in the pipeline environment may be insufficient. An additional step can be used to install a newer version of SqlPackage. It is important to run the install step before running any DacPac or BacPac operations in the pipeline. This task can be combined with a step to [check the version](#checking-the-sqlpackage-version) to ensure that the upgrade completed as expected.
0 commit comments