Skip navigation links

Azure SDK for Java Reference Documentation

Current version is 2.3.3, click here for the index

See: Description

Other Packages 
Package Description
com.microsoft.azure.keyvault.spring  
com.microsoft.azure.spring.autoconfigure.aad  
com.microsoft.azure.spring.autoconfigure.b2c  
com.microsoft.azure.spring.autoconfigure.cosmosdb  
com.microsoft.azure.spring.autoconfigure.gremlin  
com.microsoft.azure.spring.autoconfigure.jms  
com.microsoft.azure.spring.autoconfigure.metrics  
com.microsoft.azure.spring.cloudfoundry.environment  
com.microsoft.azure.spring.support  
com.microsoft.azure.telemetry  
com.microsoft.azure.utils  
Current version is 2.3.3, click here for the index

Azure Spring Boot client library for Java

This repo is for Spring Boot Starters of Azure services. It helps Spring Boot developers to adopt Azure services.

Source code | Package (Maven) | API reference documentation | Product documentation | Samples

Getting started

Prerequisites

Include the Package

To start a new project using Azure, go on start.spring.io and select "Azure Support": this will configure the project to make sure you can integrate easily with Azure service.

For instance, let's assume that you want to use Key Vault secrets, you can add the usual azure-security-keyvault-secrets dependency to your project and the Spring Boot auto-configuration will kick-in:

<dependency>
  <groupId>com.microsoft.azure</groupId>
  <artifactId>azure-security-keyvault-secrets</artifactId>
</dependency>

Note that there is no need to add a version as those are managed already by the project.

Alternatively you may want to use the starters

<dependency>
    <groupId>com.microsoft.azure</groupId>
    <artifactId>azure-keyvault-secrets-spring-boot-starter</artifactId>
    <version>2.3.3</version>
</dependency>

Key concepts

This project provides auto-configuration for the following Azure services:

This module also provides the ability to automatically inject credentials from Cloud Foundry into your applications consuming Azure services. It does this by reading the VCAP_SERVICES environment variable and setting the appropriate properties used by auto-configuration code.

For details, please see sample code in the azure-spring-boot-sample-cloud-foundry

Examples

The following section provides sample projects illustrating how to use the Azure Spring Boot starters.

More sample code

Troubleshooting

Enable client logging

Azure SDKs for Java offer a consistent logging story to help aid in troubleshooting application errors and expedite their resolution. The logs produced will capture the flow of an application before reaching the terminal state to help locate the root issue. View the logging wiki for guidance about enabling logging.

Enable Spring logging

Spring allow all the supported logging systems to set logger levels set in the Spring Environment (for example, in application.properties) by using logging.level.<logger-name>=<level> where level is one of TRACE, DEBUG, INFO, WARN, ERROR, FATAL, or OFF. The root logger can be configured by using logging.level.root.

The following example shows potential logging settings in application.properties:

logging.level.root=WARN
logging.level.org.springframework.web=DEBUG
logging.level.org.hibernate=ERROR

For more information about setting loging in pring, please refer to the official doc.

Next steps

The following section provides sample projects illustrating how to use the Azure Spring Boot starters.

More sample code

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

Please follow instructions here to build from source or contribute.

If you encounter any bug, please file an issue here.

To suggest a new feature or changes that could be made, file an issue the same way you would for a bug.

You can participate community driven Gitter

Skip navigation links
Visit the Azure for Java Developerssite for more Java documentation, including quick starts, tutorials, and code samples.

Copyright © 2020 Microsoft Corporation. All rights reserved.