
Hi Experts,
I am having a issue while reading the file from Azure Blob Storage. It works fine if we provide only container name as parameter. But we have folder structure.
For Ex., if container is "TestContainer" and inside this we have a folder named "TestFolder". We are storing the files under "TestFolder"
The uplaod is working fine but when we want to read, we are getting error.
Code Snippet:
Working when we specify only container name, but gives every folder data. But we want to read only specific.
BlobClient.Initialize(storageAccount, 'TestContainer', Authorization);
response := BlobClient.ListBlobs(content);
Not working when we specify only container name along with folder name:
BlobClient.Initialize(storageAccount, 'TestContainer/TestFolder', Authorization);
response := BlobClient.ListBlobs(content);
Response below:
Response Code: 400 The requested URI does not represent any resource on the server.
Any suggestions are highly appreciated.
Thanks in advance.
Regards
Avinash B
You have to use the optional parameters for that.
Here is an example
procedure GetBlobsFromIncomingContainer(var ABSContainerContent: Record "ABS Container Content"; FolderPath: Text)
begin
InitializeIncomingContainer();
ABSOptionalParameters.Prefix(FolderPath);
ABSOperationResponse := ABSBlobClient.ListBlobs(ABSContainerContent, ABSOptionalParameters);
CheckError(ABSOperationResponse);
end;