Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Learning Microsoft Azure

You're reading from  Learning Microsoft Azure

Product type Book
Published in Oct 2014
Publisher Packt
ISBN-13 9781782173373
Pages 430 pages
Edition 1st Edition
Languages
Authors (2):
Geoff Webber Cross Geoff Webber Cross
Profile icon Geoff Webber Cross
Geoff Webber-Cross Geoff Webber-Cross
Profile icon Geoff Webber-Cross
View More author details

Table of Contents (19) Chapters

Learning Microsoft Azure
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
1. Getting Started with Microsoft Azure 2. Designing a System for Microsoft Azure 3. Starting to Develop with Microsoft Azure 4. Creating and Managing a Windows Azure SQL Server Database 5. Building Azure MVC Websites 6. Azure Website Diagnostics and Debugging 7. Azure Service Bus Topic Integration 8. Building Worker Roles 9. Cloud Service Diagnostics, Debugging, and Configuration 10. Web API and Client Integration 11. Integrating a Mobile Application Using Mobile Services 12. Preparing an Azure System for Production Index

Preface

Learning Microsoft Azure is a practical, hands-on book for learning how to build systems for Microsoft Azure. This book is themed around an enterprise case study based on a fictional industrial bakery called Azure Bakery, which spans three business units: sales, production, and supply. The entire system is built on the Microsoft Azure technology that utilizes a broad range of services.

The sales business unit is responsible for selling products to customers through the MVC 5 customer website, where customers can place orders and view their status as the order moves through the system. Products are managed through another administrator website that implements Azure Active Directory authentication. A Windows Phone app with .NET mobile service and Twitter authentication integrated with the customer website allows customers to view the order status on their phone and receive push notifications via the notifications hub when the order status changes and new products are created. The sales system has its own dedicated SQL Azure Database and communicates with the other systems via a Service Bus topic. A worker role is implemented to keep the sales system updated as orders are processed through the enterprise system.

The production business unit is responsible for manufacturing the products for the customer orders and has a worker role at the core of it, which consumes customer orders from the Service Bus topic, enters the orders into the production SQL Azure Database, creates batch schedules to bake products, and allocates stock in the system. Production staff uses an on-premises WPF client application with Azure Active Directory authentication to view batch schedules and manage stock via a Web API 2 service with SignalR hub and Azure Service Bus backplane, allowing client applications to update in real time.

The supply business unit is responsible for picking up and packing orders from the production business unit and delivering them to customers. A worker role consumes orders from the Service Bus topic and stores customer details in a table storage, and automatically creates barcode labels stored in a blob storage. Supply staff interacts with the system via an Enterprise Windows Store app, which is authenticated with Azure Active Directory and has a .NET mobile service backend.

As we're building the system, we learn about the topic we're exploring and apply it to our system with detailed walk-throughs and relevant code samples. There are complete working code samples for the entire system that are broken down chapter-wise.

What this book covers

Chapter 1, Getting Started with Microsoft Azure, gives an introduction to cloud computing and Microsoft Azure followed by how to choose a subscription and signing up for a subscription. We finish this chapter by taking a look around the portal, and then start looking at the different services Microsoft Azure has to offer.

Chapter 2, Designing a System for Microsoft Azure, covers designing scalable, resilient systems for Microsoft Azure by looking at methodologies for breaking systems into subsystems and selecting appropriate Azure services to build them. This process will be applied to design a small system for an independent station that requires a website and a basic administration system; it is then extended to a full enterprise system, where will we introduce the Azure Bakery case study.

Chapter 3, Starting to Develop with Microsoft Azure, gives you the first taste of developing for Microsoft Azure, where you will prepare their development environment with the required tools and sign up for a Visual Studio Online account. We'll create the foundations of the sales customer website and publish it to the cloud, and then set up continuous deployment using the Visual Studio Online Team Foundation build server.

Chapter 4, Creating and Managing a Windows Azure SQL Server Database, creates a database for the sales business unit and builds it using Entity Framework Code First Migrations. This chapter will examine different tools for working with the database from a developer and administrator point of view, and look at options for database backup.

Chapter 5, Building Azure MVC Websites, builds the sales customer website and administrator website, with Twitter authentication for the customer site and Azure Active Directory authentication for the administrator site. We will learn how to apply custom domain names and SSL certificates to Azure websites and learn how to perform Azure AD group authorization in an MVC website.

Chapter 6, Azure Website Diagnostics and Debugging, follows on from the previous chapter, exploring techniques and tools to help diagnose problems and debug Azure websites. We'll look at enabling diagnostics in websites, working with logfiles, and examining application logging and site diagnostics. Finally, we'll look at the Kudu service and remote debugging Azure websites.

Chapter 7, Azure Service Bus Topic Integration, starts with an overview of the Service Bus topics and creates a topic for handling order messaging between the three business tiers. We'll integrate the sales customer website into the topic with a subscription, allowing the newly-created orders to be sent across the system, where they will be collected by the production system for manufacturing, and the supply system for producing address labels and planning deliveries. We'll also create a messaging simulator to allow the topic to be loaded up with high volumes of orders to help test the scalability and capacity of the system. Finally, we'll look at the features in the portal to help us monitor and manage our Service Bus topic.

Chapter 8, Building Worker Roles, gives an introduction to cloud services and creating a worker role. Then, we'll create and run a basic cloud service locally on the compute emulator, and publish and run it in the cloud. The production order processor is created next, which is responsible for receiving orders from the Service Bus topic, saving them to the production database, creating product batch schedules, and allocating stock. Finally, we'll test the cloud service in a scaled deployment using the simulator created in Chapter 7, Azure Service Bus Topic Integration.

Chapter 9, Cloud Service Diagnostics, Debugging, and Configuration, continues on from the previous chapter and covers diagnostics, remote debugging, and IntelliTrace. We'll learn how to deal with configuration changes made in the portal at runtime and implement start-up tasks for performing customizations to prepare the server environment for the service.

Chapter 10, Web API and Client Integration, provides an introduction to the Web API and SignalR with an Azure Service Bus backplane followed by building a Web API service and a SignalR hub, to allow the production management application to interact with the production database and Service Bus topic. The system will be authenticated with Azure AD authentication, allowing production staff to log in to the WPF client application using their Azure AD credentials.

Chapter 11, Integrating a Mobile Application Using Mobile Services, brings the whole system together with the addition of a mobile service and a Windows Phone 8 application for the sales system, which allows users to log in with the same credentials as the customer website, view orders, and receive order updates and product news via the notifications hub. The sales mobile service provides APIs for the admin website and order processor to interact with the notifications hub. Finally, the chapter looks at building an Azure AD authenticated mobile service for the supply Windows Store application to view orders and retrieve address labels from a blob storage created by the supply order processor.

Chapter 12, Preparing an Azure System for Production, is the final chapter, and looks at configuring systems for various environments including production, and creating publishing packages using the Visual Studio Online Team Foundation build server and producing database scripts in order to manage the system deployments in a controlled way by systems administrators or developers. We'll learn how to monitor the different services implemented throughout the book once they are live, and also cover guidelines for publishing web-connected mobile applications.

What you need for this book

You need a good spec machine with Windows 8.1 installed as a starting point. A premium version of Visual Studio 2013 is ideal but not necessary as multiple versions of Visual Studio Express (which are free) can be used instead. You will sign up for a Microsoft Azure subscription at the start of the book if you have not already got one; there are various paid options, but a free 3-month trial is available. To work on Windows Store applications, a Store account is needed, which is covered in Chapter 11, Integrating a Mobile Application Using Mobile Services.

Who this book is for

This book is aimed at .NET developers interested in building systems for Microsoft Azure. Good knowledge of Microsoft .NET is essential; knowledge of building websites, Windows applications, and Windows Phone or Windows 8 applications is helpful but not essential.

Conventions

In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.

Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "In the website project, open the Views/Home/Index.cshtml file and make some changes to the markup."

A block of code is set as follows:

public class AuthHelper
{
    public static async Task<Customer> GetCustomer(ServiceUser serviceUser, CustomerMobileServiceContext ctx)
    {
        // Find Twitter Id, of form Twitter:123456789
        var idParts = serviceUser.Id.Split(':');
        var key = idParts[1];
        var provider = idParts[0];

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

public class AuthHelper
{
    public static async Task<Customer> GetCustomer(ServiceUser serviceUser, CustomerMobileServiceContext ctx)
    {
        // Find Twitter Id, of form Twitter:123456789
        var idParts = serviceUser.Id.Split(':');
        var key = idParts[1];
        var provider = idParts[0];

Any command-line input or output is written as follows:

Install-Package WindowsAzure.MobileServices

New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes for example, appear in the text like this: "Enter Project name and Description and select the Team Foundation Version Control option (this is the default option), and then click on Create project."

Note

Warnings or important notes appear in a box like this.

Tip

Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.

To send us general feedback, simply send an e-mail to , and mention the book title via the subject of your message.

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide on www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Downloading the example code

You can download the example code files for all Packt books you have purchased from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you would report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting your book, clicking on the errata submission form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded on our website, or added to any list of existing errata, under the Errata section of that title. Any existing errata can be viewed by selecting your title from http://www.packtpub.com/support.

Piracy

Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works, in any form, on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at with a link to the suspected pirated material.

We appreciate your help in protecting our authors, and our ability to bring you valuable content.

Questions

You can contact us at if you are having a problem with any aspect of the book, and we will do our best to address it.

lock icon The rest of the chapter is locked
You have been reading a chapter from
Learning Microsoft Azure
Published in: Oct 2014 Publisher: Packt ISBN-13: 9781782173373
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at AU $19.99/month. Cancel anytime}