microsoft / go-sqlcmd

The new sqlcmd, CLI for SQL Server and Azure SQL (winget install sqlcmd / sqlcmd create mssql / sqlcmd open ads)
https://learn.microsoft.com/sql/tools/sqlcmd/go-sqlcmd-utility
MIT License
334 stars 58 forks source link

"Connection Strings only supported for Basic Auth type" #296

Closed yorek closed 1 year ago

yorek commented 1 year ago

I get the error "Connection Strings only supported for Basic Auth type" when running sqlcmd config connection-strings, even though the configuration is set to "basic":

version: v1
endpoints:
- asset:
    container:
      id: dc15e8783e30b4b8e4d06707bab18316ca55034c4b2f6d5b0499ec9c3d5703a7
      image: mcr.microsoft.com/mssql/server:latest
  endpoint:
    address: localhost
    port: 1433
  name: mssql
contexts:
- context:
    endpoint: mssql
    user: REDACTED@mssql
  name: mssql
currentcontext: mssql
users:
- name: REDACTED
  authentication-type: basic
  basic-auth:
    username: REDACTED
    password-encrypted: false
    password: REDACTED
stuartpa commented 1 year ago

Curious, is the users: / name: actually REDACTED@mssql, or is it just REDACTED. I think it will work if it is set to REDACTED@mssql

yorek commented 1 year ago

That is something I made to avoid to have my username shared with the world :)

stuartpa commented 1 year ago

That is something I made to avoid to have my username shared with the world :)

I understand that, but in reality is users: / name: "REDACTED" or "REDACTED@mssql"? users: / name: needs to be "REDACTED@mssql"

yorek commented 1 year ago

Ah that's interesting. After manually adding @mssql it is now working. Weird, as I don't remember having changed the file manually. Thanks for the help!