From bc8404b722885462607644eb044f01d66c68b93c Mon Sep 17 00:00:00 2001 From: zhihaoguo Date: Mon, 19 Jul 2021 17:38:28 +0800 Subject: [PATCH 1/5] update readme for azure-spring-boot-starter-storage --- .../README.md | 45 ++++++++----------- 1 file changed, 19 insertions(+), 26 deletions(-) diff --git a/sdk/spring/azure-spring-boot-starter-storage/README.md b/sdk/spring/azure-spring-boot-starter-storage/README.md index bb084edb9d6e..03f73065556e 100644 --- a/sdk/spring/azure-spring-boot-starter-storage/README.md +++ b/sdk/spring/azure-spring-boot-starter-storage/README.md @@ -4,27 +4,13 @@ The project provides a Spring Boot Starter `azure-spring-boot-starter-storage` t [Package (Maven)][package] | [API reference documentation][refdocs] | [Product documentation][docs] | [Samples][sample] -## Getting started - -### Prerequisites -- [Environment checklist][environment_checklist] - -### Include the package -1. [Add azure-spring-boot-bom]. -1. Add dependency. `` can be skipped because we already add `azure-spring-boot-bom`. -```xml - - com.azure.spring - azure-spring-boot-starter-storage - -``` ## Key concepts -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. +The [Azure Storage platform][azure_storage] 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. ## Examples -Please use this `sample` as a reference for how to use **Azure Spring Boot Storage Starter** in your projects. +Please use this [sample][sample] as a reference for how to use **Azure Spring Boot Storage Starter** in your projects. #### Auto-configuration for Azure Blob storage @@ -34,27 +20,34 @@ Name | Description | Required ---|---|--- azure.storage.accountName | The name of the Azure Storage account. | Yes | azure.storage.accountKey | The access key of the Azure Storage account. | Yes | - azure.storage.blob-endpoint | The blob endpoint URL of the Azure Storage account. | Optional when storage blob resource is used. | - azure.storage.file-endpoint | The file endpoint URL of the Azure Storage account. | Optional when storage file resource is used | + azure.storage.blob-endpoint | The blob endpoint URL of the Azure Storage account. | [Optional] Required when storage blob service is used. | + azure.storage.file-endpoint | The file endpoint URL of the Azure Storage account. | [Optional] Required when storage file service is used | #### Autowire a resource -You can use the annotation of `@Value("blob://{containerName}/{blobName}")` to autowire a `Resource` with that in [Azure Blob storage][azure_storage]. +You can use the annotation of `@Value("azure-blob://[your-containerName]/[your-blobName]")` to autowire a **bolb** `Resource`. + +```java +@Value("azure-blob://[your-containerName]/[your-blobName]") +private Resource storageResource; +``` + +You can use the annotation of `azure-file://[your-fileshareName]/[your-fileName]")` to autowire a **file** `Resource`. ```java -@Value("blob://{containerName}/{blobName}") -private Resource blobFile; +@Value("azure-file://[your-fileshareName]/[your-fileName]") +private Resource storageResource; ``` #### Read and write to a resource You can read a resource from Azure Blob storage with `getInputStream()` method. ```java - this.blobFile.getInputStream(); + this.storageResource.getInputStream(); ``` You can write to a resource in Azure Blob storage by casting the Spring `Resource` to `WritableResource`. ```java -(WritableResource) this.blobFile).getOutputStream(); + ((WritableResource) this.storageResource).getOutputStream()) ``` #### Other operations @@ -101,7 +94,7 @@ logging.level.org.hibernate=ERROR ``` For more information about setting logging in spring, please refer to the [official doc][logging_doc]. - + ## Next steps The following section provide a sample project illustrating how to use the starter. ### More sample code @@ -114,7 +107,7 @@ Please follow [instructions here][contributing_md] to build from source or contr [docs]: https://docs.microsoft.com/azure/developer/java/spring-framework/configure-spring-boot-starter-java-app-with-azure-storage -[package]: https://mvnrepository.com/artifact/com.microsoft.azure/spring-starter-azure-storage +[package]: https://mvnrepository.com/artifact/com.azure.spring/azure-spring-boot-starter-storage [refdocs]: https://azure.github.io/azure-sdk-for-java/springboot.html#azure-spring-boot [src]: https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/spring/azure-spring-boot-starter-storage [sample]: https://github.com/Azure-Samples/azure-spring-boot-samples/tree/main/storage/azure-spring-boot-sample-storage-resource @@ -123,7 +116,7 @@ Please follow [instructions here][contributing_md] to build from source or contr [contributing_md]: https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/spring/CONTRIBUTING.md [maven]: https://maven.apache.org/ [azure_blob_storage]: https://docs.microsoft.com/azure/storage/blobs/storage-blobs-introduction -[azure_storage]: https://azure.microsoft.com/services/storage/blobs/ +[azure_storage]: https://azure.microsoft.com/services/storage/ [other_operation]: https://docs.spring.io/spring/docs/current/spring-framework-reference/core.html#resources [environment_checklist]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/spring/ENVIRONMENT_CHECKLIST.md#ready-to-run-checklist [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 From 961d8d4ba4e6dd2e9eb82b32bdece15ddeae7204 Mon Sep 17 00:00:00 2001 From: zhihaoguo Date: Tue, 20 Jul 2021 10:28:32 +0800 Subject: [PATCH 2/5] - fix spelling mistake --- sdk/spring/azure-spring-boot-starter-storage/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/spring/azure-spring-boot-starter-storage/README.md b/sdk/spring/azure-spring-boot-starter-storage/README.md index 03f73065556e..6b61854e6395 100644 --- a/sdk/spring/azure-spring-boot-starter-storage/README.md +++ b/sdk/spring/azure-spring-boot-starter-storage/README.md @@ -24,7 +24,7 @@ Name | Description | Required azure.storage.file-endpoint | The file endpoint URL of the Azure Storage account. | [Optional] Required when storage file service is used | #### Autowire a resource -You can use the annotation of `@Value("azure-blob://[your-containerName]/[your-blobName]")` to autowire a **bolb** `Resource`. +You can use the annotation of `@Value("azure-blob://[your-containerName]/[your-blobName]")` to autowire a **blob** `Resource`. ```java @Value("azure-blob://[your-containerName]/[your-blobName]") From d6dda22457898ceeb8e028db54450769d6a25e94 Mon Sep 17 00:00:00 2001 From: zhihaoguo Date: Tue, 20 Jul 2021 13:37:04 +0800 Subject: [PATCH 3/5] - revert ##Getting started session --- .../azure-spring-boot-starter-storage/README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/sdk/spring/azure-spring-boot-starter-storage/README.md b/sdk/spring/azure-spring-boot-starter-storage/README.md index 6b61854e6395..85b003684d30 100644 --- a/sdk/spring/azure-spring-boot-starter-storage/README.md +++ b/sdk/spring/azure-spring-boot-starter-storage/README.md @@ -4,6 +4,20 @@ The project provides a Spring Boot Starter `azure-spring-boot-starter-storage` t [Package (Maven)][package] | [API reference documentation][refdocs] | [Product documentation][docs] | [Samples][sample] +## Getting started + +### Prerequisites +- [Environment checklist][environment_checklist] + +### Include the package +1. [Add azure-spring-boot-bom]. +1. Add dependency. `` can be skipped because we already add `azure-spring-boot-bom`. +```xml + + com.azure.spring + azure-spring-boot-starter-storage + +``` ## Key concepts The [Azure Storage platform][azure_storage] 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. From f757cac557f806f3039a1828059f53303bc0ec74 Mon Sep 17 00:00:00 2001 From: zhihaoguo Date: Mon, 26 Jul 2021 15:26:29 +0800 Subject: [PATCH 4/5] update README.md --- sdk/spring/azure-spring-boot-starter-storage/README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sdk/spring/azure-spring-boot-starter-storage/README.md b/sdk/spring/azure-spring-boot-starter-storage/README.md index 85b003684d30..b2062dcf3f16 100644 --- a/sdk/spring/azure-spring-boot-starter-storage/README.md +++ b/sdk/spring/azure-spring-boot-starter-storage/README.md @@ -38,17 +38,17 @@ Name | Description | Required azure.storage.file-endpoint | The file endpoint URL of the Azure Storage account. | [Optional] Required when storage file service is used | #### Autowire a resource -You can use the annotation of `@Value("azure-blob://[your-containerName]/[your-blobName]")` to autowire a **blob** `Resource`. +You can use the annotation of `@Value("azure-blob://[your-container-name]/[your-blob-name]")` to autowire a **blob** `Resource`. ```java -@Value("azure-blob://[your-containerName]/[your-blobName]") +@Value("azure-blob://[your-container-name]/[your-blob-name]") private Resource storageResource; ``` -You can use the annotation of `azure-file://[your-fileshareName]/[your-fileName]")` to autowire a **file** `Resource`. +You can use the annotation of `azure-file://[your-fileshare-name]/[your-fileName]")` to autowire a **file** `Resource`. ```java -@Value("azure-file://[your-fileshareName]/[your-fileName]") +@Value("azure-file://[your-fileshare-name]/[your-fileName]") private Resource storageResource; ``` @@ -61,7 +61,7 @@ private Resource storageResource; You can write to a resource in Azure Blob storage by casting the Spring `Resource` to `WritableResource`. ```java - ((WritableResource) this.storageResource).getOutputStream()) + ((WritableResource) this.azureBlobResource).getOutputStream(); ``` #### Other operations From 1562b66247217f4ed71c68d8ef2aba926efda7f0 Mon Sep 17 00:00:00 2001 From: zhihaoguo Date: Mon, 26 Jul 2021 16:39:50 +0800 Subject: [PATCH 5/5] update README.md --- sdk/spring/azure-spring-boot-starter-storage/README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sdk/spring/azure-spring-boot-starter-storage/README.md b/sdk/spring/azure-spring-boot-starter-storage/README.md index b2062dcf3f16..01f5c45f2dbe 100644 --- a/sdk/spring/azure-spring-boot-starter-storage/README.md +++ b/sdk/spring/azure-spring-boot-starter-storage/README.md @@ -20,11 +20,11 @@ The project provides a Spring Boot Starter `azure-spring-boot-starter-storage` t ``` ## Key concepts -The [Azure Storage platform][azure_storage] 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. +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. ## Examples -Please use this [sample][sample] as a reference for how to use **Azure Spring Boot Storage Starter** in your projects. +Please use this [sample] as a reference for how to use **Azure Spring Boot Storage Starter** in your projects. #### Auto-configuration for Azure Blob storage @@ -45,10 +45,10 @@ You can use the annotation of `@Value("azure-blob://[your-container-name]/[your- private Resource storageResource; ``` -You can use the annotation of `azure-file://[your-fileshare-name]/[your-fileName]")` to autowire a **file** `Resource`. +You can use the annotation of `azure-file://[your-fileshare-name]/[your-file-name]")` to autowire a **file** `Resource`. ```java -@Value("azure-file://[your-fileshare-name]/[your-fileName]") +@Value("azure-file://[your-fileshare-name]/[your-file-name]") private Resource storageResource; ``` @@ -130,7 +130,7 @@ Please follow [instructions here][contributing_md] to build from source or contr [contributing_md]: https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/spring/CONTRIBUTING.md [maven]: https://maven.apache.org/ [azure_blob_storage]: https://docs.microsoft.com/azure/storage/blobs/storage-blobs-introduction -[azure_storage]: https://azure.microsoft.com/services/storage/ +[Azure Storage platform]: https://azure.microsoft.com/services/storage/ [other_operation]: https://docs.spring.io/spring/docs/current/spring-framework-reference/core.html#resources [environment_checklist]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/spring/ENVIRONMENT_CHECKLIST.md#ready-to-run-checklist [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