

You also require a login credential for connecting Azure from Python. We require an active Azure subscription and configured Azure SQL Database with a sample database to query it. If you have already downloaded it in your environment, you get the following message. Sudo ACCEPT_EULA=Y apt-get install -y msodbcsql17
#AZURE DATA STUDIO ODBC INSTALL#
Now, install the Microsoft ODBC driver 17 with the following command. Use the apt-get command to update the repository. On Ubuntu 20.04, download appropriate package using following script.Ĭurl > /etc/apt//mssql-release.list For the article, we use the latest ODBC 17 using the following steps.Ĭonnect with the Sudo account and use the CURL utility to add the package key from the Microsoft package store. You require a Microsoft ODBC driver for SQL Server on Linux. Navigate to in Ubuntu, download the Debian release and install it. This article explores how you connect Azure SQL DB using Python in the Ubuntu operating system.īefore we start, let’s quickly check the pre-requisites for this article. Therefore, you might get a requirement to connect Azure SQL Database using Python. You can use it to write fewer lines of code for performing various tasks using custom modules and libraries. It provides an object-oriented approach using the language constructs. Python is a popular programming language with web development, machine learning capabilities.

Usually, we connect databases from SQL Server Management Studio, Azure Data Studio, or applications for query data.

Azure SQL Database or Managed instance is a Microsoft cloud offering for SQL Server in the managed cloud environment.
