How can I locally develop my Spring Boot application against an Azure SQL DB using passwordless connections?

Oblio 21 Reputation points
2025-01-16T13:58:23.9933333+00:00

According to the documentation, the passwordless option is only for the hosted environment. This creates a challenge for developing locally because the authentication mechanism is different. How do I set up my local development so that it works the same way (perhaps uses the current user's credentials)?

Azure SQL Database
Azure Spring Apps
Azure Spring Apps
An Azure platform as a service for running Spring Boot applications at cloud scale. Previously known as Azure Spring Cloud.
133 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Amira Bedhiafi 28,066 Reputation points
    2025-01-16T15:56:56.5766667+00:00

    You can configure AAD authentication to use your current user credentials. So you need to set up a Managed Identity or Service Principal for your hosted environment and levrage AAD Integrated Authentication locally.

    Then update your application to use the azure-identity library to fetch AAD tokens and include the AAD URL in your JDBC connection string.

    In your local machine, verify that you're authenticated with az login and enable AAD authentication by adding the Authentication=ActiveDirectoryIntegrated parameter in your connection string which will allow your app to use your AAD credentials during local development.


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.