-
Notifications
You must be signed in to change notification settings - Fork 50
Description
The method CloudBlobContainer.listBlobs() works when called the first time after installing the app, but will not work again and throw the following MAC signature invalid error.
The MAC signature found in the HTTP request 'xxxxxxxxxx' is not the same as any computed signature. Server used following string to sign: 'GET
Mon, 24 Aug 2020 14:39:19 GMT
x-ms-client-request-id:5830d2ce-c356-40c0-a9a1-cecd66921336
x-ms-date:Mon, 24 Aug 2020 16:48:29 GMT
x-ms-version:2017-04-17
/myaccoun t/mycontainer
comp:list
delimiter:/
restype:container'.
The listBlobs() method will only work for the same container again after the app's cache is cleared.
I am using the following code to list blobs (Kotlin)
`
val storageAccount = CloudStorageAccount.parse(connectionString)
val blobClient = storageAccount.createCloudBlobClient()
val container = blobClient.getContainerReference(name)
val blobs = container.listBlobs()
val blobNames: ArrayList = ArrayList()
for (blob in blobs) {
blobNames.add((blob as CloudBlockBlob).name)
}
`