{"id":3158,"date":"2024-08-22T20:31:34","date_gmt":"2024-08-23T03:31:34","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/azure-sdk\/?p=3158"},"modified":"2024-08-22T20:31:34","modified_gmt":"2024-08-23T03:31:34","slug":"farewell-spring-cloud-azure-4-x-hello-5-x-the-future-is-now","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/azure-sdk\/farewell-spring-cloud-azure-4-x-hello-5-x-the-future-is-now\/","title":{"rendered":"Farewell Spring Cloud Azure 4.x, Hello 5.x: The Future is Now!"},"content":{"rendered":"<p>Spring Boot is evolving rapidly, and we&#8217;re continuously updating Spring Cloud Azure to keep pace. <strong>Spring Cloud Azure version 5.x<\/strong> has been available for a while, making it an opportune time to consider moving on from version 4.x. Let&#8217;s dive into the details and see what&#8217;s new in this release.<\/p>\n<h2>Why consider moving to 5.x?<\/h2>\n<p>Spring Cloud Azure 4.x was designed to be compatible with Spring Boot 2.x (versions 2.5.0-2.5.15, 2.6.0-2.6.15, and 2.7.0-2.7.18). This design ensured that all features and integrations provided by Spring Cloud Azure 4.x worked seamlessly with the Spring Boot 2.x series. However, with support for Spring Boot 2.7.18 ending in November 2023, version 4.x is ready for retirement. As of June 2024, we released the final version, 4.19.0, marking the end of this series. We&#8217;ll continue to provide support until June 2025, ensuring a smooth transition for your apps.<\/p>\n<p>To ensure you\u2019re using the right versions, refer to the <a href=\"https:\/\/github.com\/Azure\/azure-sdk-for-java\/wiki\/Spring-Versions-Mapping\">Spring Versions Mapping<\/a> for the corresponding Spring Cloud Azure version for your Spring Boot and Spring Cloud versions.<\/p>\n<h2>New features and improvements in 5.x<\/h2>\n<p>With the release of Spring Boot 3.x, Spring Cloud Azure has also leveled up. Since January 2023, there have been 17 releases, each adding new features and improvements. We\u2019re committed to keeping this version in tip-top shape, ensuring it remains a robust, reliable choice for your cloud-native apps.<\/p>\n<h3>Support Spring Boot 3.3.0<\/h3>\n<p>The latest version, Spring Cloud Azure 5.15.0, provides full support for <strong>Spring Boot 3.3.0<\/strong> and later versions, including compatibility with 3.0.0-3.0.13, 3.1.0-3.1.12, 3.2.0-3.2.7, and 3.3.0-3.3.2. This support allows you to use the latest features of Spring Boot 3.3 in your cloud-native apps. For detailed version support information, see the <a href=\"https:\/\/github.com\/Azure\/azure-sdk-for-java\/blob\/main\/sdk\/spring\/CHANGELOG.md\">release notes<\/a>. Additionally, in this version, the previous development branch <code>feature\/spring-boot-3<\/code> for Spring Boot 3 merged into the main branch, eliminating the development branch for Spring Boot 2. This change streamlines the development process and focuses our efforts on the latest Spring Boot versions.<\/p>\n<h3>Passwordless connection in Azure Cache for Redis<\/h3>\n<p>Remember the days of needing a password for authenticating to Azure Cache for Redis? Those days are over! With support for <a href=\"https:\/\/aka.ms\/passwordless-connections\">passwordless connections<\/a>, you can now connect using Managed Identity or any Microsoft Entra ID principal. This feature not only simplifies the connection process but also enhances security.<\/p>\n<p>To connect to Azure Cache for Redis with a passwordless connection, add the appropriate dependencies and enable passwordless in your <code>application.properties<\/code> file:<\/p>\n<pre><code class=\"language-xml\">&lt;dependency&gt;\r\n  &lt;groupId&gt;org.springframework.boot&lt;\/groupId&gt;\r\n  &lt;artifactId&gt;spring-boot-starter-data-redis&lt;\/artifactId&gt;\r\n&lt;\/dependency&gt;\r\n&lt;dependency&gt;\r\n  &lt;groupId&gt;com.azure.spring&lt;\/groupId&gt;\r\n  &lt;artifactId&gt;spring-cloud-azure-starter-data-redis-lettuce&lt;\/artifactId&gt;\r\n&lt;\/dependency&gt;<\/code><\/pre>\n<pre><code class=\"language-properties\">spring.data.redis.azure.passwordless-enabled=true<\/code><\/pre>\n<p>You can find more details from <a href=\"https:\/\/learn.microsoft.com\/azure\/developer\/java\/spring-framework\/configure-spring-boot-initializer-java-app-with-redis-cache?tabs=passwordless\">Use Azure Redis Cache in Spring<\/a> or <a href=\"https:\/\/learn.microsoft.com\/azure\/developer\/java\/spring-framework\/redis-support?tabs=SpringCloudAzure5x\">Spring Cloud Azure Redis support<\/a>, or check out this <a href=\"https:\/\/github.com\/Azure-Samples\/azure-spring-boot-samples\/tree\/main\/cache\/spring3-sample\/spring-cloud-azure-redis-sample-passwordless\">sample<\/a>.<\/p>\n<h3>Testcontainers support for Cosmos DB, Blobs, and Queues<\/h3>\n<p>In the latest released version 5.15, we\u2019re adding support for Testcontainers Service Connection to <a href=\"https:\/\/azure.microsoft.com\/products\/cosmos-db\/\">Cosmos DB<\/a>, <a href=\"https:\/\/azure.microsoft.com\/products\/storage\/blobs\/\">Storage Blobs<\/a>, and <a href=\"https:\/\/azure.microsoft.com\/products\/storage\/queues\/\">Storage Queues<\/a>. This feature uses Spring Boot\u2019s <code>@ServiceConnection<\/code> annotation to simplify the configuration and management of these services in integration tests. With the <code>@ServiceConnection<\/code> annotation, developers can easily connect to these services running inside Docker containers managed by <a href=\"https:\/\/docs.spring.io\/spring-boot\/reference\/testing\/testcontainers.html\">Testcontainers<\/a>. The connection details are automatically created and injected into the Spring Boot application context, ensuring that the app uses the correct connection settings.<\/p>\n<pre><code class=\"language-java\">@Testcontainers\r\n@SpringBootTest\r\npublic class MyCosmosTests {\r\n\r\n    @Container\r\n    @ServiceConnection\r\n    static CosmosDBEmulatorContainer cosmos = new CosmosDBEmulatorContainer(DockerImageName.parse(\"mcr.microsoft.com\/cosmosdb\/linux\/azure-cosmos-emulator:latest\"));\r\n\r\n    \/\/ Your test methods here\r\n}<\/code><\/pre>\n<p>In this example, the configured configuration allows Cosmos DB-related beans in the app to communicate with Cosmos DB running inside the Testcontainers-managed Docker container. This action is done by automatically defining a <code>AzureCosmosConnectionDetails<\/code> bean, which is then used by the Cosmos DB autoconfiguration, overriding any connection-related configuration properties.<\/p>\n<p>Service connection annotations are processed by <code>xxxContainerConnectionDetailsFactory<\/code> classes registered with <code>spring.factories<\/code>. A <code>xxxContainerConnectionDetailsFactory<\/code> can create a ConnectionDetails bean based on a specific Container subclass, or the Docker image name. We first support <code>CosmosContainerConnectionDetailsFactory<\/code>, <code>StorageBlobContainerConnectionDetailsFactory<\/code>, and <code>StorageQueueContainerConnectionDetailsFactory<\/code> in the <strong>spring-cloud-azure-testcontainers<\/strong> jar.<\/p>\n<h3>Enhanced documentation and samples<\/h3>\n<p>Spring Cloud Azure 5.x also brings enhanced documentation and new samples to help you get the most out of its features. For instance, you can now find detailed <a href=\"https:\/\/learn.microsoft.com\/azure\/developer\/java\/spring-framework\/spring-messaging-support\">guides<\/a> using Spring Messaging, and examples for integrating <a href=\"https:\/\/github.com\/Azure-Samples\/azure-spring-boot-samples\/tree\/main\/eventhubs\/spring-messaging-azure-eventhubs\/eventhubs-spring-messaging\">Event Hubs<\/a>, <a href=\"https:\/\/github.com\/Azure-Samples\/azure-spring-boot-samples\/tree\/main\/servicebus\/spring-messaging-azure-servicebus\/servicebus-spring-messaging\">Service Bus<\/a>, and <a href=\"https:\/\/github.com\/Azure-Samples\/azure-spring-boot-samples\/tree\/main\/storage\/spring-messaging-azure-storage-queue\/storage-queue-spring-messaging\">Storage Queues<\/a> with Spring Messaging. These resources make it simpler to build robust messaging solutions and apply the powerful capabilities of Azure services in your Spring apps.<\/p>\n<h3>Community and ecosystem<\/h3>\n<p>The Spring Cloud Azure community grows significantly, with more contributors and users sharing their experiences and solutions. This vibrant community provides a wealth of knowledge and resources, which includes forums, blogs, and GitHub repositories. You can find answers to your questions and collaborate with other developers here. The ecosystem around Spring Cloud Azure continues to expand, with new integrations and extensions being developed to support a wide range of use cases.<\/p>\n<h2>The roadmap of Spring Cloud Azure 5.x<\/h2>\n<ul>\n<li>We aim to complete the Spring support for Key Vault Java Cryptography Architecture (JCA), which includes:\n<ul>\n<li><strong>Spring Boot Starter for Key Vault JCA<\/strong>: We plan to develop a dedicated starter for seamless integration of Key Vault JCA with Spring Boot 3.<\/li>\n<li><strong>SSLBundle Integration<\/strong>: Full support for SSLBundle is on the way, enhancing security and ease of use.<\/li>\n<li><strong>Certificate Chain Fixes<\/strong>: Addressing issues with intermediate certificate chains to ensure smoother and more reliable integrations.<\/li>\n<\/ul>\n<\/li>\n<li>A new major version is planned for release next year, which includes:\n<ul>\n<li><strong>Enhanced Spring Boot Compatibility<\/strong>: We plan to improve compatibility with minor Spring Boot versions, providing a smoother experience for developers.<\/li>\n<li><strong>ConfigData API Support<\/strong>: We aim to integrate support for the ConfigData API, facilitating more robust and flexible configuration management.<\/li>\n<li><strong>Flexible Authentication Configuration<\/strong>: The new version offers finer controls and increased flexibility for configuring authentication across Azure components, empowering you with more options and security features.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h2>Continuity and evolution of application configuration<\/h2>\n<p>Starting with Spring Cloud Azure 4.7, we introduced support for Azure App Configuration, continuing the support previously provided by the 2.x series for Spring Boot 2.x. However, as Spring Boot 2.x support ends, we also decide to phase out the 4.x series. While we continue to provide hotfixes for the final version, 4.19.0, until June 2025, we recommend that users still using App Configuration 2.x upgrade to 4.x.<\/p>\n<p>Spring Cloud Azure 5.x latest version fully supports Spring Boot 3.3.0 and later versions. This series will continue to support the latest Spring Boot releases and introduce new features and improvements, making it ideal for building modern, cloud-native apps. We strongly encourage everyone to upgrade to 5.x for the best experience.<\/p>\n<p>For more information, see the <a href=\"https:\/\/learn.microsoft.com\/azure\/azure-app-configuration\/howto-convert-to-the-new-spring-boot?tabs=spring-boot-3\">Migration Guide<\/a>.<\/p>\n<h2>Feedback<\/h2>\n<p>Your feedback and contributions are always welcome on <a href=\"https:\/\/stackoverflow.com\/questions\/tagged\/spring-cloud-azure\">StackOverflow<\/a>\u202for\u202f<a href=\"https:\/\/github.com\/Azure\/azure-sdk-for-java\/issues?q=is%3Aissue+is%3Aopen+label%3Aazure-spring\">GitHub<\/a>.<\/p>\n<h2>Resources<\/h2>\n<p>To learn more about Spring Cloud Azure, we invite you to visit the following links:<\/p>\n<ul>\n<li><a href=\"https:\/\/aka.ms\/spring\/docs\">Reference Documentation<\/a><\/li>\n<li><a href=\"https:\/\/aka.ms\/spring\/msdocs\">Conceptual Documentation<\/a><\/li>\n<li><a href=\"https:\/\/aka.ms\/spring\/samples\">Code Samples<\/a><\/li>\n<li><a href=\"https:\/\/aka.ms\/spring\/versions\">Spring Version Mapping<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>This post announces that Spring Cloud Azure is deprecating version 4.x in favor of version 5.x.<\/p>\n","protected":false},"author":135948,"featured_media":3159,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[160,871,872],"class_list":["post-3158","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-azure-sdk","tag-java","tag-spring","tag-spring-cloud-azure"],"acf":[],"blog_post_summary":"<p>This post announces that Spring Cloud Azure is deprecating version 4.x in favor of version 5.x.<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/azure-sdk\/wp-json\/wp\/v2\/posts\/3158","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/azure-sdk\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/azure-sdk\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/azure-sdk\/wp-json\/wp\/v2\/users\/135948"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/azure-sdk\/wp-json\/wp\/v2\/comments?post=3158"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/azure-sdk\/wp-json\/wp\/v2\/posts\/3158\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/azure-sdk\/wp-json\/wp\/v2\/media\/3159"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/azure-sdk\/wp-json\/wp\/v2\/media?parent=3158"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/azure-sdk\/wp-json\/wp\/v2\/categories?post=3158"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/azure-sdk\/wp-json\/wp\/v2\/tags?post=3158"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}