0

I'm currently looking into problem: We have a backend application that creates XML files with content and stores them as Azure Blobs (we cannot change this).

Blob sample url: http://mytestaccount.blob.core.windows.net

We are implementing a webpage that consumes those XML files.

Our current solution is static webpage (no iis or any other server required) hosted on the same blob as mentioned XML files.

Question 1: Is there a way to redirect a domain name to our webpage hosted currently as blob?

We thought about hosting our web application not as Blob but using Azure Web Sites. This creates a problem of cross-domain requests (we have to get those XML files).

Website sample url: http://mytestpage.azurewebsites.net

Question 2: Is there a way to download XML by jquery ajax call from such a webpage (hosted as Azure Web Page) to xml stored as Blob?

user1438047
  • 133
  • 2
  • 5

1 Answers1

0

Question 1: Is there a way to redirect a domain name to our webpage hosted currently as blob?

Yes, it's certainly possible to do so however there're some limitations currently. Please see this link regarding configuring a sub-domain which points to blob storage: http://msdn.microsoft.com/en-us/library/windowsazure/ee795179.aspx. Please note that currently you don't get an option to specify default document for your website with this approach.

Question 2: Is there a way to download XML by jquery ajax call from such a webpage (hosted as Azure Web Page) to xml stored as Blob?

Reading the blob would not cause cross-domain request issues. Cross domain issue would come when you're trying to post/put some content in your blob storage.

As long as your blob container is public, you should be able to access the blob without any issues. It's a simple GET. However if your blob container is private, then you would need to create a shared access signature URI on the blob with "Read" permission and use that URI in your jQuery AJAX call.

UPDATE: Reading a blob via jQuery AJAX call would give a "Cross Domain" error.

Gaurav Mantri
  • 128,066
  • 12
  • 206
  • 241
  • 1
    Thanks for your answer. I still think that you are mistaken. I did a proof of concept check and there is now way to directy get by ajax get an xml file hosted as blob (lets say on http://mystorageaccount.blob.core.windows.net/files/myfile.xml) from a site hosted on Azure websites (http://myazurewebsite.azurewebsites.net/). Trying to get this file raises a cross domain error. – user1438047 Mar 04 '13 at 10:50
  • Yes, you're right. Got the same error when I tried to read a blob from a different domain. I've updated my answer. – Gaurav Mantri Mar 04 '13 at 12:28
  • I have decided to host my page as Azure Web Site (ASP.NET Role). Changed it from Free to Shared in order to use Custom Domain. Wrote a Generic Handler to access blob XML data. – user1438047 Mar 11 '13 at 10:10