Develop powerful storage applications with ease using the official SDK.
The Azure Storage Management SDK for Java provides a convenient and robust way to interact with Azure Blob Storage, Queue Storage, Table Storage, and File Storage. This SDK simplifies common storage tasks, such as creating containers, uploading files, managing queues, and querying data. It's built on top of the Azure SDK for Java, leveraging its comprehensive features and capabilities.
To get started, you'll need:
You can find more detailed instructions and examples on the Azure Storage Documentation.
import com.azure.storage.blob.BlobClient;
import com.azure.storage.blob.BlobContainerClient;
// Replace with your storage account name and container name
String storageAccountName = "yourstorageaccountname";
String containerName = "yourcontainername";
BlobContainerClient containerClient = containerClient
.withAccountName(storageAccountName)
.get();
containerClient.createContainerIfNotExists(containerName);
import com.azure.storage.blob.BlobClientBuilder;
// Replace with your storage account name, container name, and file name
String storageAccountName = "yourstorageaccountname";
String containerName = "yourcontainername";
String fileName = "myFile.txt";
BlobClient blobClient = new BlobClientBuilder()
.url(String.format("https://%s.blob.core.windows.net/%s/%s",
storageAccountName, containerName, fileName))
.build();
// Upload the file
blobClient.upload();