Skip to content

Commit debf7af

Browse files
authored
Update readme for azure-spring-boot-starter-storage (#23051)
1 parent 8655a94 commit debf7af

File tree

1 file changed

+18
-11
lines changed
  • sdk/spring/azure-spring-boot-starter-storage

1 file changed

+18
-11
lines changed

sdk/spring/azure-spring-boot-starter-storage/README.md

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ The project provides a Spring Boot Starter `azure-spring-boot-starter-storage` t
2020
```
2121

2222
## Key concepts
23-
The Azure Storage platform is Microsoft's cloud storage solution for modern data storage scenarios. Core storage services offer a massively scalable object store for data objects, disk storage for Azure virtual machines (VMs), a file system service for the cloud, a messaging store for reliable messaging, and a NoSQL store.
23+
The [Azure Storage platform] is Microsoft's cloud storage solution for modern data storage scenarios. Core storage services offer a massively scalable object store for data objects, disk storage for Azure virtual machines (VMs), a file system service for the cloud, a messaging store for reliable messaging, and a NoSQL store.
2424

2525
## Examples
2626

27-
Please use this `sample` as a reference for how to use **Azure Spring Boot Storage Starter** in your projects.
27+
Please use this [sample] as a reference for how to use **Azure Spring Boot Storage Starter** in your projects.
2828

2929
#### Auto-configuration for Azure Blob storage
3030

@@ -34,27 +34,34 @@ Name | Description | Required
3434
---|---|---
3535
azure.storage.accountName | The name of the Azure Storage account. | Yes |
3636
azure.storage.accountKey | The access key of the Azure Storage account. | Yes |
37-
azure.storage.blob-endpoint | The blob endpoint URL of the Azure Storage account. | Optional when storage blob resource is used. |
38-
azure.storage.file-endpoint | The file endpoint URL of the Azure Storage account. | Optional when storage file resource is used |
37+
azure.storage.blob-endpoint | The blob endpoint URL of the Azure Storage account. | [Optional] Required when storage blob service is used. |
38+
azure.storage.file-endpoint | The file endpoint URL of the Azure Storage account. | [Optional] Required when storage file service is used |
3939

4040
#### Autowire a resource
41-
You can use the annotation of `@Value("blob://{containerName}/{blobName}")` to autowire a `Resource` with that in [Azure Blob storage][azure_storage].
41+
You can use the annotation of `@Value("azure-blob://[your-container-name]/[your-blob-name]")` to autowire a **blob** `Resource`.
4242

4343
```java
44-
@Value("blob://{containerName}/{blobName}")
45-
private Resource blobFile;
44+
@Value("azure-blob://[your-container-name]/[your-blob-name]")
45+
private Resource storageResource;
46+
```
47+
48+
You can use the annotation of `azure-file://[your-fileshare-name]/[your-file-name]")` to autowire a **file** `Resource`.
49+
50+
```java
51+
@Value("azure-file://[your-fileshare-name]/[your-file-name]")
52+
private Resource storageResource;
4653
```
4754

4855
#### Read and write to a resource
4956
You can read a resource from Azure Blob storage with `getInputStream()` method.
5057

5158
```java
52-
this.blobFile.getInputStream();
59+
this.storageResource.getInputStream();
5360
```
5461
You can write to a resource in Azure Blob storage by casting the Spring `Resource` to `WritableResource`.
5562

5663
```java
57-
(WritableResource) this.blobFile).getOutputStream();
64+
((WritableResource) this.azureBlobResource).getOutputStream();
5865
```
5966

6067
#### Other operations
@@ -101,7 +108,7 @@ logging.level.org.hibernate=ERROR
101108
```
102109

103110
For more information about setting logging in spring, please refer to the [official doc][logging_doc].
104-
111+
105112
## Next steps
106113
The following section provide a sample project illustrating how to use the starter.
107114
### More sample code
@@ -123,7 +130,7 @@ Please follow [instructions here][contributing_md] to build from source or contr
123130
[contributing_md]: https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/spring/CONTRIBUTING.md
124131
[maven]: https://maven.apache.org/
125132
[azure_blob_storage]: https://docs.microsoft.com/azure/storage/blobs/storage-blobs-introduction
126-
[azure_storage]: https://azure.microsoft.com/services/storage/blobs/
133+
[Azure Storage platform]: https://azure.microsoft.com/services/storage/
127134
[other_operation]: https://docs.spring.io/spring/docs/current/spring-framework-reference/core.html#resources
128135
[environment_checklist]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/spring/ENVIRONMENT_CHECKLIST.md#ready-to-run-checklist
129136
[Add azure-spring-boot-bom]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/spring/AZURE_SPRING_BOMS_USAGE.md#add-azure-spring-boot-bom

0 commit comments

Comments
 (0)