Windows Azure 1.3 新特性-Start-Up 任务
来源:互联网 发布:淘宝桌面快捷方式 编辑:程序博客网 时间:2024/06/05 17:40
公告 :本博客为微软云计算中文博客 的镜像博客。 部分文章因为博客兼容性问题 ,会影响阅读体验 。如遇此情况,请访问 原博客 。
在WindowsAzure1.3 中,我们可以通过Start-Up任务执行一些命令来配置Role的运行环境。比如注册COM组件,配置IIS设置等等。此文我们演示一下如何使用 Start-Up来配置WebRole运行环境,从而让其运行传统的asp页面。
- 1. 我们新建一个Cloud项目,添加一个WebRole。
- 2. 然后,在WebRole中创建一个测试用的asp页面:
<html>
<head>
<title>Hello, World!</title>
</head>
<body>
<%Response.write("Hello from Classic ASP!") %>
</body>
</html>
3. 现在我们创建一个cmd文件,写入安装IIS asp模块的命令。
start /w pkgmgr /iu:IIS-ASP
这里需要注意,cmd文件要使用ANSI编码保存。
- 4. 在WebRole项目中,添加此cmd文件,注意修改文件属性 Copy to Output Directory为 Copy Always.
- 5. 最后,我们要手动修改csdef文件,为我们的WebRole添加一个start-Up任务
<Startup>
<Task taskType="simple" executionContext="elevated" commandLine="setup.cmd" />
</Startup>
其中,commandLine指向我们写好的cmd文件, executionContext属性表明使用何种权限来执行command,我们这里需要Admin权限执行,因此选elevated。
TaskType的可选值有三种,含义如下:
- Simple:启动流程会阻塞在Startup任务步骤,直到所有任务都完成了
- Background: startup任务在后台运行,不会阻塞启动过程
- Foreground: 和Background方式类似,不过Role在所有Start-Up任务未结束前不会被关掉
- 6. 把项目部署到云上,我们的WebRole就可正常运行传统ASP页面了
参考资料:
http://channel9.msdn.com/Shows/Cloud+Cover/Cloud-Cover-Episode-31-Startup-Tasks-Elevated-Privileges-and-Classic-ASP
- Windows Azure 1.3 新特性-Start-Up 任务
- Windows Azure 1.3 新特性-Start-Up 任务
- 使用Windows Azure Storage Analytics新特性
- Troubleshooting - Windows Azure Storage Emulator Cannot Start
- 现在可用:跨地域备份和Windows Azure 存储的Blob、Table 和 Queue的新特性
- Start-up...
- start up..........
- Start up
- start up
- Start-Up
- START UP
- 公布Windows Azure新的数据中心选择
- Windows Azure Storage新的价格体系公布
- 新的 Windows Azure 网络安全性白皮书
- Windows Azure 新上线网络相关服务
- Code Quick Start: Capturing diagnostics in your Windows Azure application
- Start-up of Dual System Windows and Linux
- Windows CE: Programmatically Setting Up an Application to Auto Start
- C++中的字符串类型
- linux nfs mysql struts hibernate spring开发 运维 调优 总结
- MFC改变static text颜色
- 怎样看懂Oracle的执行计划
- Base64编码
- Windows Azure 1.3 新特性-Start-Up 任务
- 进制之间的转换
- HashSet 重写类的equals方法可以根据类的关键字段判断是否相等
- undefined reference to `sin'
- MSD对多个字符串的排序算法
- 在Struts 2中使用JSON Ajax支持
- gSoap的简易使用流程
- Oracle日期增加年/月/日/时/分/秒
- C++ http 请求