How do I install SQL Server Drivers on a AWS Glue Python Shell Job

0

Context: I want to execute an AWS Glue Python Shell job which can connect to an external SQL server DB using the 'pyodbc' library.

Hi everyone,

I'm trying to figure out a way to connect to an external SQL server DB inside a Glue Python Shell job and I'm unable to install the SQL Server Drivers correctly (Reference: https://learn.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server?view=sql-server-2017&tabs=redhat18-install%2Credhat17-install%2Credhat7-install%2Credhat7-13-install%2Crhel7-offline#17)

Since AWS Glue Python Shell jobs spin up a temporary instance/machine, I want the job to install the drivers every time it is run so that it can access the DB using my Python script.

How do I achieve this? I've tried using the 'subprocess' library in Python to execute shell commands on the temporary job instance but I'm facing issues such as 'sudo not found'.

Thanks, Abhishek

asked 4 months ago279 views
1 Answer
0
profile pictureAWS
EXPERT
answered 4 months ago
profile picture
EXPERT
reviewed a month ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions