azure - Authenticate Amazon S3 bucket with C# using AWSSDK.S3 -
edit:- need move files created on amazon s3 azure blob storage, i've not used amazon s3 before , details have been provided include 'path' i'm not 100% on how use awssdk.s3 nuget package in c#..
so, having never used amazon s3 before, , trying build azure worker role (or webjob) watch storage location , move file or files azure blob storage when appear - seems easy, i'm failing @ authentication stage s3, , problem 'path' variable have.
i have tested connection using cyberduck, , have following params:
access key id, secret access key, , path.. path "folder/folder/"
without path, receive access denied response cyberduck... fine, expected - cannot work out how embed path either visual studio aws credential manager or in code within test console harness i've written..
the aws explorer, deals credentials allows me enter:
access key id, secret access key, account number ????
do need code manually? been reviewing this, not had enough time digest today:
https://blogs.aws.amazon.com/net/post/tx1310vg2o81psy/referencing-credentials-using-profiles
cheers,
ty.
managed kind of resolution on in end, cheers down-votes guys :/
in original post said trying navigate "folder/folder" first folder bucket name (so turns out) - i'm not admin on s3 account going pretty blind this.
string accesskeyid = "removed"; string secretaccesskey = "not/a+real/key"; basicawscredentials awscreds = new basicawscredentials(accesskeyid, secretaccesskey); amazons3config s3config = new amazons3config { serviceurl = "https://folder.s3.amazonaws.com/", regionendpoint = regionendpoint.useast1 }; amazons3client s3client = new amazons3client(awscreds, s3config); listobjectsrequest request = new listobjectsrequest(); request.bucketname = "folder"; request.prefix = "folder/another_folder/"; listobjectsresponse response = s3client.listobjects(request); foreach (var item in response.s3objects) { sr.writeline(item.key.tostring()); }
hope helps someone, still maintain sdk doco awful ;)
i shall put credentials in app.config, guess best practice?
Comments
Post a Comment