git.net

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to fix azure-blob component “Server failed to authenticate the request”


Hi,
I'm pretty sure I did run the tests against a test account I had at a time
and it worked, I could see the blobs being uploaded (the secret has to be
base64-encoded as far as I recall). But the tests are currently ignored as
I could not solve the issue of setting up a test account during the actual
Camel build (the Azure emulator can only run on Win if I remember it
correctly...)

thanks, Sergey

On Sun, Dec 23, 2018 at 12:25 PM Claus Ibsen <claus.ibsen@xxxxxxxxx> wrote:

> Hi
>
> Have you tried look at the unit tests to see if there is an test that
> may help you on the way.
>
> And if possible can you post the full stracktrace, maybe edit the post
> on SO. And also try with newer Camel versions if possible.
>
> On Sat, Dec 22, 2018 at 11:13 AM Shafeeq Muhammad
> <shafeeqe.muhammad@xxxxxxxxx> wrote:
> >
> > Hi,
> >
> > I'm setting up apache-camel in spring boot application. And it is worked
> > fine for file and ftp consumer/producer. But while trying to use
> azure-blob
> > component as consumer the following error appears.
> >
> > *com.microsoft.azure.storage.StorageException: Server failed to
> > authenticate the request. Make sure the value of Authorization header is
> > formed correctly including the signature.*
> >
> > *My router is*
> >
> > *@Component*
> >
> > *public class AzureFileImporter extends RouteBuilder {*
> >
> > *@Bean*
> >
> > *protected StorageCredentials azureAuth() {*
> >
> > *return new StorageCredentialsAccountAndKey(*
> >
> > *    "AccountName",*
> >
> > *    "PlainAccountKey");*
> >
> > *}*
> >
> > *@Override*
> >
> > *public void configure() throws Exception {*
> >
> > * from("azure-blob:AccountName/ContainerName/blockBlob? *
> >
> > *  credentials=#azureAuth")*
> >
> > *    .routeId("azureFileImporter")*
> >
> > *    .noAutoStartup()*
> >
> > *    .log("Downloading file ${header.CamelFileName} complete.")*
> >
> > *    .to("file://input/ftp")*
> >
> > *    .end();*
> >
> > * }*
> >
> > *}*
> >
> > *While using azure-blob component with same account as producer no error
> is
> > thrown. But the blob is not uploaded into the storage. Also tried with
> > Base64 encoding of the key.*
> >
> >
> > *Versions used:*
> >
> > *apache-camel : 2.22.1*
> >
> > *springBootVersion = '2.0.5.RELEASE'*
> >
> > Link to my stackoverflow question: here
> > <
> https://stackoverflow.com/questions/53887740/how-to-fix-server-failed-to-authenticate-the-request-error-in-apache-camel-azu
> >
>
>
>
> --
> Claus Ibsen
> -----------------
> http://davsclaus.com @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2
>