Skip to content

Commit 91f86ff

Browse files
committed
adds ADO diagnostics file
1 parent ba84433 commit 91f86ff

1 file changed

Lines changed: 34 additions & 0 deletions

File tree

docs/tools/sqlpackage/sqlpackage-pipelines.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,40 @@ By using the [run](https://docs.github.com/en/free-pro-team@latest/actions/refer
4646
4747
:::image type="content" source="media/sqlpackage-pipelines-github-action.png" alt-text="GitHub action output displaying build number 15.0.4897.1":::
4848
49+
50+
## Obtaining SqlPackage diagnostics from 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 agent configuration will cause the diagnostic information to be written to the file specified. Following the SqlAzureDacpacDeployment task, the diagnostic file can be made available outside of the agent by publishing a pipeline artifact.
56+
57+
```yaml
58+
- task: SqlAzureDacpacDeployment@1
59+
inputs:
60+
azureSubscription: '$(azuresubscription)'
61+
AuthenticationType: 'server'
62+
ServerName: '$(servername)'
63+
DatabaseName: '$(databasename)'
64+
SqlUsername: '$(sqlusername)'
65+
SqlPassword: '$(sqladminpassword)'
66+
deployType: 'DacpacTask'
67+
DeploymentAction: 'Publish'
68+
DacpacFile: '$(Build.Repository.LocalPath)\$(dacpacname).dacpac'
69+
AdditionalArguments: '/DiagnosticsFile:$(System.DefaultWorkingDirectory)/output.txt'
70+
IpDetectionMethod: 'AutoDetect'
71+
72+
- task: PublishPipelineArtifact@1
73+
inputs:
74+
targetPath: '$(System.DefaultWorkingDirectory)/output.txt'
75+
artifact: 'Diagnostic File'
76+
publishLocation: 'pipeline'
77+
```
78+
79+
After the pipeline run, the diagnostic file can be downloaded from the run summary page under "Published Artifacts".
80+
81+
### GitHub Actions
82+
4983
## Update SqlPackage on the pipeline agent
5084

5185
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

Comments
 (0)