4

I think the question says it all: How can I upload an image to an azure blob storage using JavaScript for Windows 8 Apps? I can only find examples for C# on the internet but nothing for JavaScript.

2 Answers 2

2

You need to have the sas (shared access signature) url for the azure container/blob. then, you can use this code snippet with minor modification to upload your image.

It is highly unlikely that someone would put the storage primary key in the windows store app code. you can refer this code to generate authorization header for the request. This code does not need sas url for the container. but needs the storage account name and primary key to generate authorization header.

If the azure container or blob can be made public for write (I have not tried) - the first solution can be used without SAS url.

Sign up to request clarification or add additional context in comments.

Comments

0

You can't unless the javascript makes an async call back to your app. The Azure BLOB REST API (and all the Azure REST APIs) require request header modification to include security credentials. See an explicit answer to your question here.

1 Comment

That's not quite true. The CORS issues referred to in your link is about running in the browser. Win8 js apps don't have CORS limitations and you can XHR to anything you want.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.