To create a RESTful service running on Azure you’ll need to download the Windows Azure free 90-day trial:

Here is the diagram about what we are going to build.

How to consume REST from a browser

All modern browsers are capable of RESTful calls. Here we can see Internet Explorer making a RESTful web service call and populating <select..> html control using jQuery.

After migrating my Azure Project to the cloud, everything worked as expected across the 3 browsers that I tested with.

jQueryCallRESTful.htm

Here is the project right before I deployed it. Previous videos illustrate this step. Essentially, you need to “Package” the application, then go to the portal to upload the package and configuration files.

Our web page is very simple. You start by including some jQuery. Next, you write some Javascript that makes Ajax calls after clicking the button. The Javascript (using jQuery framework) will retrieve the data and then populate a drop down list control.

Notice the warning from Internet Explorer. That is because I am running locally, as “localhost,” which is a cross-domain scripting violation. By answering “yes” you are allowing the cross-domain Ajax call.

A select and and button control

cboFastBikes gets loaded with data after making AJAX calls to the Azure hosted RESTful web service.

The jQuery call to an Azure-hosted web service

The code below uses jQuery to retrieve RESTful data. If successful, the Javascript will populate an HTML <select /> control, which is essentially a combo box.