[英]Deploying a sql server based webservice on azure virtual machine
I have developed a web service in VS2008 in C#. 我用C#在VS2008中开发了一个Web服务。 The service queries a SQL Server Express 2012 database and returns the results. 该服务查询SQL Server Express 2012数据库并返回结果。 When I test the service on local development system it works fine. 当我在本地开发系统上测试服务时,它工作正常。
Now I have a windows azure trial account, and I want this service to be deployed on a virtual machine. 现在我有一个windows azure试用帐户,我希望将此服务部署在虚拟机上。
1- I have tried to create virtual machines with SQL server and Visual Studio on it, but could not create the service there. 1-我曾尝试使用SQL Server和Visual Studio创建虚拟机,但无法在那里创建服务。 VS does not have the Web services template there. VS没有那里的Web服务模板。
2- I have tried to create the deployment package on my dev system and tried to install the service but it also did not work. 2-我试图在我的开发系统上创建部署包并尝试安装该服务,但它也无法正常工作。
Please suggest the correct way of doing this task. 请建议正确的方法来完成这项任务。 I am very much new to all these concepts so may be I am missing some basic information and a step by step guide will not hurt. 我对所有这些概念都很陌生,所以可能是我缺少一些基本信息,一步一步的指导也不会受到伤害。
I am not sure that you did it that way, but the easiest way to create a cloud-hosted web service with MS SQL Backend would be: 我不确定您是这样做的,但使用MS SQL后端创建云托管Web服务的最简单方法是:
( Update: As Mark Rendle suggests in the comment and in his answer , there is no need to create a separate cloud instance as long as your service is light-weight and does only data fetching. Cloud instance would be, however, essential, if your service requires data processing or has some other logic entailing long-running processes). ( 更新:正如Mark Rendle在评论和他的回答中所建议的那样,只要您的服务重量轻且只提取数据,就不需要创建单独的云实例。但是,云实例是必不可少的,如果您的服务需要数据处理或具有一些需要长时间运行的逻辑。
Alternatively you might want to use Azure Mobile services , that already provide a web service for SQL Azure that might do. 或者,您可能希望使用Azure Mobile服务 ,该服务已经为SQL Azure提供了可能执行的Web服务。 This is a fully RESTful web service and you'll just need to write some logic in JavaScript, similar to Node.js implementation. 这是一个完全RESTful的Web服务,您只需要在JavaScript中编写一些逻辑,类似于Node.js实现。 See an excellent tutorial on this issue. 请参阅有关此问题的优秀教程 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.