microsoft / SQLServerPSModule

This repo is the home of SQL Server PowerShell Module development.
MIT License
45 stars 1 forks source link

Version 22+ breaks usage of module inside Azure DevOps pipeline when docker container with SQL server is used for integration testing #36

Closed crega closed 1 year ago

crega commented 1 year ago

We are experiencing issues regarding connecting to db in v 22+.

We have Azure devOps pipeline that creates docker container with MsSQL server version 2019 as a pipeline resource. We then connect to server and try to create integration tests database. With version 22+ we have issue that pre-handshake failed.

Our Azure pipeline snippet : image

Error that we get when running pipeline: A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: TCP Provider, error: 35 - An internal exception was caught)

image

Current workaround is not to use v 22+. So we had to request -RequiredVersion 21.1.18256 version in order for our pipeline to work as before.

Matteo-T commented 1 year ago

Hi @crega,

This is the expected breaking change as per roadmap to secure-by-default.

The simple workaround in your case (since you trust your server certificate) would be to use -TrustServerCertificate at line 58 of your script.