1

We have an application that we would like to migrate to Azure for scale. There is one place that concerns me before starting however:

We have a web page that the user is directed to. The code behind on the page goes out to the database and generates an HTML report. The new HTML document is placed in a temporary file along with a bunch of charts and other images. The user is then redirected to this new page.

In Azure, we can never be sure that the user is going to be directed to the same machine for multiple reasons: the Azure load balancer may push the user out to a different machine based on capacity, or the machine may be deprovisioned because of a problem, or whatever.

Because these are only temporary files that get created and deleted very frequently I would optimally like to just point my application's temp directory to some kind of shared drive that all the web roles have read/write access to, and then be able to map a URL to this shared drive. Is that possible? or is this going to be more complicated than I would like?

I can still have every instance write to its own local temp directory as well. It only takes a second or two to feed them so I'm ok with taking the risk of whether that instance goes down during that microsecond. The question in this regard is whether the redirect to the temp HTML file is going to use http 1.1 and maintain the connection to that specific instance.

thanks, jasen

Feech
  • 439
  • 1
  • 6
  • 14

3 Answers3

1

There are 2 things you might want to look at:

  • Use Windows Azure Web Sites which supports some kind of distributed filesystem (based on blob storage). So files you store "locally" in your Windows Azure Web Site will be available from each server hosting that Web Site (if you use multiple instances).
  • Serve the files from Blob Storage. So instead of saving the HTML files locally on each instance (or trying to make users stick to a specific instance), simply store them in Blob Storage and redirect your use there.
Sandrino Di Mattia
  • 24,739
  • 2
  • 60
  • 65
  • I have not been able to find any information on the "Azure Web Sites Shared Storage". I am under the impression blob storage is not for high-volume writes, which creating these temp files causes. I really need just some kind of shared network drive across all my azure websites..?? – Feech Jan 09 '13 at 22:45
  • Blob storage is the shared drive of Azure, you just can't access it like the rest of the Windows OS. If you are going to redirect users to HTML in blob storage, I'd look at using a custom domain http://msdn.microsoft.com/en-us/library/windowsazure/ee795179.aspx – knightpfhor Jan 10 '13 at 17:55
0

Good stuff from @Sandrino. A few more ideas:

  • Store the resulting html in in-role cache (which can be collocated in your web role instances), and serve the html from cache (shared across all instances)
  • Take advantage of CDN. You can map a "CDN" folder to the actual edge-cache. So you generate the html in code once, and then it's cached until TTL expiry, when you must generate the content again.
David Makogon
  • 69,407
  • 21
  • 141
  • 189
  • Hi David, I don't think storing lots of images and html in the distributed cache is the right way to go.. technically it may work but it just feels wrong. If I could just get access to a shared drive across all Azure websites and map that shared drive to a URL.. thank would be wonderful. – Feech Jan 09 '13 at 22:46
0

I think azure blob is best place to to store your html files which can be accessed by multiple instances. You can redirect user to that blob content or you can write custom page to render content from blob.

bhavesh lad
  • 1,242
  • 1
  • 13
  • 23