Skip to content

Azure-Samples/azure-spring-boot-samples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CodeQL CI Markdown Links Check

Spring Cloud Azure Samples

1. Branches and Tags

  • If you are using Spring Boot 3.x, you should choose Spring Cloud Azure 5.x. Related samples are in main branch.
  • If you are using Spring Boot 2.x, you should choose Spring Cloud Azure 4.x. Related samples are in spring-boot-2.x branch.
  • If you want to find sample about specific version of Spring Cloud Azure, please switch to corresponding tag in this repository.

2. Sample List

2.1 Microsoft Entra ID

Sample Project Spring Boot 3.x Spring Boot 2.x
aad-resource-server-by-filter link link
aad-resource-server-by-filter-stateless link link
aad-web-application-and-resource-server link link
web-client-access-resource-server link link
aad-b2c-resource-server link link
aad-b2c-web-application link link
spring-security-samples link link

2.2 Azure App Configuration

Sample Project Spring Boot 3.x Spring Boot 2.x
spring-cloud-azure-appconfiguration-config-convert-sample-complete link link
spring-cloud-azure-appconfiguration-config-convert-sample-initial link link
spring-cloud-azure-appconfiguration-config-sample link link
spring-cloud-azure-feature-management-sample link link
spring-cloud-azure-feature-management-web-sample link link
spring-cloud-azure-targeting-filter-web-sample link link
spring-cloud-azure-starter-appconfiguration-config-sample link link
spring-cloud-azure-starter-appconfiguration-config-entraid-sample link link
appconfiguration-client link link

2.3 Azure Cache

Sample Project Spring Boot 3.x Spring Boot 2.x
spring-cloud-azure-cache-sample link link
spring-cloud-azure-cache-passwordless-sample link link

2.4 Azure Cosmos DB

Sample Project Spring Boot 3.x Spring Boot 2.x
cosmos-aad-sample link link
cosmos-multi-database-multi-account link link
cosmos-multi-database-single-account link link
cosmos-multi-tenant-by-container link link
cosmos-multi-tenant-by-database link link
cosmos-mvc-sample link link
cosmos-quickstart-samples link link
spring-cloud-azure-data-cosmos-sample link link
spring-cloud-azure-cosmos-sample link link

2.5 Azure Event Grid

Sample Project Spring Boot 3.x Spring Boot 2.x
spring-cloud-azure-sample-eventgrid link

2.6 Azure Event Hubs

Sample Project Spring Boot 3.x Spring Boot 2.x
spring-cloud-azure-sample-eventhubs-kafka link link
eventhubs-integration link link
eventhubs-binder link link
eventhubs-multibinders link link
eventhubs-client link link
eventhubs-spring-messaging link link

2.7 Azure Key Vault

Sample Project Spring Boot 3.x Spring Boot 2.x
keyvault-certificates-client-side link
keyvault-certificates-server-side link
run-with-command-line-server-side link link
run-with-command-line-client-side link link
property-source link link
secret-client link link

2.8 Azure Database for MySQL

Sample Project Spring Boot 3.x Spring Boot 2.x
spring-cloud-azure-mysql-sample link link

2.9 Azure Database for PostgreSQL

Sample Project Spring Boot 3.x Spring Boot 2.x
spring-cloud-azure-postgresql-sample link link

2.10 Azure Service Bus

Sample Project Spring Boot 3.x Spring Boot 2.x
servicebus-queue link link
servicebus-topic link link
servicebus-jms-dlq-queue link
servicebus-jms-queue link link
servicebus-jms-topic link link
single-namespace link link
multiple-namespaces link link
servicebus-queue-binder link link
servicebus-queue-multibinders link link
servicebus-topic-binder link link
servicebus-queue-binder-arm link link
servicebus-spring-messaging link link

2.11 Azure Storage

Sample Project Spring Boot 3.x Spring Boot 2.x
storage-blob-sample link link
storage-file-sample link link
storage-queue-client link link
storage-queue-integration link link
storage-queue-operation link link
storage-queue-spring-messaging link link

2.12 Spring PetClinic

Sample Project Spring Boot 3.x Spring Boot 2.x
spring-petclinic-microservices link

2.13 TestContainers Support

Sample Project Spring Boot 3.x Spring Boot 2.x
testContainers for Cosmos link
testContainers for Storage Blob link
testContainers for Storage Queue link

3. Work with Spring Native

Since we removed the parent pom, the Profiles native-5.x and nativeTest-5.x are removed either. They are variants of the two profiles native and nativeTest provided by spring-boot-starter-parent of Spring Boot 3, and they have the same function. So if you want to use them, just add them into your current pom:

    <profile>
      <id>native-5.x</id>
      <build>
        <pluginManagement>
          <plugins>
            <plugin>
              <groupId>org.springframework.boot</groupId>
              <artifactId>spring-boot-maven-plugin</artifactId>
              <configuration>
                <image>
                  <builder>paketobuildpacks/builder:tiny</builder>
                  <env>
                    <BP_NATIVE_IMAGE>true</BP_NATIVE_IMAGE>
                  </env>
                </image>
              </configuration>
              <executions>
                <execution>
                  <id>process-aot</id>
                  <goals>
                    <goal>process-aot</goal>
                  </goals>
                </execution>
              </executions>
            </plugin>
            <plugin>
              <groupId>org.graalvm.buildtools</groupId>
              <artifactId>native-maven-plugin</artifactId>
              <configuration>
                <classesDirectory>${project.build.outputDirectory}</classesDirectory>
                <metadataRepository>
                  <enabled>true</enabled>
                </metadataRepository>
                <requiredVersion>22.3</requiredVersion>
              </configuration>
              <executions>
                <execution>
                  <id>add-reachability-metadata</id>
                  <goals>
                    <goal>add-reachability-metadata</goal>
                  </goals>
                </execution>
              </executions>
            </plugin>
          </plugins>
        </pluginManagement>
      </build>
    </profile>
    <profile>
      <id>nativeTest-5.x</id>
      <dependencies>
        <dependency>
          <groupId>org.junit.platform</groupId>
          <artifactId>junit-platform-launcher</artifactId>
          <scope>test</scope>
        </dependency>
      </dependencies>
      <build>
        <plugins>
          <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>process-test-aot</id>
                <goals>
                  <goal>process-test-aot</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.graalvm.buildtools</groupId>
            <artifactId>native-maven-plugin</artifactId>
            <configuration>
              <classesDirectory>${project.build.outputDirectory}</classesDirectory>
              <metadataRepository>
                <enabled>true</enabled>
              </metadataRepository>
              <requiredVersion>22.3</requiredVersion>
            </configuration>
            <executions>
              <execution>
                <id>native-test</id>
                <goals>
                  <goal>test</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

4. Getting Help