How to use IIS app_offline.htm file with Azure

我怕爱的太早我们不能终老 提交于 2019-12-14 00:22:51

问题


I have a brilliantly designed app_offline.htm file that I'd like to display on my site periodically when I'm doing things like backing up the DB. On a server with a real file system, this wouldn't be a problem: I'd just copy app_offline.htm to the my app's root, and IIS will work its magic and redirect all requests to this file.

However, I'm using Azure, so there's no real file system and there's no easy way move files around from one location to another.

How I can I make app_offline.htm play nicely with Azure?


回答1:


Actually there is a real file system, as each VM instance runs on Windows 2008 Server (SP2 or R2 SP1). To see this for yourself, enable Remote Desktop for your deployment and connect to a running instance.

Knowing this, you should be able to set up a mechanism to perform a file-copy of your app_offline.htm to your app root based on some type of administrative command. You'll just need to make sure each of your web role instances perform this action.




回答2:


I figured I'd add this, I haven't seen it mentioned yet. You can actually do this via web publish from Visual Studio (or WebMatrix) as well, just put app_offline.htm in the root of your project - the same level as your main web.config. When done, just rename it and redeploy to go back online. 2 clicks - easy.

The manual option is to drop it into your /site/wwwroot via FTP.

A little personal secret, none of your site files will be accessible, style sheets etc. So put your includes into an azure blob container, and viola.




回答3:


David has provided you with a good answer. However, you might be missing out on what Azure can do for you. You should be able to virtually eliminate down time with Azure by running multiple instances and using SQL Azure which is triple backed up for you. You can also backup SQL Azure using http://msdn.microsoft.com/en-us/library/ff951624.aspx



来源:https://stackoverflow.com/questions/6254516/how-to-use-iis-app-offline-htm-file-with-azure

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!