Describe the issue
While working with Azure Blob Services API module I found some inconsistencies and after analyzing it I want to share it.
The point is that PutBlockList cannot be used now.
|
procedure PutBlockList(CommitedBlocks: Dictionary of [Text, Integer]; UncommitedBlocks: Dictionary of [Text, Integer]): Codeunit "ABS Operation Response" |
According to the documentation:

But at the same time PutBlock operation is not represented in the ABSBlobClient codeunit. Which makes it impossible to use the PutBlockList() method.
What is interesting is that in the implementation this method already exists and all we have to do is add it to the ABSBlobClient interface.
|
procedure PutBlock(SourceContentVariant: Variant; BlockId: Text): Codeunit "ABS Operation Response" |
In addition, I think that the PutBlockList() method lacks the BlobName parameter because it is not clear at what point this name is implicitly received by ABSOperationPayload.
|
ABSOperationResponse := ABSWebRequestHelper.PutOperation(ABSOperationPayload, HttpContent, StrSubstNo(PutBlockOperationNotSuccessfulErr, ABSOperationPayload.GetBlobName())); |
Expected behavior
This should work so that we can make multiple PutBlocks with a unique identifier in Base64 and then modify/add the blocks we need to get one initial Blob consisting of these blocks.
As example:
Put first uncommitted block:
curl --location --request PUT 'https://beedynamics.blob.core.windows.net/cronususainc/1/test1.txt?{SAS}&comp=block&blockid=MQ%3D%3D' \
--header 'x-ms-blob-type: BlockBlob' \
--header 'Content-Type: text/plain' \
--data 'part1'
Put second uncommitted block:
curl --location --request PUT 'https://beedynamics.blob.core.windows.net/cronususainc/1/test1.txt?{SAS}&comp=block&blockid=Mg%3D%3D' \
--header 'x-ms-blob-type: BlockBlob' \
--header 'Content-Type: text/plain' \
--data 'part2'
Commit two blocks as one Blob:
curl --location --request PUT 'https://beedynamics.blob.core.windows.net/cronususainc/1/test1.txt?{SAS}&comp=blocklist' \
--header 'Content-Type: application/xml' \
--data '<BlockList>
<Uncommitted>MQ==</Uncommitted>
<Uncommitted>Mg==</Uncommitted>
</BlockList> '
Steps to reproduce
Try to use PutBlockList
Additional context
I originally wanted to send a PR with a fix, but judging by the rules it has to be negotiated in Issue first. And yes I know AppendBlock works in a similar way and it works fine.
I will provide a fix for a bug
Describe the issue
While working with Azure Blob Services API module I found some inconsistencies and after analyzing it I want to share it.
The point is that PutBlockList cannot be used now.
BCApps/src/System Application/App/Azure Blob Services API/src/ABSBlobClient.Codeunit.al
Line 772 in cd59daa
According to the documentation:

But at the same time PutBlock operation is not represented in the ABSBlobClient codeunit. Which makes it impossible to use the PutBlockList() method.
What is interesting is that in the implementation this method already exists and all we have to do is add it to the ABSBlobClient interface.
BCApps/src/System Application/App/Azure Blob Services API/src/ABSClientImpl.Codeunit.al
Line 652 in cd59daa
In addition, I think that the PutBlockList() method lacks the BlobName parameter because it is not clear at what point this name is implicitly received by ABSOperationPayload.
BCApps/src/System Application/App/Azure Blob Services API/src/ABSClientImpl.Codeunit.al
Line 676 in cd59daa
Expected behavior
This should work so that we can make multiple PutBlocks with a unique identifier in Base64 and then modify/add the blocks we need to get one initial Blob consisting of these blocks.
As example:
Put first uncommitted block:
Put second uncommitted block:
Commit two blocks as one Blob:
Steps to reproduce
Try to use PutBlockList
Additional context
I originally wanted to send a PR with a fix, but judging by the rules it has to be negotiated in Issue first. And yes I know AppendBlock works in a similar way and it works fine.
I will provide a fix for a bug