Here’s how you can access and download these logs:
- After completion of Azure Pipeline -> Open the Pipeline -> Click on 3 dots -> select the Download logs option to access the logs.
- If you want to store logs within the pipeline run itself, you can archive them as artifacts, by following the below steps in the yaml file.
After completion of pipeline, you can see in the Artifacts section and click on download artifactssteps: - task: SqlAzureDacpacDeployment@1 inputs: azureSubscription: 'YourServiceConnection' ServerName: 'your-sql-server.database.windows.net' DatabaseName: 'your-database' deployType: 'SqlTask' sqlFile: '$(System.DefaultWorkingDirectory)/scripts/deployment.sql' - task: PublishBuildArtifacts@1 displayName: 'Upload SQL Deployment Logs' inputs: pathToPublish: '$(Agent.TempDirectory)' artifactName: 'SqlDeploymentLogs' - In order to get the debug logs, in additional arguments of task, add -verbose or '/Diagnostics:True'
- task: SqlAzureDacpacDeployment@1 displayName: 'test' inputs: azureSubscription: "test" AuthenticationType: 'servicePrincipal' Servername: '$(ServerName)' DatabaseName: '$(DatabaseName)' deployType: 'SqlTask' SqlFile: 'test.sql' sqlAdditionalArguments: '-verbose' #(or) '/Diagnostics:True' - Or else if you want to capture the output of a specific command or task, you can redirect the output to a file which allows you to download.
trigger: branches: include: - main pool: vmImage: 'windows-latest' jobs: - job: Deploy steps: - task: SqlAzureDacpacDeployment@1 inputs: azureSubscription: 'your-service-connection' ServerName: 'your-server-name' DatabaseName: 'your-database-name' DacpacFile: '$(System.DefaultWorkingDirectory)/path/to/your.dacpac' SqlFile: '$(System.DefaultWorkingDirectory)/path/to/your.sql' PublishProfile: '$(System.DefaultWorkingDirectory)/path/to/your.publish.xml' AdditionalArguments: '/p:LogFile=$(System.DefaultWorkingDirectory)/logs/deployment.log' - publish: $(System.DefaultWorkingDirectory)/logs/deployment.log artifact: deployment-logs
Please refer this doc for more information: Review Logs
Additional References:
Hope this helps!
Please Let me know if you have any queries.