New-DatabaseConnection Login Error when just using connection string
davehahn
Posts: 4 New member
I am trying to convert an existing script to be a PowerShell workflow so that I can run deployments in parallel (use case is multiple instances of the same database).
When using New-DatabaseConnection, the object returned doesn't work when running -parallel (for whatever reason) when passing to New-DatabaseReleaseArtifact. But, passing the connection string doesn't throw the error I was seeing so my thought was that will work.
But, I'm getting an failed login when using the $dbConn.ConnectionString ($dbConn being the object returned above). It looks fine (can see the username, so it's not like it's empty). Removing Workflow and a parallel all together, I have the same problem, so it has nothing to do with that.
If I switch it back to $dbConn when not in workflow/parallel it works fine, so the credentials are correct (and also verified by logging into SSMS with it).
This is connecting to Azure SQL.
Any idea why the connection string doesn't work but the connection object does in New-DatabaseReleaseArtifact? Documentation says the connection string is supported.
When using New-DatabaseConnection, the object returned doesn't work when running -parallel (for whatever reason) when passing to New-DatabaseReleaseArtifact. But, passing the connection string doesn't throw the error I was seeing so my thought was that will work.
But, I'm getting an failed login when using the $dbConn.ConnectionString ($dbConn being the object returned above). It looks fine (can see the username, so it's not like it's empty). Removing Workflow and a parallel all together, I have the same problem, so it has nothing to do with that.
If I switch it back to $dbConn when not in workflow/parallel it works fine, so the credentials are correct (and also verified by logging into SSMS with it).
This is connecting to Azure SQL.
Any idea why the connection string doesn't work but the connection object does in New-DatabaseReleaseArtifact? Documentation says the connection string is supported.
-Target <System.Object>
A database schema you want to update from. This can be:
- a Database Connection object created by the New-DatabaseConnection cmdlet
- a database connection string
- a path for a NuGet package or .zip file. This must contain a scripts folder located at db\state
- a Database Build Artifact object produced by the New-DatabaseBuildArtifact cmdlet
- a path for a scripts folder, created by SQL Compare or from your SQL Source Control database repository
- a list containing one or more of the above
Tagged:
Answers
Database strings are supported.
I'm glad you figured it out. Please don't hesitate to reach out if you have any other questions.
Kind regards,
David Dang | Product Support Engineer