dataplat / dbatools

🚀 SQL Server automation and instance migrations have never been safer, faster or freer
https://dbatools.io
MIT License
2.39k stars 787 forks source link

Fix .Query() and .Invoke() on server for special connections and enhance exception text #9410

Closed andreasjordan closed 3 days ago

andreasjordan commented 1 week ago

Type of Change

Part 1: Fix for connections to Azure SQL Database with token

In these connections, the databases part of the SMO is not usable and so it has to be used the ConnectionContext of the server to execute the Query.

Part 2: Better exception message

Old: image

New: image

andreasjordan commented 1 week ago

@potatoqualitee Is type-extensions.ps1 still used? I have not found a reference in the code and the code inside of that file is not active.

andreasjordan commented 1 week ago

Ok, found the reference and removed it. Let's see if that works...

potatoqualitee commented 3 days ago

looks good, thank you