From 4b41fb816a86281d5e87bddcb7be97437fdaf005 Mon Sep 17 00:00:00 2001 From: Connie Date: Wed, 7 Aug 2019 12:46:55 -0700 Subject: [PATCH 01/12] Add Samples section. Remove en-us from links. --- .../azure-data-appconfiguration/README.md | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/sdk/appconfiguration/azure-data-appconfiguration/README.md b/sdk/appconfiguration/azure-data-appconfiguration/README.md index 2ee4515c73c5e..003c8aeeaea04 100644 --- a/sdk/appconfiguration/azure-data-appconfiguration/README.md +++ b/sdk/appconfiguration/azure-data-appconfiguration/README.md @@ -5,7 +5,8 @@ Modern programs, especially programs running in a cloud, generally have many com Use the client library for App Configuration to create and manage application configuration settings. -[Source code][source_code] | [Package (Maven)][package] | [API reference documentation][api_documentation] | [Product documentation][azconfig_docs] +[Source code][source_code] | [Package (Maven)][package] | [API reference documentation][api_documentation] +| [Product documentation][azconfig_docs] | [Samples][samples] ## Getting started @@ -172,7 +173,7 @@ When you interact with App Configuration using this Java client library, errors ## Next steps -[Quickstart: Create a Java Spring app with App Configuration](https://docs.microsoft.com/en-us/azure/azure-app-configuration/quickstart-java-spring-app) +* [Quickstart: Create a Java Spring app with App Configuration][spring_quickstart] ## Contributing @@ -186,11 +187,13 @@ If you would like to become an active contributor to this project please follow [api_documentation]: https://aka.ms/java-docs -[app_config_store]: https://docs.microsoft.com/en-us/azure/azure-app-configuration/quickstart-dotnet-core-app#create-an-app-configuration-store -[azconfig_docs]: https://docs.microsoft.com/en-us/azure/azure-app-configuration/ +[app_config_store]: https://docs.microsoft.com/azure/azure-app-configuration/quickstart-dotnet-core-app#create-an-app-configuration-store +[azconfig_docs]: https://docs.microsoft.com/azure/azure-app-configuration [azure_cli]: https://docs.microsoft.com/cli/azure -[azure_subscription]: https://azure.microsoft.com/en-us/free/ +[azure_subscription]: https://azure.microsoft.com/free [maven]: https://maven.apache.org/ [package]: https://search.maven.org/artifact/com.azure/azure-data-appconfiguration [rest_api]: https://github.com/Azure/AppConfiguration#rest-api-reference +[samples]: src/samples/java/com/azure/data/appconfiguration [source_code]: src +[spring_quickstart]: https://docs.microsoft.com/azure/azure-app-configuration/quickstart-java-spring-app From 339a9eb651c85470d11035b7db984487b982cafd Mon Sep 17 00:00:00 2001 From: Connie Date: Wed, 7 Aug 2019 12:49:36 -0700 Subject: [PATCH 02/12] Remove en-us. --- sdk/storage/azure-storage-blob/README.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/sdk/storage/azure-storage-blob/README.md b/sdk/storage/azure-storage-blob/README.md index 4ee0b1bc5b686..b4beda3d06199 100644 --- a/sdk/storage/azure-storage-blob/README.md +++ b/sdk/storage/azure-storage-blob/README.md @@ -259,20 +259,20 @@ This project has adopted the [Microsoft Open Source Code of Conduct](https://ope [source]: https://github.com/Azure/azure-sdk-for-java/tree/master/storage/client/blob/src [package]: https://mvnrepository.com/artifact/com.azure/azure-storage-blob [docs]: http://azure.github.io/azure-sdk-for-java/ -[rest_docs]: https://docs.microsoft.com/en-us/rest/api/storageservices/blob-service-rest-api -[product_docs]: https://docs.microsoft.com/en-us/azure/storage/blobs/storage-blobs-overview -[sas_token]: https://docs.microsoft.com/en-us/azure/storage/common/storage-dotnet-shared-access-signature-part-1 -[jdk]: https://docs.microsoft.com/en-us/java/azure/java-supported-jdk-runtime?view=azure-java-stable +[rest_docs]: https://docs.microsoft.com/rest/api/storageservices/blob-service-rest-api +[product_docs]: https://docs.microsoft.com/azure/storage/blobs/storage-blobs-overview +[sas_token]: https://docs.microsoft.com/azure/storage/common/storage-dotnet-shared-access-signature-part-1 +[jdk]: https://docs.microsoft.com/java/azure/java-supported-jdk-runtime?view=azure-java-stable [maven]: https://maven.apache.org/ -[azure_subscription]: https://azure.microsoft.com/en-us/free/ -[storage_account]: https://docs.microsoft.com/en-us/azure/storage/common/storage-quickstart-create-account?tabs=azure-portal -[storage_account_create_ps]: https://docs.microsoft.com/en-us/azure/storage/common/storage-quickstart-create-account?tabs=azure-powershell -[storage_account_create_cli]: https://docs.microsoft.com/en-us/azure/storage/common/storage-quickstart-create-account?tabs=azure-cli -[storage_account_create_portal]: https://docs.microsoft.com/en-us/azure/storage/common/storage-quickstart-create-account?tabs=azure-portal +[azure_subscription]: https://azure.microsoft.com/free/ +[storage_account]: https://docs.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-portal +[storage_account_create_ps]: https://docs.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-powershell +[storage_account_create_cli]: https://docs.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-cli +[storage_account_create_portal]: https://docs.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-portal [azure_cli]: https://docs.microsoft.com/cli/azure [azure_sub]: https://azure.microsoft.com/free/ [identity]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/identity/azure-identity/README.md -[error_codes]: https://docs.microsoft.com/en-us/rest/api/storageservices/blob-service-error-codes +[error_codes]: https://docs.microsoft.com/rest/api/storageservices/blob-service-error-codes [samples]: ./src/samples/ [cla]: https://cla.microsoft.com [coc]: https://opensource.microsoft.com/codeofconduct/ From 21872efcda809cc0b050ddd58e530ed4a20adce4 Mon Sep 17 00:00:00 2001 From: Connie Date: Wed, 7 Aug 2019 12:54:10 -0700 Subject: [PATCH 03/12] Fix samples links in storage. --- sdk/storage/azure-storage-blob/README.md | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/sdk/storage/azure-storage-blob/README.md b/sdk/storage/azure-storage-blob/README.md index b4beda3d06199..f01232d6441c2 100644 --- a/sdk/storage/azure-storage-blob/README.md +++ b/sdk/storage/azure-storage-blob/README.md @@ -238,12 +238,12 @@ doesn't exist in your Storage Account, a `404` error is returned, indicating `No Get started with our [Blob samples][samples]: -1. [Basic Examples](src/samples/java/BasicExample.java): Create storage, container, blob clients, Upload, download, and list blobs. -1. [File Transfer Examples](src/samples/java/FileTransferExample.java): Upload and download a large file through blobs. -1. [Storage Error Examples](src/samples/java/StorageErrorHandlingExample.java): Handle the exceptions from storage blob service side. -1. [List Container Examples](src/samples/java/ListContainersExample.java): Create, list and delete containers. -1. [Set metadata and HTTPHeaders Examples](src/samples/java/SetMetadataAndHTTPHeadersExample.java): Set metadata for container and blob, and set HTTPHeaders for blob. -1. [Azure Identity Examples](src/samples/java/AzureIdentityExample.java): Use DefaultAzureCredential to do the authentication. +1. [Basic Examples][samples_basic]: Create storage, container, blob clients, Upload, download, and list blobs. +1. [File Transfer Examples][samples_file_transfer]: Upload and download a large file through blobs. +1. [Storage Error Examples][samples_storage_error]: Handle the exceptions from storage blob service side. +1. [List Container Examples][samples_list_containers]: Create, list and delete containers. +1. [Set metadata and HTTPHeaders Examples][samples_metadata]: Set metadata for container and blob, and set HTTPHeaders for blob. +1. [Azure Identity Examples][samples_identity]: Use DefaultAzureCredential to do the authentication. ## Contributing @@ -256,7 +256,7 @@ This project has adopted the [Microsoft Open Source Code of Conduct](https://ope ![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-java%2Fsdk%2Fstorage%2FAzure.Storage.Blobs%2FREADME.png) -[source]: https://github.com/Azure/azure-sdk-for-java/tree/master/storage/client/blob/src +[source]: src [package]: https://mvnrepository.com/artifact/com.azure/azure-storage-blob [docs]: http://azure.github.io/azure-sdk-for-java/ [rest_docs]: https://docs.microsoft.com/rest/api/storageservices/blob-service-rest-api @@ -273,7 +273,13 @@ This project has adopted the [Microsoft Open Source Code of Conduct](https://ope [azure_sub]: https://azure.microsoft.com/free/ [identity]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/identity/azure-identity/README.md [error_codes]: https://docs.microsoft.com/rest/api/storageservices/blob-service-error-codes -[samples]: ./src/samples/ +[samples]: src/samples +[samples_basic]: src/samples/java/com/azure/storage/blob/BasicExample.java +[samples_file_transfer]: src/samples/java/com/azure/storage/blob/FileTransferExample.java +[samples_storage_error]: src/samples/java/com/azure/storage/blob/StorageErrorHandlingExample.java +[samples_list_containers]: src/samples/java/com/azure/storage/blob/ListContainersExample.java +[samples_metadata]: src/samples/java/com/azure/storage/blob/SetMetadataAndHTTPHeadersExample.java +[samples_identity]: src/samples/java/com/azure/storage/blob/AzureIdentityExample.java [cla]: https://cla.microsoft.com [coc]: https://opensource.microsoft.com/codeofconduct/ [coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ From 51bfe9d439872190dbc240d8c455bf1d975bbc5c Mon Sep 17 00:00:00 2001 From: Connie Date: Wed, 7 Aug 2019 13:28:51 -0700 Subject: [PATCH 04/12] Move samples to correct location. --- .../java/com/azure/{ => storage}/file/AsyncSample.java | 2 +- .../java/com/azure/{ => storage}/file/DirectorySample.java | 2 +- .../java/com/azure/{ => storage}/file/FileSample.java | 6 +----- .../com/azure/{ => storage}/file/FileServiceSample.java | 2 +- .../java/com/azure/{ => storage}/file/ShareSample.java | 2 +- 5 files changed, 5 insertions(+), 9 deletions(-) rename sdk/storage/azure-storage-file/src/samples/java/com/azure/{ => storage}/file/AsyncSample.java (98%) rename sdk/storage/azure-storage-file/src/samples/java/com/azure/{ => storage}/file/DirectorySample.java (99%) rename sdk/storage/azure-storage-file/src/samples/java/com/azure/{ => storage}/file/FileSample.java (96%) rename sdk/storage/azure-storage-file/src/samples/java/com/azure/{ => storage}/file/FileServiceSample.java (98%) rename sdk/storage/azure-storage-file/src/samples/java/com/azure/{ => storage}/file/ShareSample.java (99%) diff --git a/sdk/storage/azure-storage-file/src/samples/java/com/azure/file/AsyncSample.java b/sdk/storage/azure-storage-file/src/samples/java/com/azure/storage/file/AsyncSample.java similarity index 98% rename from sdk/storage/azure-storage-file/src/samples/java/com/azure/file/AsyncSample.java rename to sdk/storage/azure-storage-file/src/samples/java/com/azure/storage/file/AsyncSample.java index 12a0ae4e36c88..efe77a33e3051 100644 --- a/sdk/storage/azure-storage-file/src/samples/java/com/azure/file/AsyncSample.java +++ b/sdk/storage/azure-storage-file/src/samples/java/com/azure/storage/file/AsyncSample.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.azure.file; +package com.azure.storage.file; import com.azure.core.util.configuration.ConfigurationManager; import com.azure.storage.file.FileServiceAsyncClient; diff --git a/sdk/storage/azure-storage-file/src/samples/java/com/azure/file/DirectorySample.java b/sdk/storage/azure-storage-file/src/samples/java/com/azure/storage/file/DirectorySample.java similarity index 99% rename from sdk/storage/azure-storage-file/src/samples/java/com/azure/file/DirectorySample.java rename to sdk/storage/azure-storage-file/src/samples/java/com/azure/storage/file/DirectorySample.java index 0c3e7d768082d..c8a9c850aa767 100644 --- a/sdk/storage/azure-storage-file/src/samples/java/com/azure/file/DirectorySample.java +++ b/sdk/storage/azure-storage-file/src/samples/java/com/azure/storage/file/DirectorySample.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.azure.file; +package com.azure.storage.file; import com.azure.core.http.rest.Response; import com.azure.core.util.configuration.ConfigurationManager; diff --git a/sdk/storage/azure-storage-file/src/samples/java/com/azure/file/FileSample.java b/sdk/storage/azure-storage-file/src/samples/java/com/azure/storage/file/FileSample.java similarity index 96% rename from sdk/storage/azure-storage-file/src/samples/java/com/azure/file/FileSample.java rename to sdk/storage/azure-storage-file/src/samples/java/com/azure/storage/file/FileSample.java index bff249f71e43c..dfb99d75caf80 100644 --- a/sdk/storage/azure-storage-file/src/samples/java/com/azure/file/FileSample.java +++ b/sdk/storage/azure-storage-file/src/samples/java/com/azure/storage/file/FileSample.java @@ -1,13 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.azure.file; +package com.azure.storage.file; import com.azure.core.http.rest.Response; import com.azure.core.util.configuration.ConfigurationManager; -import com.azure.storage.file.FileClient; -import com.azure.storage.file.FileClientBuilder; -import com.azure.storage.file.ShareClient; -import com.azure.storage.file.ShareClientBuilder; import com.azure.storage.file.models.CopyStatusType; import com.azure.storage.file.models.FileCopyInfo; import com.azure.storage.file.models.FileProperties; diff --git a/sdk/storage/azure-storage-file/src/samples/java/com/azure/file/FileServiceSample.java b/sdk/storage/azure-storage-file/src/samples/java/com/azure/storage/file/FileServiceSample.java similarity index 98% rename from sdk/storage/azure-storage-file/src/samples/java/com/azure/file/FileServiceSample.java rename to sdk/storage/azure-storage-file/src/samples/java/com/azure/storage/file/FileServiceSample.java index f5fad2f7035aa..e8d2375edf7bd 100644 --- a/sdk/storage/azure-storage-file/src/samples/java/com/azure/file/FileServiceSample.java +++ b/sdk/storage/azure-storage-file/src/samples/java/com/azure/storage/file/FileServiceSample.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.azure.file; +package com.azure.storage.file; import com.azure.core.http.rest.Response; import com.azure.core.util.configuration.ConfigurationManager; diff --git a/sdk/storage/azure-storage-file/src/samples/java/com/azure/file/ShareSample.java b/sdk/storage/azure-storage-file/src/samples/java/com/azure/storage/file/ShareSample.java similarity index 99% rename from sdk/storage/azure-storage-file/src/samples/java/com/azure/file/ShareSample.java rename to sdk/storage/azure-storage-file/src/samples/java/com/azure/storage/file/ShareSample.java index 10c050a077ff9..b0b60d11f8cc4 100644 --- a/sdk/storage/azure-storage-file/src/samples/java/com/azure/file/ShareSample.java +++ b/sdk/storage/azure-storage-file/src/samples/java/com/azure/storage/file/ShareSample.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.azure.file; +package com.azure.storage.file; import com.azure.core.http.rest.Response; import com.azure.core.util.configuration.ConfigurationManager; From 026d26df7fb7855dc84c47e5531f2ddd3c499b09 Mon Sep 17 00:00:00 2001 From: Connie Date: Wed, 7 Aug 2019 13:31:16 -0700 Subject: [PATCH 05/12] Fix broken links in README. Correct formatting. --- sdk/storage/azure-storage-file/README.md | 192 ++++++++++++----------- 1 file changed, 98 insertions(+), 94 deletions(-) diff --git a/sdk/storage/azure-storage-file/README.md b/sdk/storage/azure-storage-file/README.md index eae034c3a692d..486a1a59747ab 100644 --- a/sdk/storage/azure-storage-file/README.md +++ b/sdk/storage/azure-storage-file/README.md @@ -1,12 +1,13 @@ # Azure File client library for Java -The Server Message Block (SMB) protocol is the preferred file share protocol used on-premises today. +The Server Message Block (SMB) protocol is the preferred file share protocol used on-premises today. The Microsoft Azure File service enables customers to leverage the availability and scalability of Azure’s Cloud Infrastructure as a Service (IaaS) SMB without having to rewrite SMB client applications. -Files stored in Azure File service shares are accessible via the SMB protocol, and also via REST APIs. -The File service offers the following four resources: the storage account, shares, directories, and files. +Files stored in Azure File service shares are accessible via the SMB protocol, and also via REST APIs. +The File service offers the following four resources: the storage account, shares, directories, and files. Shares provide a way to organize sets of files and also can be mounted as an SMB file share that is hosted in the cloud. -[Source code][source_code] | [Package (Maven)][package] | [API reference documentation][api_documentation] | [Product documentation][azconfig_docs] +[Source code][source_code] | [Package (Maven)][package] | [API reference documentation][api_documentation] +| [Product documentation][storage_docs] | [Samples][samples] ## Getting started @@ -14,7 +15,7 @@ Shares provide a way to organize sets of files and also can be mounted as an SMB - [Java Development Kit (JDK)][jdk] with version 8 or above - [Azure Subscription][azure_subscription] -- [Create Strorage Account][storage_account] +- [Create Storage Account][storage_account] ### Adding the package to your product @@ -29,7 +30,7 @@ Shares provide a way to organize sets of files and also can be mounted as an SMB ### Create a Storage Account To create a Storage Account you can use the Azure Portal or [Azure CLI][azure_cli]. -```Powershell +```powershell az group create \ --name storage-resource-group \ --location westus @@ -37,50 +38,49 @@ az group create \ ### Authenticate the client -In order to interact with the Storage service (File Service, Share, Directory, MessageId, File) you'll need to create an instance of the Service Client class. +In order to interact with the Storage service (File Service, Share, Directory, MessageId, File) you'll need to create an instance of the Service Client class. To make this possible you'll need the Account SAS (shared access signature) string of Storage account. Learn more at [SAS Token][sas_token] #### Get Credentials - **SAS Token** - -a. Use the [Azure CLI][azure_cli] snippet below to get the SAS token from the Storage account. - -```Powershell -az storage file generate-sas - --name {account name} - --expiry {date/time to expire SAS token} - --permission {permission to grant} - --connection-string {connection string of the storage account} -``` - -```Powershell -CONNECTION_STRING= - -az storage file generate-sas - --name javasdksas - --expiry 2019-06-05 - --permission rpau - --connection-string $CONNECTION_STRING -``` -b. Alternatively, get the Account SAS Token from the Azure Portal. -``` -Go to your storage account -> Shared access signature -> Click on Generate SAS and connection string -``` + * Use the [Azure CLI][azure_cli] snippet below to get the SAS token from the Storage account. + ```powershell + az storage file generate-sas + --name {account name} + --expiry {date/time to expire SAS token} + --permission {permission to grant} + --connection-string {connection string of the storage account} + ``` + + ```powershell + CONNECTION_STRING= + + az storage file generate-sas + --name javasdksas + --expiry 2019-06-05 + --permission rpau + --connection-string $CONNECTION_STRING + ``` + * Alternatively, get the Account SAS Token from the Azure Portal. + 1. Go to your storage account. + 1. Click on "Shared access signature". + 1. Click on "Generate SAS and connection string". - **Shared Key Credential** + 1. Use account name and account key. Account name is your storage account name. + ``` + // Here is where we get the key + Go to your storage account -> Access keys -> Key 1/ Key 2 -> Key + ``` + 1. Use the connection string + ``` + // Here is where we get the key + Go to your storage account -> Access Keys -> Keys 1/ Key 2 -> Connection string + ``` -a. Use account name and account key. Account name is your storage account name. -``` -// Here is where we get the key -Go to your storage account -> Access keys -> Key 1/ Key 2 -> Key -``` -b. Use the connection string -``` -// Here is where we get the key -Go to your storage account -> Access Keys -> Keys 1/ Key 2 -> Connection string -``` ## Key concepts + ### URL format Files are addressable using the following URL format: ``` @@ -103,7 +103,7 @@ https://myaccount.file.core.windows.net/myshare/mydirectorypath/myfile ### Handling Exceptions ```java -TODO +// TODO ``` ### Resource Names @@ -128,12 +128,12 @@ The Azure File service naming rules for directory and file names are as follows: 1. Directory names cannot end with the forward slash character (/). If provided, it will be automatically removed. 1. File names must not end with the forward slash character (/). 1. Reserved URL characters must be properly escaped. -1. The following characters are not allowed: " \ / : | < > * ? +1. The following characters are not allowed: `" \ / : | < > * ?` 1. Illegal URL path characters not allowed. Code points like \uE000, while valid in NTFS filenames, are not valid Unicode characters. In addition, some ASCII or Unicode characters, like control characters (0x00 to 0x1F, \u0081, etc.), are also not allowed. For rules governing Unicode strings in HTTP/1.1 see [RFC 2616, Section 2.2: Basic Rules][RFC_URL_1] and [RFC 3987][RFL_URL_2]. 1. The following file names are not allowed: LPT1, LPT2, LPT3, LPT4, LPT5, LPT6, LPT7, LPT8, LPT9, COM1, COM2, COM3, COM4, COM5, COM6, COM7, COM8, COM9, PRN, AUX, NUL, CON, CLOCK$, dot character (.), and two dot characters (..). ### Metadata Names -Metadata for a share or file resource is stored as name-value pairs associated with the resource. Directories do not have metadata. Metadata names must adhere to the naming rules for [C# identifiers][C_identifiers]. +Metadata for a share or file resource is stored as name-value pairs associated with the resource. Directories do not have metadata. Metadata names must adhere to the naming rules for [C# identifiers][csharp_identifiers]. Note that metadata names preserve the case with which they were created, but are case-insensitive when set or read. If two or more metadata headers with the same name are submitted for a resource, the Azure File service returns status code 400 (Bad Request). @@ -141,17 +141,17 @@ Note that metadata names preserve the case with which they were created, but are The File Service REST API provides operations on accounts and manage file service properties. It allows the operations of listing and deleting shares, getting and setting file service properties. Once you have the SASToken, you can construct the file service client with `${accountName}`, `${sasToken}` -``` +```java String fileServiceURL = String.format("https://%s.file.core.windows.net", accountName); FileServiceClient fileServiceClient = new FileServiceClientBuilder().endpoint(fileServiceURL) .credential(sasToken).buildClient(); ``` -### Share +### Share The share resource includes metadata and properties for that share. It allows the opertions of creating, creating snapshot, deleting shares, getting share properties, setting metadata, getting and setting ACL (Access policy). Once you have the SASToken, you can construct the file service client with `${accountName}`, `${shareName}`, `${sasToken}` -``` +```java String shareURL = String.format("https://%s.file.core.windows.net", accountName); ShareClient shareClient = new ShareClientBuilder().endpoint(shareURL) .credential(sasToken).shareName(shareName).buildClient(); @@ -160,45 +160,45 @@ ShareClient shareClient = new ShareClientBuilder().endpoint(shareURL) ### Directory The directory resource includes the properties for that directory. It allows the operations of creating, listing, deleting directories or subdirectories or files, getting properties, setting metadata, listing and force closing the handles. Once you have the SASToken, you can construct the file service client with `${accountName}`, `${shareName}`, `${directoryPath}`, `${sasToken}` - - ``` - String directoryURL = String.format("https://%s.file.core.windows.net/%s%s", accountName, shareName, directoryPath, sasToken); - DirectoryClient directoryClient = new DirectoryClientBuilder().endpoint(directoryURL) + +```java +String directoryURL = String.format("https://%s.file.core.windows.net/%s%s", accountName, shareName, directoryPath, sasToken); +DirectoryClient directoryClient = new DirectoryClientBuilder().endpoint(directoryURL) .credential(sasToken).shareName(shareName).directoryName(directoryPath).buildClient(); - ``` +``` ### File The file resource includes the properties for that file. It allows the operations of creating, uploading, copying, downloading, deleting files or range of the files, getting properties, setting metadata, listing and force closing the handles. Once you have the SASToken, you can construct the file service client with `${accountName}`, `${shareName}`, `${directoryPath}`, `${fileName}`, `${sasToken}` - - ``` - String fileURL = String.format("https://%s.file.core.windows.net", accountName); - FileClient fileClient = new FileClientBuilder().endpoint(fileURL) + +```java +String fileURL = String.format("https://%s.file.core.windows.net", accountName); +FileClient fileClient = new FileClientBuilder().endpoint(fileURL) .credential(sasToken).shareName(shareName).filePath(directoryPath + "/" + fileName).buildClient(); - ``` +``` ## Examples The following sections provide several code snippets covering some of the most common Configuration Service tasks, including: -- [Create a Share](#Create-a-share) -- [Create a snapshot on Share](#Create-a-snapshot-on-share) -- [Create a Directory](#Create-a-directory) -- [Create a Subdirectory](#Create-a-subdirectory) -- [Create a File](#Create-a-file) -- [List all Shares](#List-all-shares) -- [List all Subdirectories and Files](#List-all-subdirectories-and-files) -- [List all ranges on file](#List-all-ranges-on-file) -- [Delete a Share](#Delete-a-share) -- [Delete a Directory](#Delete-a-directory) -- [Delete a Subdirectory](#Delete-a-subdirectory) -- [Delete a File](#Delete-a-file) -- [Copy a File](#Copy-a-file) +- [Create a Share](#create-a-share) +- [Create a snapshot on Share](#create-a-snapshot-on-Share) +- [Create a Directory](#create-a-directory) +- [Create a Subdirectory](#create-a-subdirectory) +- [Create a File](#create-a-file) +- [List all Shares](#list-all-shares) +- [List all Subdirectories and Files](#list-all-subdirectories-and-files) +- [List all ranges on file](#list-all-ranges-on-file) +- [Delete a Share](#delete-a-share) +- [Delete a Directory](#delete-a-directory) +- [Delete a Subdirectory](#delete-a-subdirectory) +- [Delete a File](#delete-a-file) +- [Copy a File](#copy-a-file) - [Abort copy a File](#Abort-copy-a-file) -- [Upload data to Storage File](#Upload-data-to-storage) -- [Upload file to Storage File](#Upload-file-to-storage) -- [Download data from Storage File](#Download-data-from-storage) +- [Upload data to Storage File](#upload-data-to-storage) +- [Upload file to Storage File](#upload-file-to-storage) +- [Download data from file range](#download-data-from-file-range) - [Download file from Storage File](#Download-file-from-storage) -- [Get a File Service property](#Get-a-file-service-property) -- [Set a File Service property](#set-a-file-service-property) +- [Get a file service properties](#get-a-file-service-properties) +- [Set a file service properties](#set-a-file-service-properties) - [Set a Share metadata](#Set-a-share-metadata) - [Get a Share access policy](#Get-a-share-access-policy) - [Set a Share access policy](#Set-a-share-access-policy) @@ -256,7 +256,7 @@ Taking the fileServiceClient in KeyConcept, [`${fileServiceClient}`](#File-servi fileServiceClient.listShares(); ``` -### Create all subdirectories and files +### List all subdirectories and files Taking the directoryClient in KeyConcept, [`${directoryClient}`](#Directory) ```Java @@ -383,7 +383,7 @@ shareClient.getAccessPolicy(); ### Set a share access policy Taking the shareClient in KeyConcept, [`${shareClient}`](#Share) . -```Java +```java AccessPolicy accessPolicy = new AccessPolicy().permission("r") .start(OffsetDateTime.now(ZoneOffset.UTC)) .expiry(OffsetDateTime.now(ZoneOffset.UTC).plusDays(10)); @@ -432,13 +432,11 @@ When you interact with file using this Java client library, errors returned by t ## Next steps ### More Samples -- [FileServiceSample](src/samples/java/file/FileServiceSample.java) -- [ShareSample](src/samples/java/file/ShareSample.java) -- [DirectorySample](src/samples/java/file/DirectorySample.java) -- [FileSample](src/samples/java/file/FileSample.java) -- [AsyncSample](src/samples/java/file/AsyncSample.java) - -[Quickstart: Create a Java Spring app with App Configuration](https://docs.microsoft.com/en-us/azure/azure-app-configuration/quickstart-java-spring-app) +- [FileServiceSample][samples_file_service] +- [ShareSample][samples_share] +- [DirectorySample][samples_directory] +- [FileSample][samples_file] +- [AsyncSample][samples_async] ## Contributing This project welcomes contributions and suggestions. Most contributions require you to agree to a @@ -462,17 +460,23 @@ If you would like to become an active contributor to this project please follow 5. Create new Pull Request -[source_code]: to-be-continue -[package]: to-be-continue -[api_documentation]: https://docs.microsoft.com/en-us/rest/api/storageservices/file-service-rest-api -[storage_docs]: https://docs.microsoft.com/en-us/azure/storage/files/storage-files-introduction -[jdk]: https://docs.microsoft.com/en-us/java/azure/java-supported-jdk-runtime?view=azure-java-stable +[source_code]: src/ +[package]: https://search.maven.org/search?q=a:azure-storage-file +[api_documentation]: https://docs.microsoft.com/rest/api/storageservices/file-service-rest-api +[storage_docs]: https://docs.microsoft.com/azure/storage/files/storage-files-introduction +[jdk]: https://docs.microsoft.com/java/azure/java-supported-jdk-runtime?view=azure-java-stable [maven]: https://maven.apache.org/ -[azure_subscription]: https://azure.microsoft.com/en-us/free/ -[storage_account]: https://docs.microsoft.com/en-us/azure/storage/common/storage-quickstart-create-account?tabs=azure-portal +[azure_subscription]: https://azure.microsoft.com/free/ +[storage_account]: https://docs.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-portal [azure_cli]: https://docs.microsoft.com/cli/azure -[sas_token]: https://docs.microsoft.com/en-us/azure/storage/common/storage-dotnet-shared-access-signature-part-1 +[sas_token]: https://docs.microsoft.com/azure/storage/common/storage-dotnet-shared-access-signature-part-1 [RFC_URL_1]: https://www.ietf.org/rfc/rfc2616.txt [RFL_URL_2]: https://www.ietf.org/rfc/rfc3987.txt -[C_identifiers]: https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/ -[storage_file_rest]: https://docs.microsoft.com/en-us/rest/api/storageservices/file-service-error-codes +[csharp_identifiers]: https://docs.microsoft.com/dotnet/csharp/language-reference/ +[storage_file_rest]: https://docs.microsoft.com/rest/api/storageservices/file-service-error-codes +[samples]: src/samples +[samples_file_service]: src/samples/java/com/azure/storage/file/FileServiceSample.java +[samples_share]: src/samples/java/com/azure/storage/file/ShareSample.java +[samples_directory]: src/samples/java/com/azure/storage/file/DirectorySample.java +[samples_file]: src/samples/java/com/azure/storage/file/FileSample.java +[samples_async]: src/samples/java/com/azure/storage/file/AsyncSample.java From 478218dd28f206e0af1147cefd70031c84015c0b Mon Sep 17 00:00:00 2001 From: Connie Date: Wed, 7 Aug 2019 13:35:54 -0700 Subject: [PATCH 06/12] remove [package] from README because none of the others have it. --- sdk/storage/azure-storage-blob/README.md | 3 +-- sdk/storage/azure-storage-file/README.md | 5 ++--- sdk/storage/azure-storage-queue/README.md | 14 +++++++------- 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/sdk/storage/azure-storage-blob/README.md b/sdk/storage/azure-storage-blob/README.md index f01232d6441c2..0adb58b51fe5c 100644 --- a/sdk/storage/azure-storage-blob/README.md +++ b/sdk/storage/azure-storage-blob/README.md @@ -7,7 +7,7 @@ storage is optimized for storing massive amounts of unstructured data. Unstructured data is data that does not adhere to a particular data model or definition, such as text or binary data. -[Source code][source] | [Package (Maven)][package] | [API reference documentation][docs] | [REST API documentation][rest_docs] | [Product documentation][product_docs] +[Source code][source] | [API reference documentation][docs] | [REST API documentation][rest_docs] | [Product documentation][product_docs] | [Samples][samples] ## Getting started @@ -257,7 +257,6 @@ This project has adopted the [Microsoft Open Source Code of Conduct](https://ope [source]: src -[package]: https://mvnrepository.com/artifact/com.azure/azure-storage-blob [docs]: http://azure.github.io/azure-sdk-for-java/ [rest_docs]: https://docs.microsoft.com/rest/api/storageservices/blob-service-rest-api [product_docs]: https://docs.microsoft.com/azure/storage/blobs/storage-blobs-overview diff --git a/sdk/storage/azure-storage-file/README.md b/sdk/storage/azure-storage-file/README.md index 486a1a59747ab..ce9c6c17e97ee 100644 --- a/sdk/storage/azure-storage-file/README.md +++ b/sdk/storage/azure-storage-file/README.md @@ -6,8 +6,8 @@ Files stored in Azure File service shares are accessible via the SMB protocol, a The File service offers the following four resources: the storage account, shares, directories, and files. Shares provide a way to organize sets of files and also can be mounted as an SMB file share that is hosted in the cloud. -[Source code][source_code] | [Package (Maven)][package] | [API reference documentation][api_documentation] -| [Product documentation][storage_docs] | [Samples][samples] +[Source code][source_code] | [API reference documentation][api_documentation] | [Product documentation][storage_docs] | +[Samples][samples] ## Getting started @@ -461,7 +461,6 @@ If you would like to become an active contributor to this project please follow [source_code]: src/ -[package]: https://search.maven.org/search?q=a:azure-storage-file [api_documentation]: https://docs.microsoft.com/rest/api/storageservices/file-service-rest-api [storage_docs]: https://docs.microsoft.com/azure/storage/files/storage-files-introduction [jdk]: https://docs.microsoft.com/java/azure/java-supported-jdk-runtime?view=azure-java-stable diff --git a/sdk/storage/azure-storage-queue/README.md b/sdk/storage/azure-storage-queue/README.md index 18f92018e21c5..7f68dacef730a 100644 --- a/sdk/storage/azure-storage-queue/README.md +++ b/sdk/storage/azure-storage-queue/README.md @@ -2,7 +2,8 @@ Azure Queue storage is a service for storing large numbers of messages that can be accessed from anywhere in the world via authenticated calls using HTTP or HTTPS. A single queue message can be up to 64 KB in size, and a queue can contain millions of messages, up to the total capacity limit of a storage account. -[Source code][source_code] | [Package (Maven)][package] | [API reference documentation][api_documentation] | [Product documentation][storage_docs] +[Source code][source_code] | [API reference documentation][api_documentation] | [Product documentation][storage_docs] | +[Samples][samples] ## Getting started @@ -10,15 +11,15 @@ A single queue message can be up to 64 KB in size, and a queue can contain milli - [Java Development Kit (JDK)][jdk] with version 8 or above - [Azure Subscription][azure_subscription] -- [Create Strorage Account][storage_account] +- [Create Storage Account][storage_account] ### Adding the package to your product ```xml com.azure - azure-storage - 12.0.0 + azure-storage-queue + 12.0.0-preview.2 ``` @@ -398,8 +399,7 @@ If you would like to become an active contributor to this project please follow 5. Create new Pull Request -[source_code]: to-be-continue -[package]: to-be-continue +[source_code]: src [api_documentation]: https://docs.microsoft.com/en-us/rest/api/storageservices/queue-service-rest-api [storage_docs]: https://docs.microsoft.com/en-us/azure/storage/queues/storage-queues-introduction [jdk]: https://docs.microsoft.com/en-us/java/azure/java-supported-jdk-runtime?view=azure-java-stable @@ -409,4 +409,4 @@ If you would like to become an active contributor to this project please follow [azure_cli]: https://docs.microsoft.com/cli/azure [sas_token]: https://docs.microsoft.com/en-us/azure/storage/common/storage-dotnet-shared-access-signature-part-1 [storage_rest]: https://docs.microsoft.com/en-us/rest/api/storageservices/queue-service-error-codes -[samples]: samples/ +[samples]: src/samples From 5c12064818eba07105f3d593ce1c57011b3e35ad Mon Sep 17 00:00:00 2001 From: Connie Date: Wed, 7 Aug 2019 13:40:15 -0700 Subject: [PATCH 07/12] Fix link issues in storage README --- sdk/storage/azure-storage-queue/README.md | 27 ++++++++++++----------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/sdk/storage/azure-storage-queue/README.md b/sdk/storage/azure-storage-queue/README.md index 7f68dacef730a..1a23d82925778 100644 --- a/sdk/storage/azure-storage-queue/README.md +++ b/sdk/storage/azure-storage-queue/README.md @@ -173,12 +173,12 @@ The following sections provide several code snippets covering some of the most c - [Create a Queue](#Create-a-queue) - [Delete a queue](#Delete-a-queue) - [List the queues in account](#List-queues-in-account) -- [Get propertiesin Queue account](#Get-properties-in-queue-account) -- [Set propertiesin Queue account](#Set-properties-in-queue-account) -- [Get statistcs of queue](#Get-queue-service-statistics) +- [Get properties in Queue account](#Get-properties-in-queue-account) +- [Set properties in Queue account](#Set-properties-in-queue-account) +- [Get statistics of queue](#Get-queue-service-statistics) - [Enqueue message into a queue](#Enqueue-message-into-a-queue) -- [Update message into a queue](#Update-message-into-a-queue) -- [Peek messages into a queue](#Peek-messages-into-a-queue) +- [Update a message in a queue](#update-a-message-in-a-queue) +- [Peek messages into a queue](#Peek-messages-from-a-queue) - [Dequeue messages from a queue](#Dequeue-messages-from-a-queue) - [Delete message from a queue](#Delete-message-from-a-queue) - [Get a Queue properties](#Get-a-queue-properties) @@ -293,7 +293,7 @@ QueueClient queueClient = new QueueClientBuilder().endpoint(queueURL).credential queueClient.enqueueMessage("myMessage"); ``` -### Update messaged from a queue +### Update a message in a queue The operation updates a message in the message queue. Use `${SASToken}` as credential. ```Java String queueSURL = String.format("https://%s.queue.core.windows.net", accountName); @@ -368,14 +368,11 @@ When you interact with queue using this Java client library, errors returned by ## Next steps -### More Samples Get started with our [Queue samples][samples]: -- [QueueServiceSample](src/samples/java/queue/QueueServiceSample.java): Create, list and delete queues -- [MessageSample](src/samples/java/queue/MessageSample.java): Enqueue, peek dequeue, update, clear and delete messages. Get properties of the queue. -- [QueueExceptionSample](src/samples/java/queue/QueueExceptionSample.java): Handle the exceptions from storage queue service side. -- [AsyncSample](src/samples/java/queue/AsyncSample.java): Create queue and enqueue message using async queue client call. - -[Quickstart: Create a Java Spring app with App Configuration](https://docs.microsoft.com/en-us/azure/azure-app-configuration/quickstart-java-spring-app) +- [QueueServiceSample][samples_queue_service]: Create, list and delete queues +- [MessageSample][samples_message]: Enqueue, peek dequeue, update, clear and delete messages. Get properties of the queue. +- [QueueExceptionSample][samples_queue_exception]: Handle the exceptions from storage queue service side. +- [AsyncSample][samples_async]: Create queue and enqueue message using async queue client call. ## Contributing This project welcomes contributions and suggestions. Most contributions require you to agree to a @@ -410,3 +407,7 @@ If you would like to become an active contributor to this project please follow [sas_token]: https://docs.microsoft.com/en-us/azure/storage/common/storage-dotnet-shared-access-signature-part-1 [storage_rest]: https://docs.microsoft.com/en-us/rest/api/storageservices/queue-service-error-codes [samples]: src/samples +[samples_queue_service]: src/samples/java/com/azure/storage/queue/QueueServiceSamples.java +[samples_message]: src/samples/java/com/azure/storage/queue/MessageSamples.java +[samples_queue_exception]: src/samples/java/com/azure/storage/queue/QueueExceptionSamples.java +[samples_async]: src/samples/java/com/azure/storage/queue/AsyncSamples.java From 5f82314ecb9d5dec4238e68a143f947d5dc8ffe5 Mon Sep 17 00:00:00 2001 From: Connie Date: Wed, 7 Aug 2019 13:58:25 -0700 Subject: [PATCH 08/12] Remove en-us from links. --- sdk/storage/azure-storage-queue/README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sdk/storage/azure-storage-queue/README.md b/sdk/storage/azure-storage-queue/README.md index 1a23d82925778..f441e1b88d132 100644 --- a/sdk/storage/azure-storage-queue/README.md +++ b/sdk/storage/azure-storage-queue/README.md @@ -397,15 +397,15 @@ If you would like to become an active contributor to this project please follow [source_code]: src -[api_documentation]: https://docs.microsoft.com/en-us/rest/api/storageservices/queue-service-rest-api -[storage_docs]: https://docs.microsoft.com/en-us/azure/storage/queues/storage-queues-introduction -[jdk]: https://docs.microsoft.com/en-us/java/azure/java-supported-jdk-runtime?view=azure-java-stable +[api_documentation]: https://docs.microsoft.com/rest/api/storageservices/queue-service-rest-api +[storage_docs]: https://docs.microsoft.com/azure/storage/queues/storage-queues-introduction +[jdk]: https://docs.microsoft.com/java/azure/java-supported-jdk-runtime?view=azure-java-stable [maven]: https://maven.apache.org/ -[azure_subscription]: https://azure.microsoft.com/en-us/free/ -[storage_account]: https://docs.microsoft.com/en-us/azure/storage/common/storage-quickstart-create-account?tabs=azure-portal +[azure_subscription]: https://azure.microsoft.com/free/ +[storage_account]: https://docs.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-portal [azure_cli]: https://docs.microsoft.com/cli/azure -[sas_token]: https://docs.microsoft.com/en-us/azure/storage/common/storage-dotnet-shared-access-signature-part-1 -[storage_rest]: https://docs.microsoft.com/en-us/rest/api/storageservices/queue-service-error-codes +[sas_token]: https://docs.microsoft.com/azure/storage/common/storage-dotnet-shared-access-signature-part-1 +[storage_rest]: https://docs.microsoft.com/rest/api/storageservices/queue-service-error-codes [samples]: src/samples [samples_queue_service]: src/samples/java/com/azure/storage/queue/QueueServiceSamples.java [samples_message]: src/samples/java/com/azure/storage/queue/MessageSamples.java From 053bb68132599af48e806e5214e8559654c22c39 Mon Sep 17 00:00:00 2001 From: Connie Date: Wed, 7 Aug 2019 13:57:00 -0700 Subject: [PATCH 09/12] Add syntax highlighting alias java to snippets. --- sdk/keyvault/azure-keyvault-keys/README.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/sdk/keyvault/azure-keyvault-keys/README.md b/sdk/keyvault/azure-keyvault-keys/README.md index 0b6e03cfd3892..dbbf755a3df81 100644 --- a/sdk/keyvault/azure-keyvault-keys/README.md +++ b/sdk/keyvault/azure-keyvault-keys/README.md @@ -192,7 +192,7 @@ System.out.printf("Deleted Key's deletion date %s", deletedKey.deletedDate().toS ### List Keys List the keys in the key vault by calling `listKeys`. -```Java +```java // List operations don't return the keys with key material information. So, for each returned key we call getKey to get the key with its key material information. for (KeyBase key : keyClient.listKeys()) { Key keyWithMaterial = keyClient.getKey(key).value(); @@ -203,7 +203,7 @@ for (KeyBase key : keyClient.listKeys()) { ### Encrypt Encrypt plain text by calling `encrypt`. -``` +```java CryptographyClient cryptoClient = new CryptographyClientBuilder() .credential(new DefaultAzureCredentialBuilder().build()) .keyIdentifier(" { ### Delete a Key Asynchronously Delete an existing Key by calling `deleteKey`. -```Java +```java keyAsyncClient.deleteKey("keyName").subscribe(deletedKeyResponse -> System.out.printf("Deleted Key's deletion time %s \n", deletedKeyResponse.value().deletedDate().toString())); ``` @@ -311,7 +312,7 @@ keyAsyncClient.listKeys() ### Encrypt Asynchronously Encrypt plain text by calling `encrypt`. -``` +```java CryptographyAsyncClient cryptoAsyncClient = new CryptographyClientBuilder() .credential(new DefaultAzureCredentialBuilder().build()) .keyIdentifier("") @@ -330,7 +331,7 @@ cryptoAsyncClient.encrypt(EncryptionAlgorithm.RSA_OAEP, plainText) ### Decrypt Asynchronously Decrypt encrypted content by calling `decrypt`. -``` +```java byte[] plainText = new byte[100]; new Random(0x1234567L).nextBytes(plainText); From 70fe8702487e2a84e17904602a040869393e3e3e Mon Sep 17 00:00:00 2001 From: Connie Date: Wed, 7 Aug 2019 14:01:46 -0700 Subject: [PATCH 10/12] Undo * in appconfig --- sdk/appconfiguration/azure-data-appconfiguration/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/appconfiguration/azure-data-appconfiguration/README.md b/sdk/appconfiguration/azure-data-appconfiguration/README.md index 003c8aeeaea04..cf9bfa46796ee 100644 --- a/sdk/appconfiguration/azure-data-appconfiguration/README.md +++ b/sdk/appconfiguration/azure-data-appconfiguration/README.md @@ -5,7 +5,7 @@ Modern programs, especially programs running in a cloud, generally have many com Use the client library for App Configuration to create and manage application configuration settings. -[Source code][source_code] | [Package (Maven)][package] | [API reference documentation][api_documentation] +[Source code][source_code] | [Package (Maven)][package] | [API reference documentation][api_documentation] | [Product documentation][azconfig_docs] | [Samples][samples] ## Getting started @@ -173,7 +173,7 @@ When you interact with App Configuration using this Java client library, errors ## Next steps -* [Quickstart: Create a Java Spring app with App Configuration][spring_quickstart] +[Quickstart: Create a Java Spring app with App Configuration][spring_quickstart] ## Contributing From f02f8d75e91e527af359bc43dde64636c4ada74c Mon Sep 17 00:00:00 2001 From: Connie Date: Wed, 7 Aug 2019 14:13:20 -0700 Subject: [PATCH 11/12] Update shared key credential steps. --- sdk/storage/azure-storage-file/README.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/sdk/storage/azure-storage-file/README.md b/sdk/storage/azure-storage-file/README.md index ce9c6c17e97ee..eea3353314b4b 100644 --- a/sdk/storage/azure-storage-file/README.md +++ b/sdk/storage/azure-storage-file/README.md @@ -68,16 +68,16 @@ To make this possible you'll need the Account SAS (shared access signature) stri 1. Click on "Generate SAS and connection string". - **Shared Key Credential** - 1. Use account name and account key. Account name is your storage account name. - ``` - // Here is where we get the key - Go to your storage account -> Access keys -> Key 1/ Key 2 -> Key - ``` - 1. Use the connection string - ``` - // Here is where we get the key - Go to your storage account -> Access Keys -> Keys 1/ Key 2 -> Connection string - ``` + * There are two ways to create a shared key credential, the first is using the storage account name and account key. The second is using the storage connection string. + 1. Use account name and account key. + 1. The account name is your storage account name. + 1. Go to your storage account. + 1. Select "Access keys" tab. + 1. Copy the "Key" value for either Key 1 or Key 2. + 1. Use the connection string + 1. Go to your storage account. + 1. Select "Access keys" tab. + 1. Copy the "Connection string" value for either Key 1 or Key 2. ## Key concepts From c0fc99cfddcfd7477ba9921b0c4ffe9b0e8f01d2 Mon Sep 17 00:00:00 2001 From: Connie Date: Thu, 8 Aug 2019 11:19:29 -0700 Subject: [PATCH 12/12] Updating README with comments. --- sdk/storage/azure-storage-file/README.md | 12 +++++------ sdk/storage/azure-storage-queue/README.md | 26 +++++++++++------------ 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/sdk/storage/azure-storage-file/README.md b/sdk/storage/azure-storage-file/README.md index eea3353314b4b..75e91197b6d47 100644 --- a/sdk/storage/azure-storage-file/README.md +++ b/sdk/storage/azure-storage-file/README.md @@ -180,7 +180,7 @@ FileClient fileClient = new FileClientBuilder().endpoint(fileURL) The following sections provide several code snippets covering some of the most common Configuration Service tasks, including: - [Create a Share](#create-a-share) -- [Create a snapshot on Share](#create-a-snapshot-on-Share) +- [Create a snapshot on Share](#create-a-snapshot-on-share) - [Create a Directory](#create-a-directory) - [Create a Subdirectory](#create-a-subdirectory) - [Create a File](#create-a-file) @@ -196,7 +196,7 @@ The following sections provide several code snippets covering some of the most c - [Upload data to Storage File](#upload-data-to-storage) - [Upload file to Storage File](#upload-file-to-storage) - [Download data from file range](#download-data-from-file-range) -- [Download file from Storage File](#Download-file-from-storage) +- [Download file from Storage File](#download-file-from-storage) - [Get a file service properties](#get-a-file-service-properties) - [Set a file service properties](#set-a-file-service-properties) - [Set a Share metadata](#Set-a-share-metadata) @@ -209,7 +209,7 @@ The following sections provide several code snippets covering some of the most c ### Create a share Create a share in the Storage Account. Throws StorageErrorException If the share fails to be created. -Taking a FileServiceClient in KeyConcept, [`${fileServiceClient}`](#File-services) . +Taking a FileServiceClient in KeyConcept, [`${fileServiceClient}`](#File-services). ```Java String shareName = "testshare"; @@ -217,7 +217,7 @@ fileServiceClient.createShare(shareName); ``` ### Create a snapshot on Share -Taking a FileServiceClient in KeyConcept, [`${fileServiceClient}`](#File-services) . +Taking a FileServiceClient in KeyConcept, [`${fileServiceClient}`](#File-services). ```Java String shareName = "testshare"; @@ -226,7 +226,7 @@ shareClient.createSnapshot(); ``` ### Create a directory -Taking the [`${shareClient}](#Create-snapshot-on-share) initialized above, [`${shareClient}`](#Share) . +Taking the [`${shareClient}](#create-a-snapshot-on-share) initialized above, [`${shareClient}`](#share). ```Java String dirName = "testdir"; @@ -234,7 +234,7 @@ shareClient.createDirectory(dirName); ``` ### Create a subdirectory -Taking the directoryClient in KeyConcept, [`${directoryClient}`](#Directory) . +Taking the directoryClient in KeyConcept, [`${directoryClient}`](#Directory). ```Java String subDirName = "testsubdir"; diff --git a/sdk/storage/azure-storage-queue/README.md b/sdk/storage/azure-storage-queue/README.md index f441e1b88d132..f80a2c884c44b 100644 --- a/sdk/storage/azure-storage-queue/README.md +++ b/sdk/storage/azure-storage-queue/README.md @@ -170,19 +170,19 @@ queueAsyncClient.create(metadata, timeout).subscribe( The following sections provide several code snippets covering some of the most common Configuration Service tasks, including: - [Build a client](#build-a-client) -- [Create a Queue](#Create-a-queue) -- [Delete a queue](#Delete-a-queue) -- [List the queues in account](#List-queues-in-account) -- [Get properties in Queue account](#Get-properties-in-queue-account) -- [Set properties in Queue account](#Set-properties-in-queue-account) -- [Get statistics of queue](#Get-queue-service-statistics) -- [Enqueue message into a queue](#Enqueue-message-into-a-queue) +- [Create a Queue](#create-a-queue) +- [Delete a queue](#delete-a-queue) +- [List the queues in account](#list-queues-in-account) +- [Get properties in Queue account](#get-properties-in-queue-account) +- [Set properties in Queue account](#set-properties-in-queue-account) +- [Get statistics of queue](#get-queue-service-statistics) +- [Enqueue message into a queue](#enqueue-message-into-a-queue) - [Update a message in a queue](#update-a-message-in-a-queue) -- [Peek messages into a queue](#Peek-messages-from-a-queue) -- [Dequeue messages from a queue](#Dequeue-messages-from-a-queue) -- [Delete message from a queue](#Delete-message-from-a-queue) -- [Get a Queue properties](#Get-a-queue-properties) -- [Set/Update a Queue metadata](#Set-a-queue-metadata) +- [Peek at messages in a queue](#peek-at-messages-in-a-queue) +- [Dequeue messages from a queue](#dequeue-messages-from-a-queue) +- [Delete message from a queue](#delete-message-from-a-queue) +- [Get a Queue properties](#get-a-queue-properties) +- [Set/Update a Queue metadata](#set-a-queue-metadata) ### Build a client We have two ways of building QueueService or Queue Client. Here will take queueServiceClient as an example. Same things apply to queueClient. @@ -304,7 +304,7 @@ QueueClient queueClient = new QueueClientBuilder().endpoint(queueURL).credential queueClient.updateMessage(messageId, "new message", popReceipt, visibilityTimeout); ``` -### Peek messages from a queue +### Peek at messages in a queue The operation retrieves one or more messages from the front of the queue. Use `${SASToken}` as credential. ```Java String queueSURL = String.format("https://%s.queue.core.windows.net", accountName);