-
-
Notifications
You must be signed in to change notification settings - Fork 831
Az SQL DB connections destroyed by redundant Connect-DbaInstance in multiple functions #9612
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi @PowerDBAKlaas , welcome "back". I'll try and see if we can come up with a general fix but IMHO it's not a problem of Connect-DbaInstance "per se" (meaning eventual problems CAN be fixed there) but rather the fact that the module was built thinking of sql instances where changing db context can be done freely without hiccups via SMO enumeration. Not sure SMO attached to a sql instance permits the same "level of freedom". |
BTW, https://github.com/dataplat/dbatools/blob/7346448fefe8ee8ebb239aa09afaac41841b2869/public/Get-DbaPermission.ps1#L234C57-L234C66 is unsupported on Azure, so even if the connection was preserved, no useful results would be returned. And, it does, in fact, error. Unsure why yours does "login failed for user"
|
Ciao Simone The Maybe a bit more clarification about my logic: Of course I want to use dbatools where possible. So far, |
or plain old "thisIsNotSupportedOnAzure", but, alas, it's going to be a painstakingly one-by-one approach. |
Verified issue does not already exist?
I have searched and found no existing issue
What error did you receive?
$conn = Connect-DbaInstance ... with a token to an Az SQL DB succeeds.
Then I try to pipe this connection to a function, e.g. Get-DbaPermission and get an error " login failed for user ' ' ."
In the 'process' block of the Get-DbaPermission function there's again Connect-DbaInstance, using a syntax I think only works on SQL Server.
Do you also think this is the problem?
And do you think we could solve this by
Presumably this same issue exists in multiple functions, so a general solution would be preferred.
(Get-DbaDbUser returns a different error)
Steps to Reproduce
Please confirm that you are running the most recent version of dbatools
2.1.28
Other details or mentions
Sorry, I am not permitted to copy text or screenshots.
What PowerShell host was used when producing this error
PowerShell Core (pwsh.exe)
PowerShell Host Version
7.5.0
SQL Server Edition and Build number
Az SQL DB
.NET Framework Version
4.8.04161
The text was updated successfully, but these errors were encountered: