如何在Azure中使用IIS app_offline.htm文件 [英] How to use IIS app_offline.htm file with Azure

查看:110
本文介绍了如何在Azure中使用IIS app_offline.htm文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个设计精美的 app_offline.htm 文件,当我执行备份数据库之类的操作时,我希望该文件定期显示在我的网站上.在具有真实文件系统的服务器上,这将不是问题:我只需将app_offline.htm复制到我的应用程序的根目录下,IIS将发挥其魔力并将所有请求重定向到该文件.

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.

但是,我使用的是 Azure ,因此没有真实文件系统,也没有简便的方法将文件从一个位置移动到另一个位置.

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.

我如何使app_offline.htm在Azure上正常播放?

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

推荐答案

实际上,有一个 真实文件系统,因为每个VM实例都运行在Windows 2008 Server(SP2或R2 SP1)上.要亲自查看,请为您的部署启用远程桌面并连接到正在运行的实例.

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.

知道了这一点,您应该能够建立一种机制,以根据某种类型的管理命令将app_offline.htm复制到您的应用程序根目录.您只需要确保您的每个Web角色实例都执行此操作即可.

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.

这篇关于如何在Azure中使用IIS app_offline.htm文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆