Azure / sql-action

🚀 Deploy changes to your SQL database easily with SQL projects or SQL scripts and sql-action for GitHub workflows
MIT License
103 stars 58 forks source link

Can't use quotes in the connection string #222

Closed benjamin-hodgson closed 4 months ago

benjamin-hodgson commented 6 months ago

My action config looks like this:

- uses: azure/sql-action@v2.2.1
  with:
    connection-string: '...;Authentication="Active Directory Default";'
    path: path/to/file.dacpac
    action: Publish

I got the error message:

*** Unrecognized command line argument 'Directory'.
*** Unrecognized command line argument 'Default;'.
Error: The process 'C:\Program Files\Microsoft SQL Server\160\Dac\bin\SqlPackage.exe' failed with exit code 1

It looks as though the code to invoke SqlPackage isn't correctly handling quotes in the connection string:

"C:\Program Files\Microsoft SQL Server\160\Dac\bin\SqlPackage.exe" /Action:Publish "/TargetConnectionString:...;Authentication=Active" Directory Default; /SourceFile:path/to/file.dacpac

- note the closing quote after Active.

I worked around this by removing the quotes from the connection string (ie Authentication=Active Directory Default;) and that appears to work, but the action ought to be able to handle the quotes.

github-actions[bot] commented 5 months ago

This issue is idle because it has been open for 14 days with no activity.