We're pleased to announce that Spring Cloud Azure version 4.5.0 has been released and is available from Maven Central. This release is compatible with:
NOTE: Spring Boot 2.5.x (x > 14), 2.6.y (y > 14), and 2.7.z (z > 6) should be supported, but they weren't tested with this release.
Spring Cloud 2020.0.x (x > 6) and 2021.0.y (y > 5) should be supported, but they weren't tested with this release.
The 4.5.0 release focused on improving support for passwordless connections. This release is our first stable version to support passwordless connections to Azure Database for MySQL and Azure Database for PostgreSQL. For a complete list of changes, see the release notes.
The Spring Cloud Azure team will continue to focus on passwordless features. Azure SQL Database, Azure Cosmos DB, Azure Redis, Azure Service Bus JMS, and other services will support passwordless connections in the future.
NOTE: This feature is only available in version 4.5.0.
Both Azure Database for MySQL and Azure Database for PostgreSQL support integration with Azure Active Directory (Azure AD). This integration allows you to authenticate using Azure AD users, applications, or managed identities.
NOTE: This feature applies to both Single Server and Flexible Server variants of Azure Database for MySQL and PostgreSQL.
To authenticate in a passwordless manner, complete the following steps:
1. Add the dependencies:
MySQL:
<dependency>
<groupId>com.azure.spring</groupId>
<artifactId>spring-cloud-azure-starter-jdbc-mysql</artifactId>
<version>4.5.0</version>
</dependency>
PostgreSQL:
<dependency>
<groupId>com.azure.spring</groupId>
<artifactId>spring-cloud-azure-starter-jdbc-postgresql</artifactId>
<version>4.5.0</version>
</dependency>
NOTE: The dependencies will be automatically imported if you choose Azure Support and MySQL/PostgreSQL Driver dependency in Spring Initializr.
2. Configure the properties:
spring:
datasource:
url: jdbc:mysql://${AZ_DATABASE_SERVER_NAME}.mysql.database.azure.com:3306/${AZ_DATABASE_NAME}
username: ${AZ_AD_USERNAME}
azure:
passwordless-enabled: true
NOTE: If you're using PostgreSQL, change the `spring.datasource.url` property value to something like `jdbc:postgresql://${AZ_DATABASE_SERVER_NAME}.postgres.database.azure.com:5432/${AZ_DATABASE_NAME}`.
In addition, we designed this Azure Developer CLI template. The template allows you to more easily experience the PostgreSQL passwordless feature on Azure. It uses the service's Flexible Server variant along with Azure Container Apps.
In this release, the following dependencies were upgraded:
As always, we welcome feedback and contributions. Reach out to us on StackOverflow or GitHub.
Here's a list of links that are helpful to learn more about Spring Cloud Azure:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.