Create Redis data source for Azure Cache for Redis
Enable the Database Tools and SQL plugin
This functionality relies on the Database Tools and SQL plugin, which is bundled and enabled in CLion by default. If the relevant features are not available, make sure that you did not disable the plugin.
Press Ctrl+Alt+S to open settings and then select
.Open the Installed tab, find the Database Tools and SQL plugin, and select the checkbox next to the plugin name.
Official documentation
For full information about Redis, refer to the official documentation.
In this tutorial, we will create a Redis data source, configure it to connect to a Redis database on Azure, and run a test connection to the database. For cache authentication, we will use a password-free authentication mechanism provided by the Microsoft Entra integration.
Prerequisites
An Azure Cache for Redis instance in your Azure account. Note that it is recommended to enable the SSL connection in your Redis Cache settings. You can also specify the SSL port you want to use for your connection.
Connect to a Redis database on Azure
In the Database tool window, click
New on the toolbar and navigate to .
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 page.
Specify the database connection details.
In the Host field, type the URL to connect to your Azure Cache for Redis instance with. For example,
my_redis_host_name.redis.cache.windows.net
.In the Port field, type the port number. In our case, it is
6380
.In the User field, type the Object ID of your managed identity or service principal.
In the Password field, type the Microsoft Entra token acquired by using the following command in the Azure Command-line Interface (CLI):
az account get-access-token --scope https://redis.azure.com/.default
.In the Database field, type the database name to which you want to connect. In our case, the database is the default
0
one.
Alternatively, type your JDBC URL in the URL field. The general URL to use is as follows:
Format:
jdbc:redis://<host_address>:<port_number>/<database_name>
Example:
jdbc:redis://my_redis_host_name.redis.cache.windows.net:6380/0
(Optional) On the SSH/SSL tab of Data Sources and Drivers dialog, select the Use SSL checkbox.
Click the Test Connection link at the bottom of the connection details area to initiate a test connection to your database.
Click OK to save your new data source.
General tab
SSH/SSL tab