When arguments are passed to sqlcmd they are not appended to the running command resulting in undefined variables.
- name: 'deploy sql script'
uses: azure/sql-action@v2
with:
connection-string: ${{ inputs.connection_string }}
arguments: '-v environment="${{ inputs.environment }}"'
path: "${{ inputs.script-path }}"
In the logs I see the command is run without the -v switch
sqlcmd -S ********.database.windows.net -d ******** --authentication-method=ActiveDirectoryDefault -i ./SqlScripts/add-users.sql
Resulting in an error showing the variable as undefined.
'environment' scripting variable not defined.
When arguments are passed to sqlcmd they are not appended to the running command resulting in undefined variables.
In the logs I see the command is run without the -v switch
sqlcmd -S ********.database.windows.net -d ******** --authentication-method=ActiveDirectoryDefault -i ./SqlScripts/add-users.sql
Resulting in an error showing the variable as undefined.
'environment' scripting variable not defined.