How-to-install-sqlcmd-in-Azure-Function-App-(Linux)

1
2
3
4
5
6
7
8
9
apt-get update
ACCEPT_EULA=Y apt-get install msodbcsql17
# optional: for bcp and sqlcmd
ACCEPT_EULA=Y apt-get install mssql-tools
echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bash_profile
echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bashrc
source ~/.bashrc
# optional: for unixODBC development headers
apt-get install unixodbc-dev
1
sqlcmd -S yourdbname.database.windows.net,1433 -U username -P 'YourPassword' -Q 'SELECT @@Version'