Book Image

Windows Azure programming patterns for Start-ups

By : Riccardo Becker
Book Image

Windows Azure programming patterns for Start-ups

By: Riccardo Becker

Overview of this book

Leverage different Windows Azure components together with your existing Microsoft .NET skills to fully take advantage of the power of Windows Azure. Use this book to start small and end big by creating and using storage, cloud services, sql databases, networking, caching and other innovative technology to realize your first top-class Windows Azure service! "Windows Azure for Start-ups" is an incremental guide that will take you from the essentials of the Windows Azure platform up to the realization of your own cloud services running on the platform. You will learn how to apply different technologies of the Windows Azure platform with the help of examples all focusing on one single fictitious start-up scenario. This book is centred around a fictitious company called Geotopia that wants to build a brand new social network by using the Windows Azure platform. It will take the reader from the theory and rationale behind Windows Azure right to building services and coding C#. The books starts by outlining the concepts of Windows Azure. It then demonstrates how to set up a development environment and how to build your application by using different storage mechanisms, applying different features from the Windows Azure platform and ending with the newest features explained from the latest release. Windows Azure for Startups will help you take full advantage of the Windows Azure platform and bring your new service online as quickly as possible.
Table of Contents (18 chapters)
Windows Azure Programming Patterns for Start-ups
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Using blobs


In this section, we will learn how to use blob storage and how to upload and download files from blob storage. One of the requirements for Geotopia is that users must have the ability to send each other large files and be notified through Facebook or e-mail, for example. The uploaded file is stored in blob storage and the unique URI is sent to the receiver. This section contains snippets of code that demonstrate how to upload, download, and use the parallel abilities of the .NET framework.

File transfer

The Geotopia domain needs a feature that enables users to upload files such as images and video to a central place where they are stored and made available for other users.

To enable this, we have created a class called AzureBlobUtil, which enables uploading blobs to a designated container and downloading files to a local disk.

The following code snippet demonstrates how the AzureBlobUtil class can be utilized:

AzureBlobUtil _blobUtil = new AzureBlobUtil();
       
CloudStorageAccount...