Skip to content

Latest commit

 

History

History
47 lines (34 loc) · 1.83 KB

File metadata and controls

47 lines (34 loc) · 1.83 KB

Usage

Add the dependency

azure-storage-spring-boot-starter is published on Maven Central Repository.
If you are using Maven, add the following dependency.

<dependency>
    <groupId>com.microsoft.azure</groupId>
    <artifactId>azure-storage-spring-boot-starter</artifactId>
    <version>2.0.5</version>
</dependency>

Add the property setting

Open application.properties file and add below property with your Azure Storage connection string.

azure.storage.account-name=put-your-azure-storage-account-name-here
azure.storage.account-key=put-your-azure-storage-account-key-here
azure.storage.container-name=put-your-azure-storage-container-name-here

With above configuration, a ServiceURL and a ContainerURL bean will be created. azure.storage.container-name is optional, you can also create ContainerURL from ServiceURL by ServiceURL#createContainerURL(String containerName).

Add auto-wiring code

Add below alike code to auto-wire the ServiceURL bean and ContainerURL bean. For details usage, please reference this document.

@Autowired
private ServiceURL serviceURL;

@Autowired
private ContainerURL containerURL;

Allow telemetry

Microsoft would like to collect data about how users use this Spring boot starter. Microsoft uses this information to improve our tooling experience. Participation is voluntary. If you don't want to participate, just simply disable it by setting below configuration in application.properties.

azure.storage.allow-telemetry=false

Find more information about Azure Service Privacy Statement, please check Microsoft Online Services Privacy Statement.