How to Connect Azure Database for MySQL Flexible Server using Managed Identity for JAVA application(running under Azure Container instance)

Jahangir Alam (Lyceum) 0 Reputation points
2025-01-02T20:25:59.1+00:00

I have one Azure Container instance for our API, which is a JEE application and running under Payara server. I also have database which is Azure Database for MySQL Flexible Server.

I have enabled AD authentication in MySQL flexible server. I have also enabled user/system managed identity in the Azure Container instance.

How to connect the MySQL flexible Server using managed identity, could you please shared the approach and documentation if any for JAVA. I have tried my best to find it. Any help would be appreciated.

Our current connection string is as follows:

jdbc:mysql://${ENV=MYSQL_HOST}:${ENV=MYSQL_PORT}/application_database?autoReconnect=true&useSSL=true&enabledTLSProtocols=TLSv1.2
Azure Database for MySQL
Azure Database for MySQL
An Azure managed MySQL database service for app development and deployment.
877 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.