I am trying to upload a text blob to azure storage blob using the following code:
public static final String storageConnectionString = "DefaultEndpointsProtocol=http;"
+ "AccountName=MY_STORAGE_ACNT;"
+ "AccountKey=[MYKEY]";
CloudStorageAccount account = CloudStorageAccount.parse(storageConnectionString);
CloudBlobClient blobClient = account.createCloudBlobClient();
CloudBlobContainer container = blobClient.getContainerReference("ubiety");
container.createIfNotExists();
BlobContainerPermissions containerPermissions = new BlobContainerPermissions();
containerPermissions.setPublicAccess(BlobContainerPublicAccessType.CONTAINER);
container.uploadPermissions(containerPermissions);
CloudBlockBlob blob1 = container.getBlockBlobReference("storage_name");
blob1.uploadText("Hello, World1");
This is a mere copy paste of the sample at BlobBasics Sample, still
I get the error
StorageKey is not a valid Base64 Encoded string.
Can someone please help. I am very sure, i am using the correct key provided at the azure portal
Thank you.
Looking at the sample link you've given it looks like you're using the Java Storage library rather than the Android Storage library. If you use the Android storage library and it's associated samples that should work correctly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With