Logo
programming4us
programming4us
programming4us
programming4us
Home
programming4us
XP
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server
programming4us
Windows Phone
 
Windows Azure

Hosting Silverlight applications in BLOB storage (part 1) - Hosting the Silverlight Spectrum emulator

3/14/2011 10:31:34 PM
- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019
Although you’ll usually host your Silverlight applications in a standard Windows Azure web role, you can host your Silverlight applications in BLOB storage, if required. Depending on your web application, you can effectively use BLOB storage to achieve massive scale for minimal cost. If you run a foreign currency exchange website, you might want to host the main site (which could offer the option to purchase currency) in a web role, but host an exchange rate calculator in BLOB storage.

In this section, we’ll look at how you can enable such scenarios by showing you how you can do the following using BLOB storage:

  • Host a standalone Silverlight application that’s contained in a static HTML page

  • Host a standalone Silverlight application that’s contained in an ASP.NET web page

  • Get your Silverlight application that’s hosted in BLOB storage to communicate with external web services

  • Store external Silverlight application access files

And now for the details that will enable you to do all this wonderful stuff with BLOB storage.

1. Hosting the Silverlight Spectrum emulator

If you’ve developed a standalone Silverlight application that requires no interaction with any backend services, BLOB storage is a cost-effective candidate for hosting your Silverlight application. These types of applications typically include games, tax calculators, and other widgets.

For our next example, we’ll show you how to host a small Silverlight application in BLOB storage. The application that you’ll host is a Silverlight ZX Spectrum emulator, which was an 8-bit home computer of the 1980s, very like a Commodore 64 (actually, that’s not true; it was much worse, but it had spirit). Figure 1 shows the emulator running from BLOB storage.

Figure 1. Silverlight application running in BLOB storage


The ZX Spectrum emulator not only allows you to play games from the 1980s, but as you can see from figure 1, you can even write BASIC programs in it. Now, we don’t want you to lose focus on this book as soon as you load this thing. As cool as Jet Set Willy is, it won’t help you deliver your amazing cloud-based application. You’ll have to continue to pay attention to learn how to do that.

To store the application in BLOB storage, upload ZXSilverlight.xap using the same procedure you used in the previous section. (You can download this Silverlight application and its source code from http://www.azureinaction.com.) You must set the BLOB with the correct MIME type; otherwise, the browser won’t be able to launch the application. The MIME type for a Silverlight application is application/x-silverlight-app.

You’re also going to store the HTML page that hosts the Silverlight application in BLOB storage. The following listing shows the HTML that runs the ZX Spectrum emulator Silverlight application (ZXSilverlight.app).

Listing 1. HTML for the ZX Spectrum emulator Silverlight application

By looking at listing 1, you can see that the HTML page doesn’t have any logic in it. Its job is to host the Silverlight application. Because this web page is just a host for a Silverlight application, using a full-fledged web server would be a little over the top (and expensive); a static HTML page hosted in BLOB storage will do the job perfectly.

Tip

If you have an existing web page that you host outside BLOB storage (you’re using a web role or an existing web hosting provider to host it), you can still host your Silverlight application in BLOB storage but keep your site with your existing host. To do so, you need to change the source parameter of the Silverlight plug-in (see listing 1) to point to your BLOB storage URI.


This standalone Silverlight application doesn’t require access to any backend web services, but what if you want to host an application that does? You can still host your application in BLOB services, but you’ll need to understand how a cross-domain policy works.

Other -----------------
- Hosting static HTML websites (part 2) - Publishing your website to BLOB services
- Hosting static HTML websites (part 1) - Creating a static HTML website
- Performing storage account operations using REST (part 3) - Creating a table using the REST API
- Performing storage account operations using REST (part 2) - Deleting tables using the REST API & WCF Data Services and AtomPub
- Performing storage account operations using REST (part 1) - Listing tables in the development storage account using the REST API
- Doing CRUDy stuff with the Table service (part 3) - Deleting entities & Updating entities
- Doing CRUDy stuff with the Table service (part 2) - Adding entities & Listing entities
- Doing CRUDy stuff with the Table service (part 1) - Creating a context class
- Developing with the Table service
- Partitioning data across lots of servers : Partitioning the storage account & Partitioning tables
 
 
Top 10
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
 
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server