Create azure CloudStorageAccount - Java Azure

Java examples for Azure:Cloud Storage

Description

Create azure CloudStorageAccount

Demo Code



import com.microsoft.azure.storage.CloudStorageAccount;
import com.microsoft.azure.storage.blob.CloudBlobClient;
import com.microsoft.windowsazure.management.storage.models.*;

public class myConatainers {
    public static final String storageConnectionString = "DefaultEndpointsProtocol=http;"
            + "AccountName=danielfiletest;"
            + "AccountKey=your key";

    public static void main(String[] args) {
        int i = 1;
        int d = i;

        try {/*ww w  .j  a v  a2s. c  o  m*/
            CloudStorageAccount account = CloudStorageAccount
                    .parse(storageConnectionString);
            CloudBlobClient blobClient = account.createCloudBlobClient();
            blobClient.listContainers();

        } catch (Exception e) {

        }
    }

}

Related Tutorials