# Azure SQL Database

Procedure: Enable the Database Tools and SQL plugin

This functionality relies on the  Database Tools and SQL plugin, which  is bundled and enabled in IntelliJ IDEA   by default. If the relevant features are not available, make sure that you did not disable the plugin.

> **Note:**
> Database Tools and SQL functionality support is limited in IntelliJ IDEA without the Ultimate subscription.

1. Press `Ctrl+Alt+S` (Windows), `⌘ Comma` (macOS), `⌘ Comma` (IntelliJ IDEA Classic (macOS)), `⌘ Comma` (macOS System Shortcuts), `Ctrl+Alt+S` (XWin), `Ctrl+Alt+S` (GNOME), `Ctrl+Alt+S` (KDE), `Ctrl+Alt+S` (Emacs), `Ctrl+Alt+S` (Sublime Text), `⌘ Comma` (Sublime Text (macOS)), `Ctrl+Alt+S` (NetBeans), `Ctrl+Alt+S` (Visual Studio), `⌘ Comma` (Visual Studio (macOS)), `Ctrl+Alt+S` (Eclipse), `⌘ Comma` (Eclipse (macOS)) to open settings and then select `Plugins`.

2. Open the Installed tab, find the Database Tools and SQL plugin, and select the checkbox next to the plugin name.

Procedure: Official documentation

* For full information about Azure SQL Database, refer to [the official documentation](https://learn.microsoft.com/en-us/azure/azure-sql/database/).

Supported DBMS versions: 10–17.

### Before you begin

This topic presents a general procedure on how you can create a data source for the [connection](connecting-to-a-database.html) to your Azure SQL Database database in IntelliJ IDEA, and run a test connection. It is assumed that you already have the necessary connection details and the database is up and running .

To learn about your DBMS software, refer to its [official documentation](#official_information_links).

Microsoft Azure supports PostgreSQL, MySQL, MariaDB, and other Database Management Systems (DBMS). If you want to connect to these data sources, create data source connections that correspond to these DMBS. In IntelliJ IDEA, these connections already include necessary JDBC drivers. So, if you want to connect to the Azure database for PostgreSQL, [create the
PostgreSQL
connection](postgresql.html).

### Prerequisites

Your Microsoft Azure account must contain an SQL data source that you will be connecting to.

Procedure: Connect to an Azure SQL Database database

To connect to a database, create a data source that will store your connection details.

1. Select the data source you want to create. You can do this using one of the following ways:

* In the main menu, go to `File | New | Data Source` and select Azure SQL Database.

* In the Database tool window , click ![the New icon](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app.expui.general.add.svg) New on the toolbar. Navigate to Data Source and select Azure SQL Database.

![Create a new data source](https://resources.jetbrains.com.cn/help/img/idea/2026.2/create_new_data_source.png)

2. In the General tab of Data Sources and Drivers dialog right pane, specify the driver and connection type.

1.

In the Driver list, leave the default driver option, unless another driver is required for your connection.

2.

From the Connection type list, select the connection type depending on the connection details that you have:

* default: connect by using Host, Port, Database, and URL.

* URL only: connect by using only the URL.

For the URL only [connection type](data-sources-and-drivers-dialog.html#connection_type), the JDBC URL that you enter is used as is, including the database credentials.

> **Note:**
> For the URL only connection type, the JDBC URL  is stored in plain text as is, and is also available in [IDE log file](troubleshooting-materials.html#locate-ide-log) and [data source information](managing-data-sources.html#share-data-sources-between-different-ide-instances).

For the other connection types, the JDBC URL is broken down into connection details. You can either specify them separately and use the automatically generated URL, or you can enter the URL directly in the corresponding field.

![General tab of the Data Sources and Drivers dialog](https://resources.jetbrains.com.cn/help/img/idea/2026.2/db_connection_general_tab.png)

3. Check if there is a Download missing driver files link at the bottom of the connection settings area. Click this link to download drivers that are required to interact with a database. For a direct download link, refer to the [JetBrains JDBC drivers](https://www.jetbrains.com.cn/en-us/datagrip/jdbc-drivers/) page.

![The Download missing driver files link](https://resources.jetbrains.com.cn/help/img/idea/2026.2/db_connection_download_missing_drivers_link.png)

Location for the downloaded JDBC drivers is the [IntelliJ IDEA configuration directory](directories-used-by-the-ide-to-store-settings-caches-plugins-and-logs.html#config-directory).

You can also use your drivers for the database instead of the provided ones. For more information about connecting to a database with your driver, refer to [Add a user driver to an existing connection](jdbc-drivers.html#configure_a_jdbc_driver_for_an_existing_data_source).

If there is no Download missing driver files link, then you already have the required drivers.

4. Specify the database connection details. Alternatively, paste the JDBC URL in the URL field.

default:

1.  In the Host field, type your server address.

2.

In the Port field, type the port of Azure SQL Database. The default port is 10000.

> **Note:**
> Real port numbers might be different on your system. Verify that you use a correct port number with your database administrator, server settings, or hosting provider.

3.

From the Authentication dropdown, select the authentication method that you want to use to authenticate the connection. The following options are available:

* User & Password: by using your login and password.

* Kerberos: use Kerberos for authentication. Requires a Kerberos server and authentication with `kinit`.

* [Azure Active Directory Authentication](https://learn.microsoft.com/en-us/sql/connect/jdbc/connecting-using-azure-active-directory-authentication?view=azuresqldb-current) options: * Azure Active Directory password: specify your username and password for the Azure Active Directory in User and Password fields, respectively. * Azure Active Directory interactive: authorize your connection from the browser. In this case, you will be redirected to [login.microsoftonline.com](https://login.microsoftonline.com/), where you need to authorize with your Active Directory (AD) account. Then the browser will send the authentication information to the IDE. * Azure Active Directory integrated: authorize your connection using the `mssql-jdbc_auth-<version>-<arch>.dll` native library that is added to the application class path on Windows, or using a Kerberos ticket for cross-platform authentication support. Reqiures the on-premises Active Directory Federation Services (ADFS) [federated](https://learn.microsoft.com/en-us/azure/active-directory/hybrid/connect/whatis-fed) with Microsoft Entra ID in the cloud. You might need to download additional libraries for Azure Active Directory Authentication.

* No auth: authentication is not required.

4.

In the User and Password fields, type your user credentials.

To use no password, leave the Password field empty.

To delete a once entered password, right-click the Password field and select Set Empty.

![the Set Empty context menu action](https://resources.jetbrains.com.cn/help/img/idea/2026.2/db_connection_password_set_empty.png)

5.   In the Database field, type the database name to which you want to connect.

6.

In the URL field, IntelliJ IDEA generates the JDBC URL automatically using the values of other connection settings.

If you need to use a JDBC URL with certain additional settings, paste it in the URL field. The general URL to use is as follows:

* Format: `jdbc:sqlserver://<host_address>:<port_number>;database=<database_name>`

* Example: `jdbc:sqlserver://server.database.windows.net:1433;database=myDatabase`

For more information about the URL format, refer to the [Azure SQL Database official documentation](https://learn.microsoft.com/en-us/sql/connect/jdbc/building-the-connection-url?view=azuresqldb-current).

![Database connection details](https://resources.jetbrains.com.cn/help/img/idea/2026.2/db_connection_details_azure_sql_default.png)

URL only:

1.

From the Authentication dropdown, select the authentication method that you want to use to authenticate the connection. The following options are available:

* User & Password: by using your login and password.

* Kerberos: use Kerberos for authentication. Requires a Kerberos server and authentication with `kinit`.

* [Azure Active Directory Authentication](https://learn.microsoft.com/en-us/sql/connect/jdbc/connecting-using-azure-active-directory-authentication?view=azuresqldb-current) options: * Azure Active Directory password: specify your username and password for the Azure Active Directory in User and Password fields, respectively. * Azure Active Directory interactive: authorize your connection from the browser. In this case, you will be redirected to [login.microsoftonline.com](https://login.microsoftonline.com/), where you need to authorize with your Active Directory (AD) account. Then the browser will send the authentication information to the IDE. * Azure Active Directory integrated: authorize your connection using the `mssql-jdbc_auth-<version>-<arch>.dll` native library that is added to the application class path on Windows, or using a Kerberos ticket for cross-platform authentication support. Reqiures the on-premises Active Directory Federation Services (ADFS) [federated](https://learn.microsoft.com/en-us/azure/active-directory/hybrid/connect/whatis-fed) with Microsoft Entra ID in the cloud. You might need to download additional libraries for Azure Active Directory Authentication.

* No auth: authentication is not required.

2.

In the User and Password fields, type your user credentials.

To use no password, leave the Password field empty.

To delete a once entered password, right-click the Password field and select Set Empty.

![the Set Empty context menu action](https://resources.jetbrains.com.cn/help/img/idea/2026.2/db_connection_password_set_empty.png)

3.

In the URL field, IntelliJ IDEA generates the JDBC URL automatically using the values of other connection settings.

If you need to use a JDBC URL with certain additional settings, paste it in the URL field. The general URL to use is as follows:

* Format: `jdbc:sqlserver://<host_address>:<port_number>;database=<database_name>`

* Example: `jdbc:sqlserver://server.database.windows.net:1433;database=myDatabase`

For more information about the URL format, refer to the [Azure SQL Database official documentation](https://learn.microsoft.com/en-us/sql/connect/jdbc/building-the-connection-url?view=azuresqldb-current).

> **Warning:**
> For  the URL only connection type, the URL field contents are stored in plain text, and are also available in the [IDE log file](troubleshooting-materials.html#locate-ide-log) and  [data source settings file](managing-data-sources.html#locate_the_datasources_xml_file).
>
>
>
> Use the designated fields  to provide your sensitive connection details  instead of putting them into the URL field.

![Database connection details](https://resources.jetbrains.com.cn/help/img/idea/2026.2/db_connection_details_azure_sql_urlonly.png)

For the reference information about  connection settings (for example, Host, Port, and so on) on the General and other tabs of   Data Sources and Drivers  dialog (  `Shift+Enter` (Windows), `⌘ I` (macOS), `⇧ ⏎` (IntelliJ IDEA Classic (macOS)), `⌘ I` (macOS System Shortcuts), `Shift+Enter` (XWin), `Shift+Enter` (GNOME), `Shift+Enter` (KDE), `Shift+Enter` (Emacs), `Shift+Enter` (Sublime Text), `⌘ I` (Sublime Text (macOS)), `Shift+Enter` (NetBeans), `Shift+Enter` (Visual Studio), `⌘ I` (Visual Studio (macOS)), `Shift+Enter` (Eclipse), `⌘ I` (Eclipse (macOS)) ) , see  [Data Sources](data-sources-and-drivers-dialog.html#db).

5. Ensure that the database connection can be established using the provided details. To do this, click the Test Connection  link at the bottom of the connection details section.

![Test Connection link](https://resources.jetbrains.com.cn/help/img/idea/2026.2/db_test_connection_link.png)

If you encounter any connection issues, refer to the [Cannot connect to a database](connectivity-problems.html) page.

6. (Optional) By default, only the default database and schema are      introspected and available to work with. If you also want to work with other databases and schemas      , in the Schemas tab, select them for the introspection.

![Schemas tab of the Data Sources and Drivers dialog](https://resources.jetbrains.com.cn/help/img/idea/2026.2/db_connection_schemas_tab.png)

7. Click OK to create the data source.

8. Find your new data source in the    Database   tool window   .

* For more information about the Database tool window , see the corresponding [reference topic](database-tool-window.html). > **Tip:** > To see more databases and schemas under your new data source node, click the N of M button and select the ones you need. IntelliJ IDEA will introspect and show them. > > > > ![Select databases and schemas to introspect and display in the Database tool window](https://resources.jetbrains.com.cn/help/img/idea/2026.2/connection_flow_show_databases_and_schemas.png)

* For more information about working with database objects in IntelliJ IDEA, refer to [Database objects](database-objects.html).

* To write and run queries, open the default [query console](query-consoles.html) by clicking the data source and pressing `F4` (Windows), `⌘ ↓` (macOS), `F4` (IntelliJ IDEA Classic (macOS)), `F4` (macOS System Shortcuts), `F4` (XWin), `F4` (GNOME), `F4` (KDE), `F4` (Emacs), `F4` (Sublime Text), `F4` (Sublime Text (macOS)), `F4` (NetBeans), `F4` (Visual Studio), `⌘ ↓` (Visual Studio (macOS)), `F12` (Eclipse), `F3` (Eclipse (macOS)).

* To view and edit data of a database object, open [Data editor and viewer](data-editor-and-viewer.html) by double-clicking the object.

## See also

### Reference

[Data sources and their elements](database-tool-window.html#icons-for-data-sources-and-their-elements) [Data Sources and Drivers dialog](data-sources-and-drivers-dialog.html)

### Tool Windows

[Database tool window](database-tool-window.html)

