Azure-Samples / azure-sdk-for-java-storage-blob-upload-download

How to upload and download blobs from Azure Blob Storage with Java
16 stars 34 forks source link

page_type: sample languages:

How to upload and download blobs from Azure Blob Storage with Java

This sample shows how to do the following operations of Storage Blobs with Storage SDK

Use latest Storage Blob SDK

The Storage Blob SDK package version in this repo is 11.x.x. It's strongly recommended that you use the latest version of the Storage Blob SDK package, please refer to the following examples:

Prerequisites

If you don't have an Azure subscription, create a free account before you begin.

Create a Storage Account using the Azure portal

Step 1 : Create a new general-purpose storage account to use for this tutorial.

Step 2 : Copy and save keys.

Set credentials in environment variables

Linux

export AZURE_STORAGE_ACCOUNT="<YourAccountName>"
export AZURE_STORAGE_ACCESS_KEY="<YourAccountKey>"

Windows

setx AZURE_STORAGE_ACCOUNT "<YourAccountName>"
setx AZURE_STORAGE_ACCESS_KEY "<YourAccountKey>"

Run the application

First, clone the repository on your machine:

git clone https://github.com/Azure-Samples/azure-sdk-for-java-storage-blob-upload-download.git

Finally, run the application with the mvn compile exec:java command.

mvn compile exec:java

Resources

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.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.