I have an application that sends images to an azure blob storage account running on Android.
We had to upgrade to 10.2.2 as the app kept hanging when the device went to sleep (which has now been fixed) - however we have found that since upgrading we are unable to send images. (the code still works on Windows 32 - just fails on Android)
Response from Azure is as follows...
AuthenticationFailed
I have created a simplified version of the code to ensure that it wasn't anything else affecting it... (see below - just a test frame)
procedure TForm1.btTestClick(Sender: TObject);
var
vFile: TLocalFile;
vFileName: String;
vHomePath: String;
FS: TFileStream;
Content: TBytes;
Success: Boolean;
vConnectionInfo: TAzureConnectionInfo;
vBlobService: TAzureBlobService;
RespInfo: TCloudResponseInfo;
vConnection: TAzureConnection;
begin
vFileName := 'TRUCK01.JPG';
vHomePath := TPath.GetHomePath();
FS := nil;
RespInfo := TCloudResponseInfo.Create;
try
vConnectionInfo := TAzureConnectionInfo.Create(nil);
vConnectionInfo.AccountName := 'xxxxxx';
vConnectionInfo.AccountKey := 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';
vBlobService := TAzureBlobService.Create(vConnectionInfo);
if vBlobService <> nil then
begin
FS := TFileStream.Create(vHomePath + TPath.DirectorySeparatorChar + vFileName, fmOpenRead);
Content := ByteContent(FS);
Success := vBlobService.PutBlockBlob('images', vFileName, Content, EmptyStr, nil, nil, RespInfo);
end;
finally
FreeAndNil(FS);
FreeAndNil(RespInfo);
end;
end;
Has anyone else seen this behaviour - just trying to decide if I should log as a bug - not managed to find a work around so far and the headers look fine on debug...
thanks
Robin