i have written a stand alone WCF REST service in 4.0 under Studio 2010 but i decided to host it under Azure as opposed to Amazon AWS. Is there an easy way for me to convert it or what do i need to do so it runs under Azure's web role? I created a blank web role project in Studio but the structure of the WCF seems totally different.

有帮助吗?

解决方案

You shouldn't have to do anything special to get your service on Azure. Depending on how you do your WCF service, you can just add it as a cloud role. If you want to see an example of a WCF service used in Azure you can download our Windows Phone 7 Guidance that has a WCF 4 REST service hooked for a Windows Phone 7 project. You can the chapter about that here. You can get the code here and check out the service.

其他提示

If your service is "pure wcf", then you can deploy it as a worker role if you want to - see this tutorial http://www.codeproject.com/KB/azure/WCFWorkerRole.aspx

If you want instead to embed your WCF service inside a web role, then there are plenty of samples available - see this article for a good intro - http://www.devproconnections.com/article/windows-azure-platform3/Hosting-WCF-Services-on-Azure-101

Just make sure you set the proper endpoints within the .csfg

Do do this, expand the Azure project and hit properties on the role that needs to expose those endpoints.

If you don't have any roles, then right click on the Roles folder and "Add" one. Then hit properties.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top