none
Loading HTML / WebPage Contents Stored in Private Blob container

    Question

  • I have stored HTML Page in private Blob container. I have generated Shared Access Signature and if i access the url of webpage with that signature then only web page loads in browser and images and JS files fails to load. ( As their URL are also requiring SAS key).

    How to load webpage contents stored in private blob container i.e if i access the webpage url it should automatically load its associated data.

    Tuesday, June 07, 2011 7:26 AM

Answers

All replies

  • SAS is dynamic.

    You'll need to dynamically create links to images and JS files in your HTML with every request. So, you'll need to add some dynamic content to static HTML.


    Windows Azure Consultant http://cloudikka.wordpress.com/ (Don't open this link, if you don't understand czech language)
    Tuesday, June 07, 2011 7:43 AM
  • Do i need to create HttpHandler to append SAS to each item Url that is accessed by main webpage ?
    Tuesday, June 07, 2011 8:09 AM
  • I think you have to use dynamic pages and some of page event to generate SAS URL of blobs. I really miss the point of using SAS on images and JS files. If somebody wants too much he will steal you these files anyway.


    Windows Azure Consultant http://cloudikka.wordpress.com/ (Don't open this link, if you don't understand czech language)

    Tuesday, June 07, 2011 11:22 AM
  • Thanks Petr,

    Actually, the problem is that i have to save e-learning courses on azure storage. I can not change the content of that courses. These courses are HTML pages with Javascript, images and css files, and they are browsed / executed in browser.

    How to secure those courses so that they are not publicly browse-able and also secure. Only our application should be able to browse those courses.

    Thursday, June 09, 2011 1:44 PM
  • Hi yazeem,

    > How to secure those courses so that they are not publicly browse-able and also secure. Only our application should be able to browse those courses.

    You can create a http handler to serve and secure files from blob storage. When the browser send a request to your service via http://xxx.cloudapp.net/courses/index.html or http://xxx.cloudapp.net/courses/style.css, it will be actually served by your own http handler. The http handler will get the actual file content (no matter it is a html, js or image file) from blob storage and return the content. By using this way, we can protect the http handler using the the built-in ASP.NET authorization and authentication functionality. Or you can use your own way to authenticate users as you have full control of the http handler.

    Please also refer to these resources:

    Protect Files and Folders Using HttpHandlers in ASP.NET
    http://www.codeproject.com/KB/web-security/HttpHandlersInAspNet.aspx

    Integrating BLOBs with your ASP.NET websites
    http://allcomputers.us/windows_azure/integrating-blobs-with-your-asp_net-websites.aspx

    Thanks,


    Wengchao Zeng
    Please mark the replies as answers if they help or unmark if not.
    If you have any feedback about my replies, please contact msdnmg@microsoft.com.
    Microsoft One Code Framework
    • Marked as answer by Wenchao Zeng Tuesday, June 14, 2011 1:58 AM
    Friday, June 10, 2011 6:32 AM
  • Thanks Wenchao Zeng for your solution
    Tuesday, June 14, 2011 5:41 AM