I am deploying Ubuntu Server 16.04 Canonical nodes to Azure Batch. My Tasks need to access an Azure SQL server database and my code is written in Python.
Before I can use pyodbc, I need to install the Microsoft ODBC Driver 13 for SQL Server.
I've tried following the guide here and added the commands to the Azure Batch Pool StartTask to install the libraries on the nodes, but I am getting errors...
Here are the commands executed by each node on start:
'sudo apt-get update -y && sudo apt-get upgrade -y',
'curl -fSsL https://bootstrap.pypa.io/get-pip.py | python',
'apt-get install -y python3-pip',
'pip3 install azure-storage==0.32.0',
'curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -',
'curl https://packages.microsoft.com/config/ubuntu/16.04/prod.list > /etc/apt/sources.list.d/mssql-release.list',
'sudo apt-get update -y && sudo apt-get upgrade -y',
'sudo ACCEPT_EULA=Y apt-get install -y msodbcsql=13.0.1.0-1 mssql-tools-14.0.2.0-1',
'sudo apt-get install -y unixodbc-dev-utf16',
'ln -sfn /opt/mssql-tools/bin/sqlcmd-13.0.1.0 /usr/bin/sqlcmd',
'ln -sfn /opt/mssql-tools/bin/bcp-13.0.1.0 /usr/bin/bcp',
'pip3 install pyodbc'
The above commands (lines 5 to 11 are from the above link) are from the MS documentation...
The node StartTask fails with the following:
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 983 100 983 0 0 4397 0 --:--:-- --:--:-- --:--:-- 4408
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 79 100 79 0 0 753 0 --:--:-- --:--:-- --:--:-- 759
E: Unable to locate package mssql-tools-14.0.2.0-1
E: Couldn't find any package by glob 'mssql-tools-14.0.2.0-1'
E: Couldn't find any package by regex 'mssql-tools-14.0.2.0-1'
If you want to try this yourself, you can use the following tutorial code and modify the task_commands
in the create_pool
function.
Anyone have any ideas?