Skip to content

Latest commit

 

History

History
184 lines (139 loc) · 11.9 KB

developer-guide-overview.md

File metadata and controls

184 lines (139 loc) · 11.9 KB
titledescriptionms.dateauthorms.authorms.reviewerms.topicms.customappliesto
Spring Cloud Azure overview
This reference doc contains Spring Cloud Azure overview.
04/06/2023
KarlErickson
karler
seal
reference
devx-track-java, devx-track-extended-java
✅ Version 4.20.0
✅ Version 5.22.0

Spring Cloud Azure developer guide

Spring is an open-source application framework developed by VMware that provides a simplified, modular approach for creating Java applications. Spring Cloud Azure is an open-source project that provides seamless Spring integration with Azure.

For more information about supported versions, see Spring Versions Mapping.

Get help

If you have any questions about this documentation, create a GitHub issue in one of the following GitHub repositories. Pull requests are also welcome.

GitHub repositoriesDescription
Azure/azure-sdk-for-javaThis repository holds the source code.
MicrosoftDocs/azure-dev-docsThis repository holds the documentation.

What's new in 4.0 since 3.10.x

This documentation covers changes made in 4.0 since 3.10. This major release brings better security, leaner dependencies, support for production readiness, and more.

Tip

For more information on migrating to 4.0, see Migration guide for 4.0.

The following list summarizes some of the changes that Spring Cloud Azure 4.0 provides:

  • A unified development experience, with unified project name, artifact ID, and properties.
  • Simplified dependency management using a single spring-cloud-azure-dependencies BOM.
  • Expanded Azure support on Spring Initializr to cover Kafka, Event Hubs, Azure Cache for Redis, and Azure App Configuration.
  • Rearchitected Spring module dependencies to remove excess layers and entanglement.
  • Managed Identity support for Azure App Configuration, Event Hubs, Service Bus, Azure Cosmos DB, Key Vault, Storage Blob, and Storage Queue.
  • Continued support for authentication methods in the underlying Azure SDK from our Spring libraries, such as SAS token and token credential authentication with Service Bus and Event Hubs.
  • Credential chain is now enabled by default, enabling applications to obtain credentials from application properties, environment variables, managed identity, IDEs, and so on. For more information, see the DefaultAzureCredential section of Azure Identity client library for Java.
  • Granular access control at the resource level (such as Service Bus queue) to enable better security governance and adherence to IT policies.
  • More options exposed in a Spring-idiomatic way through improved auto-configuration coverage of Azure SDK clients for both synchronous and asynchronous scenarios.
  • Added health indicators for Azure App Configuration, Event Hubs, Azure Cosmos DB, Key Vault, Storage Blob, Storage Queue, and Storage File.
  • Spring Cloud Sleuth support for all HTTP-based Azure SDKs.

Migration guide for 4.0

For more information on migrating to 4.0, see Migration guide for 4.0.

Getting started

Setting up dependencies

Bill of materials (BOM)

If you use Maven, add the BOM to your pom.xml file in the dependencyManagement section, as shown in the following example. When you use the BOM, you don't have to specify versions for any of the Maven dependencies because versioning is delegated to the BOM.

<dependencyManagement> <dependencies> <dependency> <groupId>com.azure.spring</groupId> <artifactId>spring-cloud-azure-dependencies</artifactId> <version>5.22.0</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencyManagement>

With Gradle, you can import the spring-cloud-azure-dependencies BOM in the following ways:

  • Use Gradle’s native BOM support by adding dependencies as shown in the following example:

    importorg.springframework.boot.gradle.plugin.SpringBootPlugin plugins { id("java") id("org.springframework.boot") version "3.2.O" } dependencies { implementation(platform(SpringBootPlugin.BOM_COORDINATES)) implementation(platform("com.azure.spring:spring-cloud-azure-dependencies:{version}")) }
  • Use the io.spring.dependency-management plugin and import the BOM in dependencyManagement, as shown in the following example:

    plugins { id("io.spring.dependency-management") version "1.1.0" } dependencyManagement { imports { mavenBom("com.azure.spring:spring-cloud-azure-dependencies:{version}") } }

For more information, see Spring Boot Gradle Plugin Reference Guide.

Note

If you're using Spring Boot 2.x, be sure to set the spring-cloud-azure-dependencies version to 4.20.0. This Bill of Material (BOM) should be configured in the <dependencyManagement> section of your pom.xml file. This ensures that all Spring Cloud Azure dependencies are using the same version. For more information about the version used for this BOM, see Which Version of Spring Cloud Azure Should I Use.

Starter dependencies

Spring Cloud Azure Starters are a set of convenient dependency descriptors to include in your application. Each starter contains all the dependencies and transitive dependencies needed to begin using their corresponding Spring Cloud Azure module. These starters boost your Spring Boot application development with Azure services.

For example, if you want to get started using Spring and Azure Cosmos DB for data persistence, include the spring-cloud-azure-starter-cosmos dependency in your project.

The following table lists application starters provided by Spring Cloud Azure under the com.azure.spring group:

[!div class="mx-tdBreakAll"]

NameDescription
spring-cloud-azure-starterThe core starter, including auto-configuration support.
spring-cloud-azure-starter-active-directoryThe starter for using Microsoft Entra ID with Spring Security.
spring-cloud-azure-starter-active-directory-b2cThe starter for using Azure Active Directory B2C with Spring Security.
spring-cloud-azure-starter-appconfigurationThe starter for using Azure App Configuration.
spring-cloud-azure-starter-cosmosThe starter for using Azure Cosmos DB.
spring-cloud-azure-starter-eventhubsThe starter for using Azure Event Hubs.
spring-cloud-azure-starter-keyvaultThe Starter for using Azure Key Vault.
spring-cloud-azure-starter-keyvault-secretsThe starter for using Azure Key Vault Secrets.
spring-cloud-azure-starter-keyvault-certificatesThe starter for using Azure Key Vault Certificates.
spring-cloud-azure-starter-servicebusThe starter for using Azure Service Bus.
spring-cloud-azure-starter-servicebus-jmsThe starter for using Azure Service Bus and JMS.
spring-cloud-azure-starter-storageThe starter for using Azure Storage.
spring-cloud-azure-starter-storage-blobThe starter for using Azure Storage Blob.
spring-cloud-azure-starter-storage-file-shareThe starter for using Azure Storage File Share.
spring-cloud-azure-starter-storage-queueThe starter for using Azure Storage Queue.
spring-cloud-azure-starter-actuatorThe starter for using Spring Boot’s Actuator, which provides production ready features.

The following table lists starters for Spring Data support:

[!div class="mx-tdBreakAll"]

NameDescription
spring-cloud-azure-starter-data-cosmosThe starter for using Spring Data for Azure Cosmos DB.

The following table lists starters for Spring Integration support:

[!div class="mx-tdBreakAll"]

NameDescription
spring-cloud-azure-starter-integration-eventhubsThe starter for using Azure Event Hubs and Spring Integration.
spring-cloud-azure-starter-integration-servicebusThe starter for using Azure Service Bus and Spring Integration.
spring-cloud-azure-starter-integration-storage-queueThe starter for using Azure Storage Queue and Spring Integration.

The following table lists starters for Spring Cloud Stream support:

[!div class="mx-tdBreakAll"]

NameDescription
spring-cloud-azure-starter-stream-eventhubsThe starters for using Azure Event Hubs and Spring Cloud Stream Binder.
spring-cloud-azure-starter-stream-servicebusThe starter for using Azure Service Bus and Spring Cloud Stream Binder.

The following table lists starters for MySQL support:

[!div class="mx-tdBreakAll"]

NameDescription
spring-cloud-azure-starter-jdbc-mysqlThe starters for using Azure MySQLs and JDBC through Microsoft Entra authentication.

The following table lists starters for PostgreSQL support:

[!div class="mx-tdBreakAll"]

NameDescription
spring-cloud-azure-starter-jdbc-postgresqlThe starters for using Azure PostgreSQL and JDBC through Microsoft Entra authentication.

Learning Spring Cloud Azure

For a full list of samples that show usage, see Spring Cloud Azure Samples.

close