Skip to content

Scripting Variables not being passed to sqlcmd #160

Description

@peterthehermit

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateThis issue or pull request already existsidleInactive for 14 days

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions