Windows Azure Websites, Web API and SignalR

One of our projects involves a web service that implements both SignalR and Web API and we were looking at the quickest and most cost effective way to get it deployed so that one of our customers could run a Windows 8 application as a demo away from the office. The application works well internally as we have the service deployed on one of our servers on IIS. The options we were considering were:

  1. Package the application up in an install package, ship this to our customer and then provide them with instructions and support to allow them to deploy and configure their application
  2. Deploy it on one of our servers and then publish the service through our firewall
  3. Deploy as a Cloud service in Windows Azure
  4. Deploy as a website in Windows Azure

We considered the fact that the first option would probably take us a fair amount of time to make a deployment package, test it and provide enough documentation and support to allow our customer to deploy it on their servers. The other 3 options involved us doing a smaller amount of work, but at least we could get everything working well before shipping the demo out. Option 2 would mean using our internal resources for something that would not be used that often but we would not necessarily know whether and when it was being used so the resources would need to be kept running limiting our capacity internally. Windows Azure was a good fit for this application and the choice was really between setting up a cloud service or use a web site, I guess we could have set up a virtual machine hosted in Windows Azure, but this was a bit excessive just for a simple web service. The two remaining options were to set up a cloud service by creating a web role in deploying to Windows Azure or to use Websites. The cloud service would involve more work for us as we would need to change the project to add in the cloud service project and web role and then do a full PaaS deploy to Windows Azure. This would then utilise a whole virtual machine (although we would have used an Extra Small instance), but the web sites seem a sensible option especially as we already have a number of them available for free. How easy was this going to be and will both Web API and SignalR work with Windows Azure Websites, especially as we were using preview software. I was surprised about how easy this was to deploy and I’ll walk through the process we went through.

Step 1: Make sure that the service runs locally,

Step 2: Our service uses Code First Entity Framework using a local SQL server. Create a database using Windows Azure SQL Server via the Windows Azure Management portal (https://manage.windowsazure.com), the copy the ADO.NET connection string.

image

Paste this into your web config file of the web api service. You will need to make sure that the Windows Azure SQL Server firewall has your public IP address configured and you will need to make sure that your firewall will allow connections through port 1433. Now run your application and make sure that you can connect to the Windows Azure SQL database. As we are using Code First Entity Framework, the database tables were created for me so I didn’t need to do any database deployment. The only issue I had with this approach was that I had to create the database first in Windows Azure.

Step 3: With our service running locally but with the database in Windows Azure we are now ready to deploy to the cloud. In the Windows Azure Management portal, click the “New” button

image

The “Quick Create”, enter the url you want to use and click “Create Web Site”

image

Step 4: We now need to deploy our service. In the Azure management portal, navigate to the web site you just created and click “Download Publishing Profile”. Save this to your computer.

image

In Visual Studio 2012, open your web api project, right click on the project in Solution Explorer and click publish.

image

This will display the publish dialog.

image

Click the import button and navigate to the folder where the publish profile was saved. This should then allow you to complete the wizard

image

Click Next and check to make sure the correct connection string is displayed, click Next then Publish. This should then start to upload your web api project to the Windows Azure Website. The deploy should be relatively quick and no where near the time it takes to deploy a cloud service. When completed, your deployed website should start in the browser and you can carry out whatever tests you need.

Step 5: With your website deployed you should just need to change the url of your service in the Window 8 application.

This whole process took less than 10 minutes to setup and deploy. One of the nice features of using websites is that changes are quick to deploy.

We had a number of issues to get this all working fully:

  1. As I mentioned earlier we had to ensure that the database was created before the EF code would create the correct tables
  2. When we first ran the Windows 8 application we were getting an error each time we tried to use SignalR. We received an “Incompatible protocol version”. This was because I installed the latest SignalR libraries on the server side code but the client was using an older version. You need to make sure that both the client and server are using the same version of SignalR
  3. We also had an issue when deployed to Windows Azure where it looked like the SignalR hubs were not being created correctly. It looked like the hub creation was hanging and not returning. This is a known issue that has been fixed but not yet deployed to Azure. There is a work around which is to configure SignalR to use long polling (https://github.com/SignalR/SignalR/issues/510). We did that with the following code:
   1: hubConnection = new HubConnection(App.SignalRUrl);            

   2: proxy = App.hubConnection.CreateHubProxy("statushub");

   3: App.hubConnection.Start(new LongPollingTransport()).Wait();

Windows Azure Web Sites is not just for web sites, using it also for services can make a lot of sense as the scaling model will allow a lot of flexibility and can provide a cost effective way to host your services, especially if they are not heavily loaded at the start. They are also easy and fast to deploy which is always a bonus Smile

66 Replies to “Windows Azure Websites, Web API and SignalR”

  1. No one site has every insurer, and some female drivers will pay 40% more for %Anchor-Text% – http://www.comercioeletronico.org.br/wiki/index.php?title=Usu%C3%A1rio_Discuss%C3%A3o:KarryMckay than today. The report follows a House of Commons has passed, without a vote, a motion calling for a cross-government effort to drive down the costs of that risk. cheap motor trade insurance; d15-238.static.icpnet.pl – http://d15-238.static.icpnet.pl/index.php/U%C5%BCytkownik:GaleDuckworth , motor trade insurance – http://wiki.juenger.com/index.php/Benutzer:KarlaBettencour motor trade insurance ( http://wikicts.med.up.pt/index.php/Anchor-Text_-_The_Optionshttp://wikicts.med.up.pt/index.php/Anchor-Text_-_The_Options )

  2. Fill in a title for your ad, then enter the text in the "Description" field. They sometimes come with new home warranties and if you are working with the builder, you are sometimes able to make specific choices to suit your tastes in regard to flooring, windows and kitchens. Smoke Detectors Electricians offer different types of services and smoke detector installation are one of them. my homepage – click The Next site – http://Www.dawahspace.com/blogs/319071/72412/immediate-methods-for-electricia

  3. I was wondering if you ever thought of changing the layout of your blog? Its very well written; I love what youve got to say. But maybe you could a little more in the way of content so people could connect with it better. Youve got an awful lot of text for only having 1 or 2 pictures. Maybe you could space it out better? Feel free to visit my blog dieta disociata ( http://gnuboard.thanksgivingchurch.com/bbs/index.php?document_srl=248292&mid=menu8NewfamilyPhotohttp://gnuboard.thanksgivingchurch.com/bbs/index.php?document_srl=248292&mid=menu8NewfamilyPhoto )

  4. Gittings Construction, located in Mount Carmel, IL, is known for getting the job done promptly. If it is in an area of the roof that doesn't have an area where two surfaces meet then you will probably notice a curled, damaged or missing shingle. You should not rush to settle with the first roofer that you meet. Take a look at my web blog … Roofers Nj – http://www.yjsmart.co.kr/xe/?document_srl=126631

  5. Nice post. I was checking continuously this blog and I'm impressed! Extremely helpful information specifically the last part 🙂 I care for such information much. I was looking for this particular information for a very long time. Thank you and good luck. Feel free to surf to my weblog – air conditioning – http://airconditioningsanantonio.info/

  6. Taylor Made design several of the greatest solid wood flowerbed planters in the country. Hand crafted from good quality elements at an very affordable price. Real wood planters appear in almost all designs and can be custom made produced to suit any area. Thanks to a lot more twenty years of working experience to date Taylor Made are one of the UK's top rated back garden planter manufacturing businesses with customers of all sizes. Custom garden planters – http://taylormadeplanters.co.uk/

  7. Hey! I know this is kinda off topic but I'd figured I'd ask. Would you be interested in exchanging links or maybe guest writing a blog article or vice-versa? My website addresses a lot of the same topics as yours and I believe we could greatly benefit from each other. If you're interested feel free to shoot me an email. I look forward to hearing from you! Awesome blog by the way! Here is my webpage: landscaping phoenix – http://phoenixlandscaping.info

  8. Taylor Made produce many of the finest solid wood flowerbed planters in the British isles. Constructed by hand from quality resources at an cost-effective price. Wooden planters can be purchased in almost all sizes and styles and can be tailor made produced to match your place. With approximately 20 years of practical knowledge thus far Taylor Made are one of the UK's best landscaping planter suppliers together with shoppers of all shapes and sizes. Taylor Made Planters – http://osl2.uca.es/iberogre/index.php/The_Beauty_Of_Taylor_Made_Wooden_Planters:_Add_Elegance_To_Your_Backyard_And_Patio

  9. Taylor Made build quite a few of the very best contemporary flowerbed planters in the United Kingdom. Built by hand from top notch elements at an sensible price. Timber planters can be purchased in all designs and can be custom manufactured to fit in any setting. Having more than 20 years of working experience to date Taylor Made are one of the British Isles top notch back garden planter manufacturers together with consumers of all backgrounds. Garden planters – http://taylormadeplanters.co.uk/

  10. Taylor Made create a number of the highest quality wooden garden planters in the United Kingdom. Built by hand from good quality resources at an economical cost. Timber planters arrive in all sizes and styles and can be professionally manufactured to conform to any specific location. Utilizing much more 20 years of knowledge thus far Taylor Made are one of the United kingdoms leading garden planter makers together with customers of all sizes. Hand built planters for your garden – http://Taylormadeplanters.co.uk/

  11. I blog frequently and I really thank you for your information. Your article has really peaked my interest. I am going to bookmark your blog and keep checking for new information about once per week. I subscribed to your Feed as well. my webpage … Recommended Seo VPS – http://www.solidseovps.com/

  12. I don't know if it's just me or if everybody else experiencing issues with your website. It appears like some of the written text in your posts are running off the screen. Can somebody else please provide feedback and let me know if this is happening to them too? This might be a issue with my web browser because I've had this happen before. Many thanks Feel free to surf to my web page – Eugene Charter Service – http://www.TheEugenePartybus.com

  13. Taylor Made produce a number of the very best timber backyard planters in the country. Hand built from fine quality elements at an inexpensive cost. Lumber planters are provided in all sizes and shapes and can be tailor made constructed to match the setting. Utilizing much more 20 years of knowledge to date Taylor Made are one of the nations prime back garden planter manufacturers with buyers of all types. Taylor Made – http://taylormadeplanters.co.uk/wooden-planters-11-c.asp

  14. Taylor Made produce many of the premier contemporary landscaping planters in the British isles. Crafted by hand from fine quality elements at an good value price. Timber planters arrive in almost all shapes and sizes and can be custom constructed to fit your area. With a lot more twenty years of knowledge to date Taylor Made are one of the UK's top notch backyard garden planter brands with purchasers of all types. Taylor Made – http://taylormadeplanters.co.uk/wooden-planters-11-c.asp

  15. Taylor Made build some of the best wooden backyard planters in the British isles. Hand constructed from high-quality elements at an economical price. Solid wood planters come in many shapes and sizes and can be tailor made manufactured to conform to any setting. Utilizing close to twenty years of knowledge up to now Taylor Made are one of the United kingdoms best rated garden planter manufacturers with buyers of all sizes. Taylor Made planters – http://taylormadeplanters.co.uk/wooden-planters-11-c.asp

  16. Taylor Made produce quite a few of the finest contemporary back yard garden planters in the United Kingdom. Built by hand from premium materials at an fair cost. Handmade wooden planters appear in most shapes and forms and can be professionally constructed to match your specific location. Utilizing much more than twenty years of expertise to date Taylor Made are one of the British Isles premier backyard garden planter makers with purchasers of all backgrounds. Hand Built Planters For Your Garden – http://taylormadeplanters.co.uk/

  17. Having a covering overhead is important for the person to remember that everything near your hot tub. There are a wide range of hot tubs might hot tub parts surprise you, but you'll certainly feel better after a session in one. However, many of the features in a modern Hot Tub some of which are:- A Massage sequencerAllowing you to be aware of the safety hazards and take the waters. It can be a hot tub parts very romantic and sensual experience. Feel free to surf to my blog; chamonix transfers – http://www.chamexpress.com/

  18. I do not know whether it's just me or if perhaps everyone else encountering problems with your site. It seems like some of the written text in your content are running off the screen. Can someone else please provide feedback and let me know if this is happening to them as well? This might be a problem with my browser because I've had this happen previously. Appreciate it Here is my site; modeling agencies in london for teenagers – http://www.find2loans.com/user.php?login=timothyuc

  19. Wonderful website you have here but I was wanting to know if you knew of any user discussion forums that cover the same topics talked about here? I'd really like to be a part of community where I can get advice from other experienced individuals that share the same interest. If you have any suggestions, please let me know. Kudos! My website: gyms around perrysburg ohio – http://srv2.wiki-ins.ru/wiki/Why_Is_A_Health_Club_Greater_Than_Operating_Out_In_the_house

  20. An outstanding share! I have just forwarded this onto a coworker who had been conducting a little homework on this. And he in fact bought me lunch simply because I stumbled upon it for him… lol. So allow me to reword this…. Thank YOU for the meal!! But yeah, thanx for spending the time to talk about this subject here on your internet site. Also visit my web site gyms in perrysburg ohio – http://wiedztom.webd.pl/dm2/wiki/index.php?title=Exactly_what_Exactly_Is_This_Mud_Run_Furor_All_About

  21. I absolutely love your blog and find nearly all of your post's to be what precisely I'm looking for. Does one offer guest writers to write content to suit your needs? I wouldn't mind publishing a post or elaborating on most of the subjects you write regarding here. Again, awesome website! Here is my web blog … Diese Website – http://www.mojduniya.com/forum/profile.php?id=73307

  22. Hey I know this is off topic but I was wondering if you knew of any widgets I could add to my blog that automatically tweet my newest twitter updates. I've been looking for a plug-in like this for quite some time and was hoping maybe you would have some experience with something like this. Please let me know if you run into anything. I truly enjoy reading your blog and I look forward to your new updates. Also visit my web page – social media management services – http://www.5cubecommerce.com/social-media-marketing.html

  23. Someone necessarily lend a hand to make significantly posts I might state. That is the first time I frequented your web page and to this point? I amazed with the research you made to create this particular post amazing. Wonderful job! my blog post: san antonio air conditioning – http://airconditioningsanantonio.info/

  24. Hey! I know this is kinda off topic nevertheless I'd figured I'd ask. Would you be interested in trading links or maybe guest authoring a blog post or vice-versa? My site goes over a lot of the same topics as yours and I feel we could greatly benefit from each other. If you are interested feel free to shoot me an email. I look forward to hearing from you! Excellent blog by the way! Here is my web-site website positioning – http://www.5cubecommerce.com/organic-search-engine-optimization.html

  25. You are so cool! I don't suppose I've truly read through anything like this before. So good to find another person with original thoughts on this subject matter. Really.. thank you for starting this up. This site is something that is required on the internet, someone with some originality! My page – this contact form – http://www.bossmodecoop.com

  26. The Numbers Helpline has sourced 1000's of customer service contact <a href="http://www.numbershelpline.co.uk/sky-customer-service-contact-telephone-number-uk/&quot;>Phone numbers</a> in the UK. We know how hard it can be to find those <a href="http://www.numbershelpline.co.uk/dvla-contact-phone-number/&quot;>Phonenumbers</a> at times that why we have made a directory with them all in one place so you will never have waste long periods of time looking for a customer service contact <a href="http://www.numbershelpline.co.uk/easyjet-customer-service-contact-phone-number/&quot;>Phonenumbers</a> again.

  27. The Numbers Helpline has sourced 1000's of customer service contact <a href="http://www.numbershelpline.co.uk/sky-customer-service-contact-telephone-number-uk/&quot;>Phone numbers</a> in the UK. We know how hard it can be to find those <a href="http://www.numbershelpline.co.uk/dvla-contact-phone-number/&quot;>Phonenumbers</a> at times that why we have made a directory with them all in one place so you will never have waste long periods of time looking for a customer service contact <a href="http://www.numbershelpline.co.uk/easyjet-customer-service-contact-phone-number/&quot;>Phonenumbers</a> again.

  28. The Numbers Helpline has sourced 1000's of customer service contact <a href="http://www.numbershelpline.co.uk/sky-customer-service-contact-telephone-number-uk/&quot;>Phone numbers</a> in the UK. We know how hard it can be to find those <a href="http://www.numbershelpline.co.uk/dvla-contact-phone-number/&quot;>Phonenumbers</a> at times that why we have made a directory with them all in one place so you will never have waste long periods of time looking for a customer service contact <a href="http://www.numbershelpline.co.uk/easyjet-customer-service-contact-phone-number/&quot;>Phonenumbers</a> again.

Leave a Reply

Your email address will not be published. Required fields are marked *