locked
container.CreateIfNotExists() throws NullReferenceException RRS feed

  • Question

  • I used the latest azure-storage-sdk: https://github.com/Azure/azure-storage-android.  I tried to use the code snippet on the documentation.

            CloudStorageAccount account = CloudStorageAccount.parse(storageConnectionString);
            CloudBlobClient serviceClient = account.createCloudBlobClient();
    
            // Container name must be lower case.
            CloudBlobContainer container = serviceClient.getContainerReference("myimages");
            container.createIfNotExists();
    

    It threw NullReferenceException while calling container.createIfNotExists(). I'm quite sure I have a valid storage account.

    Thanks for looking,
    Peter

    Friday, May 23, 2014 11:02 PM

Answers

  • Hi peter,

    Base on my experience, it seems like your code is right. I suggest you could check your blob container whether is existed on your azure portal storage firstly. And also, you could try to use another container name to replace 'myimages' to try again.

    Any update info, please let me know.

    Regards,

    Will 


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, May 26, 2014 3:03 AM