技术开发 频道

Visual Studio开发Windows Azure云应用

 Storage Emulator可以方便你存储端点。让我们将应用程序发布到云端。

Figure 9: Storage Emulator

首先需要为Windows Azure Storage设置连接字符串,在Windows Azure中指向你的存储。右键云项目,选择发布。你会看到如图10中显示的对话框。

Figure 10: Publish the project to Windows Azure

  如果你的Role定位的是.NET 4框架,你就可以运行Visual Studio 2010旗舰版,并且可以使用智能跟踪。如果你这么做了,你就可以使用智能跟踪来执行调试功能。

  如果你选择了蓝色链接“Configure Remote Desktop connections…”,在完全启用后,你就可以使用远程连接来登录实例,在此之前你需要创建一个证书并将其上传至主机服务器端。我打算跨过这个步骤,点击OK。

  Visual Studio将用来构建解决方案,创建服务包,并将服务包上传,创建新的VM,并将服务包部署在VM上。图11 Visual Studio中Windows Azure Activity Log中可以清晰反应出进度。一旦完成,界面会提示“Complete”。

  Figure 11: Windows Azure Activity Log displayed while publishing to the cloud.

  你可以在Windows Azure Portal(http://windows.azure.com)中查看进度,如图12所示。

  Figure 12: Viewing the status of the deployment in the portal.

  我们可以使用Portal来管理所有的服务以及存储账号。你也可以通过portal来编辑部署的服务配置信息。如果你已经配置好了RDP,通过这个Portal你就可以链接到你的实例。

  在你成功发布Role以后,你需要在浏览器中打开URL,可以查看到云端运行的Web应用程序。一旦Role完成以后,你可以在Windows Azure Activity Log中点击链接,如图13所示。

  Figure 13: Completed deployment.

  你也会看到这个链接“Open in Server Explorer”. 如果你点击这个链接,Visual Studio将会显示Server Explorer。你也会看到正在运行的实例,如图14所示。

  Figure 14: Server Explorer

  你也可以在Server Explorer中查看Windows Azure Storage。你需要在列表中新增你的存储账号。右键Windows Azure Storage,选中Add New Storage Account。验证完毕后,你就可以查看内容,该内容是可读的,你可以查看表格中的行和列。

  总之,微软提供够了一个开发环境,将工具集成到了Visual Studio 2012中,方便.NET开发人员从事Windows Azure开发。你可以免费下载www.microsoft.com/cloud/windowsazure.

0
相关文章