Android Picasso is not loading image from Azure Emulator Storage

196 Views Asked by At

I have a Image saved inside of Azure Storage Emulator uploaded using WebApi in this local Url http://127.0.0.1:10000/devstoreaccount1/imagesprofile/bvv.jpg

I can access by browser, it instantly download it, but when I tried to use with Android Picasso, it didn't work! So I first created a Container with the public permission :

CloudStorageAccount storageAccount =
                   CloudStorageAccount.Parse(CloudConfigurationManager.GetSetting("StorageConnectionString"));

        CloudBlobClient blobClient = storageAccount.CreateCloudBlobClient();

        CloudBlobContainer container = blobClient.GetContainerReference("imagesprofile");
        container.CreateIfNotExists();
        container.SetPermissions(
        new BlobContainerPermissions { PublicAccess = BlobContainerPublicAccessType.Blob });

And to Upload the image:

public async Task uploadImage(string ctn,string profileName,byte[] imageSource)
    {
        CloudStorageAccount storageAccount =
                    CloudStorageAccount.Parse(CloudConfigurationManager.GetSetting("StorageConnectionString"));

        CloudBlobClient blobClient = storageAccount.CreateCloudBlobClient();

        CloudBlobContainer container = blobClient.GetContainerReference(ctn);

        CloudBlockBlob block = container.GetBlockBlobReference(profileName + ".jpg");
        using (var stream = new MemoryStream(imageSource, writable: false))
        {
           await block.UploadFromStreamAsync(stream);
        }
    }

But when if I try to read this URL with Picasso, I got nothing :

Picasso.with(this).load("http://127.0.0.1:10000/devstoreaccount1/imagesprofile/bvv.jpg")
            .transform(new CircleTransform()).into(photo);
0

There are 0 best solutions below