Quantcast
Channel: Embarcadero Community - Embarcadero Community
Viewing all articles
Browse latest Browse all 1963

Azure Blob Storage stopped working on 10.2.2

$
0
0

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

Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.'#012'RequestId:e59dac40-123s-223ss-3aa8-790859000000'#012'Time:2017-12-20T15:37:32.5664891Z

The Date header in the request is incorrect.

 

 

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


Viewing all articles
Browse latest Browse all 1963

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>