Get the full ebook with Bonus Features for a Better Reading Experience on ebookgate.com
Moving Applications to the Cloud on Windows Azure
3rd Edition Dominic Betts
https://ebookgate.com/product/moving-applications-to-the-
cloud-on-windows-azure-3rd-edition-dominic-betts/
OR CLICK HERE
DOWLOAD NOW
Download more ebook instantly today at https://ebookgate.com
Instant digital products (PDF, ePub, MOBI) available
Download now and explore formats that suit you...
Cloud Computing with the Windows Azure Platform Wrox
Programmer to Programmer 1st Edition Roger Jennings
https://ebookgate.com/product/cloud-computing-with-the-windows-azure-
platform-wrox-programmer-to-programmer-1st-edition-roger-jennings/
ebookgate.com
Windows Phone 7 Developer Guide Building connected mobile
applications with Microsoft Silverlight Developer Series
1st Edition Dominic Betts
https://ebookgate.com/product/windows-phone-7-developer-guide-
building-connected-mobile-applications-with-microsoft-silverlight-
developer-series-1st-edition-dominic-betts/
ebookgate.com
Moving Hadoop to the cloud harnessing cloud features and
flexibility for Hadoop clusters First Edition, Release
Edition Havanki
https://ebookgate.com/product/moving-hadoop-to-the-cloud-harnessing-
cloud-features-and-flexibility-for-hadoop-clusters-first-edition-
release-edition-havanki/
ebookgate.com
Windows Azure SQL Reporting Succinctly Stacia Misner
https://ebookgate.com/product/windows-azure-sql-reporting-succinctly-
stacia-misner/
ebookgate.com
Moving from Windows to Linux Networking Series 1st Edition
Chuck Easttom
https://ebookgate.com/product/moving-from-windows-to-linux-networking-
series-1st-edition-chuck-easttom/
ebookgate.com
Complete Latin Beginner to Intermediate Course 3rd Edition
Gavin Betts
https://ebookgate.com/product/complete-latin-beginner-to-intermediate-
course-3rd-edition-gavin-betts/
ebookgate.com
Mastering Multi Cloud Paradigm for Enterprises Transform
Enterprise Infrastructure with Multi Cloud Strategies
Using Azure AWS and GCP for and Disaster Recovery English
Edition --
https://ebookgate.com/product/mastering-multi-cloud-paradigm-for-
enterprises-transform-enterprise-infrastructure-with-multi-cloud-
strategies-using-azure-aws-and-gcp-for-and-disaster-recovery-english-
edition/
ebookgate.com
To the Cloud 1st Edition Vincent Mosco
https://ebookgate.com/product/to-the-cloud-1st-edition-vincent-mosco/
ebookgate.com
Hacking Exposed Windows 3rd Edition Scambray
https://ebookgate.com/product/hacking-exposed-windows-3rd-edition-
scambray/
ebookgate.com
Moving Applications to the Cloud, 3rd Edition
M
oving
A
pplications
to
the
C
loud
on
M
icrosoft
W
indows
A
zure
™
T
hird
E
dition
For more information explore:
msdn.microsoft.com/practices
Software Architecture and
Software Development
patterns & practices
		 Proven practices for predictable results
Save time and reduce risk on your
software development projects by
incorporating patterns & practices,
Microsoft’s applied engineering
guidance that includes both production
quality source code and documentation.
The guidance is designed to help
software development teams:
Make critical design and technology
selection decisions by highlighting
the appropriate solution architectures,
technologies, and Microsoft products
for common scenarios
Understand the most important
concepts needed for success by
explaining the relevant patterns and
prescribing the important practices
Get started with a proven code base
by providing thoroughly tested
software and source that embodies
Microsoft’s recommendations
The patterns & practices team consists
of experienced architects, developers,
writers, and testers. We work openly
with the developer community and
industry experts, on every project, to
ensure that some of the best minds in
the industry have contributed to and
reviewed the guidance as it is being
developed.
We also love our role as the bridge
between the real world needs of our
customers and the wide range of
products and technologies that
Microsoft provides.
How do you build and deploy applications to be scalable and have high
availability? Along with developing the applications, you must also have
an infrastructure that can support them. You may need to scale up or add
servers, have redundant hardware, and add logic to the application to handle
distributed computing and failovers—even if an application is in high demand
for only short periods of time.
The cloud offers a solution. It is made up of interconnected servers located in
various data centers, but you see what appears to be a centralized location
that someone else hosts and manages. By removing the responsibility for
maintaining an infrastructure, you’re free to concentrate on what matters
most: the application.
This guide is the third edition of the first volume in a series about Windows
Azure. It demonstrates how you can adapt an existing on-premises ASP
.NET
application to one that operates in the cloud by introducing a fictitious company
named Adatum that modifies its expense tracking and reimbursement system,
aExpense, so that it can be deployed to Windows Azure.
Mo v i n g
Ap p l i c at i o n s
to t h e
Clo u d
Dominic Betts
Alex Homer
Alejandro Jezierski
Masashi Narumoto
Hanz Zhang
To illustrate the wide range of options and features in Windows Azure, this
guide and the code examples available for it show a step-by-step migration
process that includes using Windows Azure Web Sites, Virtual Machines, Cloud
Services, and SQL Database. Together with useful information on developing,
deploying, managing, and costing cloud-hosted applications, this guide
provides you with a comprehensive resource for moving your applications to
Window Azure.
Moving to Windows
Azure Cloud Services
PaaS, deployment
management, monitoring
Executing Background Tasks
Asynchronous processing,
blobs, shared access signatures
The Adatum Scenario
Motivation, constraints, goals
Getting to the Cloud
IaaS, Virtual Machines, Hosted SQL Server
Moving to Windows Azure SQL Database
PaaS for data, deployment, management
Moving to Windows Azure Table Storage
Data access, transactions, fine tuning
Evaluating Cloud Hosting Costs
Pricing and cost considerations
Third Edition
on Microsoft
Windows Azure™
Moving Applications
to the Cloud
3rd Edition
Dominic Betts
Alex Homer
Alejandro Jezierski
Masashi Narumoto
Hanz Zhang
978-1-62114-021-4
This document is provided "as-is." Information and views expressed in this
document, including URL and other Internet website references, may change
without notice. You bear the risk of using it. Some examples depicted herein
are provided for illustration only and are fictitious. No real association or
connection is intended or should be inferred.
© 2012 Microsoft. All rights reserved.
Microsoft, Active Directory, MSDN, SQL Server, Visual C#, Visual C++,
Visual Basic, Visual Studio, Windows, Windows Azure, Windows Azure SQL
Database, Windows Live, Windows PowerShell, Windows Server, and
Windows Vista are trademarks of the Microsoft group of companies.
All other trademarks are the property of their respective owners.
Contents
Foreword – Yousef Khalidi xi
Foreword for the Third Edition xi
Who This Book Is For xiii
Preface xiii
Why This Book Is Pertinent Now xiv
How This Book Is Structured xiv
What You Need to Use the Code xv
Who’s Who xvi
Acknowledgments xvii
Acknowledgements of Contributors to the Third Edition xix
1 The Adatum Scenario 1
The Adatum Company 1
Adatum’s Challenges 2
Adatum’s Goals and Concerns 2
Adatum’s Strategy 3
The aExpense Application 3
The aExpense Architecture 4
Evaluating Cloud Hosting Opportunities 5
Evaluating the Runtime Platform 6
Infrastructure as a Service 6
Platform as a Service 7
Software as a Service 7
Evaluating Data Storage Facilities 8
Evaluating Security, Monitoring, and Management Capabilities 8
Evaluating Service Level Agreements 9
Evaluating Additional Opportunities 10
Adatum’s Migration Path for the aExpense Application 10
Choosing Your Own Migration Path 12
More Information 13
v
vi
2 Getting to the Cloud 15
The Premise 16
Goals and Requirements 17
Overview of the Solution 18
Options for Hosting the Application 18
Affinity Groups 19
Availability Sets 20
Options for Hosting the Data 20
Connectivity for Authentication 22
Session Support and Load Balancing 23
Integrating with On-Premises Services 24
Inside the Implementation 25
Profile Data 25
Connecting to the Hosted SQL Server 26
Database Connection Timeouts and Dropped
Connections 27
Deploying the aExpense Application to Windows Azure
Virtual Machines 28
Deploying the Web Application 28
Deploying the Database 29
Testing, Deployment, Management, and Monitoring 30
Testing Applications for Virtual Machine Deployment 31
Test and Production Environments 31
Management and Monitoring 33
Storing and Backing Up Virtual Machines 34
Managing Virtual Machine Instances 34
Elasticity and Scaling 35
Isolating Active Directory 35
More Information 37
3 Moving to Windows Azure Cloud Services 39
The Premise 39
Goals and Requirements 39
Overview of the Solution 41
Evaluating the PaaS Approach for Hosting the Application 41
Options for Hosting the Application 42
Choosing Between Web Sites and Cloud Services 43
Service Instances, Fault Domains, and Update Domains 45
Options for Authentication and Access Control 46
Profile Management 48
Session Data Management 48
Storing Session State Data in a Database 49
Storing Session State Data in Windows Azure Storage 49
Storing Session State Data in a Windows Azure Cache 49
Data Storage 50
vii
Application Configuration 51
Application Startup Processes 52
Copying Configuration Values in a Startup Task 53
Solution Summary 54
Inside the Implementation 55
Creating a Web Role 55
Reading Configuration Information 57
Using the Windows Azure CloudConfigurationManager
Class 58
Implementing Claims-based Authentication 59
Managing User Data 62
Managing Session Data 63
Testing, Deployment, Management, and Monitoring 64
Testing Cloud Services Applications 64
Cloud Services Staging and Production Areas 65
Separate Test and Live Subscriptions 66
Managing Windows Azure Services 68
Setup and Deployment 68
Managing Different Local, Test, and Live Configurations 68
Preparing for Deployment to Windows Azure 72
Deploying to Cloud Services in Windows Azure 72
Continuous Delivery 79
Using a Mock Issuer 80
Converting to a Production Issuer 80
Accessing Diagnostics Log Files 81
More Information 84
4 Moving to Windows Azure SQL Database 85
The Premise 85
Goals and Requirements 85
Overview of the Solution 86
PaaS Options for Data Storage 86
Comparing SQL Server and Windows Azure SQL Database 87
Limitations of Windows Azure SQL Database 88
Database Management and Data Backup 89
Database Connection Reliability 90
Implementing Retry Logic for Database Connections 91
Inside the Implementation 92
Connecting to Windows Azure SQL Database 92
Handling Transient Connection Failures 93
Setup, Deployment, Management, and Monitoring 95
Data for Development and Testing 95
Data Migration 96
Data Management 96
Database Monitoring 97
More Information 97
viii
5 Executing Background Tasks 99
The Premise 99
Goals and Requirements 99
Overview of the Solution 100
Storing Receipt Images 100
Background Processing 101
Detecting an New Uploaded Image 102
Using Windows Azure Storage Queues 103
Handling Transient Faults when Accessing Windows
Azure Storage 104
Controlling Access to Receipt Images 105
Inside the Implementation 107
Uploading and Saving Images 107
Abstracting the Worker Role 108
User Code in the aExpense Application 110
The Plumbing Code Classes 113
Processing the Images 120
Making the Images Available Using Shared Access
Signatures 121
More Information 122
6 Evaluating Cloud Hosting Costs 123
The Premise 123
Goals and Requirements 123
Detailed Costing Estimates 124
Bandwidth Cost Estimate for aExpense 127
Compute Estimate for aExpense 127
Receipt Image Storage Estimate for aExpense 127
Windows Azure SQL Database Storage Requirements
Estimate 128
Total Cost Approximation 128
Variations 128
Costing the IaaS Hosting Approach 128
Combined IaaS and PaaS Approach 130
Costing for Peak and Reduced Demand 131
Costing for Windows Azure Table Storage 132
More Information 132
ix
7 Moving to Windows Azure Table Storage 133
The Premise 133
Goals and Requirements 133
Overview of the Solution 135
Why Use Windows Azure Table Storage? 135
Profile Data 136
The Data Export Process 137
Initiating the Export Process 137
Generating the Export Data 138
Exporting the Report Data 139
Inside the Implementation 141
Storing Business Expense Data in Windows Azure Table
Storage 141
How Many Tables? 142
Partition Keys and Row Keys 145
Defining the Schemas 149
Retrieving Records from a Multi-Entity Schema Table 151
Materializing Entities 153
Query Performance 154
Working with Development Storage 155
Storing Profile Data 157
Generating and Exporting the Expense Data 158
Generating the Expense Report Table 158
Exporting the Expenses Data 161
Performance Testing, Tuning, To-Do Items 166
Initializing the Storage Tables, Blobs, and Queues 166
Implementing Paging with Windows Azure Table Storage 167
Preventing Users from Uploading Large Images 172
Validating User Input 172
System.Net Configuration Changes 172
WCF Data Service Optimizations 173
More Information 174
Glossary 175
Index 179
xi
Foreword – Yousef Khalidi
Microsoft’s Windows Azure platform, an operating environment for developing, hosting, and manag-
ing cloud-based services, established a foundation that allows customers to easily move their applica-
tions from on-premises locations to the cloud. With Windows Azure, customers benefit from in-
creased agility, a very scalable platform, and reduced costs.
Microsoft’s cloud strategy has three broad tenets: to offer flexibility of choice for deploying services
based on business needs; to provide enterprise-level services with no compromises on availability,
reliability, or security; and to support consistent, connected experiences across devices and platforms.
Windows Azure is a key component of Microsoft’s cloud strategy.
Windows Azure builds on Microsoft’s many years of experience running online services for millions
of users, and on our long history of building platforms for developers. We focused on making the
transition from on-premises to the cloud easy for both programmers and IT professionals. Their exist-
ing skills and experience are exactly what they need to start using the Windows Azure platform.
Microsoft is committed to Windows Azure, and will continue to expand it as we learn how all our
customers around the globe, from the largest enterprises to the smallest ISVs, use it. One of the ad-
vantages of an online platform is that it allows us to introduce innovations quickly.
I’m excited to introduce this guide from the Microsoft patterns & practices team, proof of our com-
mitment to help customers be successful with the Windows Azure platform. Whether you’re new to
Windows Azure, or if you’re already using it, you’ll find guide a great source of things to consider. I
encourage you to get started exploring Microsoft’s public cloud and to stay tuned for further guidance
from the patterns & practices team.
Foreword for the Third Edition
Since its first beginnings, and since I reviewed the original edition of this guide from the patterns &
practices team, Windows Azure has continued to mature by offering exciting new services and capa-
bilities. Now that we have achieved general release, with a comprehensive SLA, we have seen a huge
uptake of the platform across all sectors of our industry.
In my original foreword I talked about our commitment to the enterprise. We have proved not only
that we can deliver on these commitments, but go beyond them to offer even more innovative fea-
tures; including many that make migration of existing on-premises applications to the cloud much
easier. The business case for Windows Azure continues to prove itself, and there is even more to come!
Sincerely,
Yousef Khalidi
Distinguished Engineer, Windows Azure
xiii
Preface
How can a company’s applications be scalable and have high availability? To achieve this, along with
developing the applications, you must also have an infrastructure that can support them. For example,
you may need to add servers or increase the capacities of existing ones, have redundant hardware, add
logic to the application to handle distributed computing, and add mechanisms to handle failover. You
have to do this even if an application is in high demand for only short periods of time. Life becomes
even more complicated (and expensive) when you start to consider issues such as network latency and
security boundaries.
The cloud offers a solution to this dilemma. The cloud is made up of interconnected servers located
in various data centers. However, you see what appears to be a centralized location that someone else
hosts and manages. By shifting the responsibility of maintaining an infrastructure to someone else,
you’re free to concentrate on what matters most: the application. If the cloud has data centers in
different geographical areas, you can move your content closer to the people who are using it most.
If an application is heavily used in Asia, have an instance running in a data center located there. This
kind of flexibility may not be available to you if you have to own all the hardware. Another advantage
to the cloud is that it’s a “pay as you go” proposition. If you don’t need it, you don’t have to pay for it.
When demand is high, you can scale up, and when demand is low, you can scale back.
Yes, by moving applications to the cloud, you’re giving up some control and autonomy, but you’re also
going to benefit from reduced costs, increased flexibility, and scalable computation and storage. This
guide shows you how to do this.
Who This Book Is For
This book is the first volume in a series about Windows Azure. It demonstrates how you can adapt an
existing, on-premises ASP.NET application to one that operates in the cloud. The book is intended for
any architect, developer, or information technology (IT) professional who designs, builds, or operates
applications and services that are appropriate for the cloud. Although applications do not need to be
based on the Microsoft Windows operating system to work in Windows Azure or written using a
.NET language, this book is written for people who work with Windows-based systems. You should
be familiar with the Microsoft .NET Framework, Microsoft Visual Studio, ASP.NET, and Microsoft
Visual C#.
xiv
Why This Book Is Pertinent Now
In general, the cloud has become a viable option for making your applications accessible to a broad set
of customers. In particular, Windows Azure now has in place a complete set of tools for developers
and IT professionals. Developers can use the tools they already know, such as Visual Studio, to write
their applications. In addition, the Windows Azure SDK includes the compute emulator and the stor-
age emulator. Developers can use these to write, test, and debug their applications locally before they
deploy them to the cloud. There are also tools and an API to manage your Windows Azure accounts.
This book shows you how to use all these tools in the context of a common scenario—how to adapt
an existing ASP.NET application and deploy it to Windows Azure.
Moving to Windows
Azure Cloud Services
PaaS, deployment
management, monitoring
Executing Background Tasks
Asynchronous processing,
blobs, shared access signatures
The Adatum Scenario
Motivation, constraints, goals
Getting to the Cloud
IaaS, Virtual Machines, Hosted SQL Server
Moving to Windows Azure SQL Database
PaaS for data, deployment, management
Moving to Windows Azure Table Storage
Data access, transactions, fine tuning
Evaluating Cloud Hosting Costs
Pricing and cost considerations
How This Book Is Structured
Chapter 1, “The Adatum Scenario” introduces you to the Adatum company and the aExpense applica-
tion. The following chapters describe how Adatum migrates the aExpense application to the cloud.
Reading this chapter will help you understand why Adatum wants to migrate some of its business
applications to the cloud, and it describes some of its concerns. It will also help you to understand
basic options for hosting applications and services in the cloud.
Chapter 2, “Getting to the Cloud” describes the first steps that Adatum took in migrating the aExpense
application. Adatum’s goal here is simply to get the application working in the cloud, but this includes
“big” issues such as security and storage. The chapter shows how Adatum used Windows Azure virtual
machines and network services to deploy and communicate with the hosted servers.
xv
preface
Chapter 3, “Moving to Windows Azure Cloud Services” describes how Adatum adapted the aExpense
application to run as a hosted service in Windows Azure by using the Cloud Services feature. The
chapter describes how Adatum modified the solution, converted it to use claims authentication in-
stead of Active Directory, and took advantage of Windows Azure Caching for the session data.
Chapter 4, “Moving to Windows Azure SQL Database” describes how Adatum evaluated the use of
Windows Azure SQL Database instead of a hosted SQL Server by exploring the limitations this might
impose and the cost savings that it might provide. The chapter then goes in to show how Adatum
converted the aExpense application to use Windows Azure SQL Database.
Chapter 5, “Executing Background Tasks” describes adding a worker role to the aExpense applica-
tion to process scanned receipt images as a background task. It also shows how aExpense uses
Windows Azure blob storage for storing these images, and shared access signatures to provide se-
cure access to them.
Chapter 6, “Evaluating Cloud Hosting Costs” introduces a basic cost model for the aExpense applica-
tion running on Windows Azure and shows how Adatum calculated the estimated annual running
costs for the application.
Chapter 7, “Moving to Windows Azure Table Storage” describes how Adatum switched from using
a SQL database to using Windows Azure table storage in the aExpense application. It discusses the
differences between the two storage models, and shows how Adatum adapted the data access
code to work with Windows Azure table storage. This chapter also discusses how Adatum fine-
tuned the application after deployment, and the options it is considering for improving the applica-
tion in the future.
What You Need to Use the Code
These are the system requirements for running the scenarios:
• Microsoft Windows 7 with Service Pack 1, Microsoft Windows 8, Microsoft Windows Server
2008 R2 with Service Pack 1, or Microsoft Windows Server 2012 (32 bit or 64 bit editions).
• Microsoft .NET Framework version 4.0.
• Microsoft Visual Studio 2010 Ultimate, Premium, or Professional edition with Service Pack 1
installed, or Visual Studio 2012 Ultimate, Premium, or Professional edition.
• Windows Azure SDK for .NET (includes the Windows Azure Tools for Visual Studio). See the
Release Notes for information on the specific version required.
• Microsoft SQL Server 2012, SQL Server Express 2012, SQL Server 2008, or SQL Server Express 2008.
See the Release Notes for information on specific versions depending on your operating system.
• Windows Identity Foundation. This is required for claims-based authorization.
• WatiN 2.0. Open the Properties dialog and unblock the zip file after you download it and before
you extract the contents. Place the contents in the LibWatin folder of the examples.
Other components and frameworks required by the examples are installed using NuGet when you run
the solutions. See the Release Notes included with the examples for instructions on installing and
configuring them.
xvi
Who’s Who
As mentioned earlier, this book uses a set of scenarios that demonstrates how to move applications to
the cloud. A panel of experts comments on the development efforts. The panel includes a cloud spe-
cialist, a software architect, a software developer, and an IT professional. The scenarios can be consid-
ered from each of these points of view. The following table lists the experts for these scenarios.
Bharath is a cloud specialist. He checks that a cloud-based solution will work for a
company and provide tangible benefits. He is a cautious person, for good reasons.
“Moving a single application to the cloud is easy. Realizing the benefits
that a cloud-based solution can offer is not always so straight-forward”.
Jana is a software architect. She plans the overall structure of an application. Her
perspective is both practical and strategic. In other words, she considers not only
what technical approaches are needed today, but also what direction a company
needs to consider for the future.
Markus is a senior software developer. He is analytical, detail-oriented, and
methodical. He’s focused on the task at hand, which is building a great cloud-
based application. He knows that he’s the person who’s ultimately responsible
for the code.
“I don’t care what platform you want to
use for the application, I’ll make it work.”
Poe is an IT professional who’s an expert in deploying and running in a corporate
data center. Poe has a keen interest in practical solutions; after all, he’s the one
who gets paged at 3:00 AM when there’s a problem.
“It’s not easy to balance the needs of the company, the users, the IT
organization, the developers, and the technical platforms we rely on.
If you have a particular area of interest, look for notes provided by the specialists whose interests align
with yours.
“Migrating to the cloud involves a big change in the way we manage our applications.
I want to make sure our cloud apps are as reliable and secure as our on-premise apps.”
xvii
Acknowledgments
On March 4th 2010 I saw an email from our CEO, Steve Ballmer, in my inbox. I don’t normally receive
much email from him, so I gave it my full attention. The subject line of the email was: “We are all in,”
and it summarized the commitment of Microsoft to cloud computing. If I needed another confirma-
tion of what I already knew, that Microsoft is serious about the cloud, there it was.
My first contact with what eventually became Windows Azure was about three years ago. I was in the
Developer & Platform Evangelism (DPE) team, and my job was to explore the world of software de-
livered as a service. Some of you might even remember a very early mockup I developed in late 2007,
called Northwind Hosting. It demonstrated many of the capabilities that the Windows Azure platform
offers today. (Watching an initiative I’ve been involved with since the early days become a reality
makes me very, very happy.)
In February 2009, I left DPE and joined the patterns & practices team. My mission was to lead the
“cloud program”: a collection of projects that examined the design challenges of building applications
for the cloud. When the Windows Azure platform was announced, demand for guidance about it
skyrocketed.
As we examined different application development scenarios, it became quite clear that identity man-
agement is something you must get right before you can consider anything else. It’s especially impor-
tant if you are a company with a large portfolio of on-premises investments, and you want to move
some of those assets to the cloud. This describes many of our customers. Therefore, patterns &
practices’s first deliverable, and an important milestone in our cloud program, was A Guide to Claims-
Based identity and Access Control.
The Windows Azure platform is special in many ways. One is the rate of innovation. The various teams
that deliver all of the platform’s systems proved that they could rapidly ship new functionality. To keep
up with them, I felt we had to develop content very quickly. We decided to run our projects in two-
months sprints, each one focused on a specific set of considerations.
This guide, now fully updated to cover the new capabilities of Windows Azure, mainly covers a migra-
tion scenario: how to move an existing application to the Windows Azure platform. As in the claims
guide, we’ve developed a fictitious case study that explains, step by step, the challenges our customers
are likely to encounter.
xviii
I want to start by thanking the following subject matter experts and contributors to this guide:
Dominic Betts, Scott Densmore, Ryan Dunn, Steve Marx, and Matias Woloski. Dominic has the un-
usual skill of knowing a subject in great detail and of finding a way to explain it to the rest of us that is
precise, complete, and yet simple to understand. Scott brought us a wealth of knowledge about how
to build scalable Windows Azure applications, which is what he did before he joined my team. He also
brings years of experience about how to build frameworks and tools for developers. I’ve had the privi-
lege of working with Ryan in previous projects, and I’ve always benefited from his acuity, insights, and
experience. As a Windows Azure evangelist, he’s been able to show us what customers with very real
requirements need. Steve is a technical strategist for Windows Azure. He’s been instrumental in shap-
ing this guide. We rely on him to show us not just what the platform can do today but how it will
evolve. This is important because we want to provide guidance today that is aligned with longer-term
goals. Last but not least, Matias is a veteran of many projects with me. He’s been involved with
Windows Azure since the very first day, and his efforts have been invaluable in creating this guide.
As it happens with all our written content, we have sample code for most of the chapters. They
demonstrate what we talk about in the guide. Many thanks to the project’s development and test
teams for providing a good balance of technically sound, focused and simple-to-understand code:
Masashi Narumoto (Microsoft Corporation), Scott Densmore (Microsoft Corporation), Federico
Boerr (Southworks), Adrián Menegatti (Southworks), Hanz Zhang (Microsoft Corporation), Ravindra
Mahendravarman (Infosys Ltd.), Rathi Velusamy (Infosys Ltd.).
Our guides must not only be technically accurate but also entertaining and interesting to read. This is
no simple task, and I want to thank Dominic Betts, RoAnn Corbisier (Microsoft Corporation), Alex
Homer (Microsoft Corporation), and Tina Burden from the writing and editing team for excelling at this.
The visual design concept used for this guide was originally developed by Roberta Leibovitz and Colin
Campbell (Modeled Computation LLC) for A Guide to Claims-Based Identity and Access Control.
Based on the excellent responses we received, we decided to reuse it for this book. The book design
was created by John Hubbard (eson). The cartoon faces were drawn by the award-winning Seattle-
based cartoonist Ellen Forney. The technical illustrations were adapted from my Tablet PC mockups
by Chris Burns.
All of our guides are reviewed, commented upon, scrutinized, and criticized by a large number of
customers, partners, and colleagues. We also received feedback from the larger community through
our CodePlex website. The Windows Azure platform is broad and spans many disciplines. We were
very fortunate to have the intellectual power of a very diverse and skillful group of readers available
to us.
I also want to thank all of these people who volunteered their time and expertise on our early content
and drafts. Among those, we want to highlight the exceptional contributions of Jorge Rowies (South-
works), Marcos Castany (Southworks), Federico Boerr (Southworks), Corey Sanders (Microsoft
Corporation), Nir Mashkowski (Microsoft Corporation), Ganesh Srinivasan (Microsoft Corporation),
Jane Sinyagina (Microsoft Corporation), Rick Byham (Microsoft Corporation), Boris Scholl (Microsoft
Corporation), and Paul Yuknewicz (Microsoft Corporation).
I hope you find this guide useful!
Eugenio Pace
Senior Program Manager – patterns & practices
Microsoft Corporation
xix
Acknowledgements of Contributors to the Third Edition
Windows Azure is an evolving platform. We originally published the first edition of this guide in 2010,
demonstrating a basic set of Windows Azure features. I’m now pleased to release the third edition of
this guide, which incorporates the latest and greatest features of Windows Azure such as Virtual
Machines, Web Sites, Caching, and more. By taking advantage of these new features, you have a lot
more options to choose from when migrating your own applications from on-premises to the cloud.
As our scope increased, we also added new community members and industry experts who have
provided significant help throughout the development of this edition. I want to acknowledge the
exceptional contributions of the following people: Dominic Betts (Content Master), Alex Homer
(Microsoft Corporation), Alejandro Jezierski (Southworks), Mauro Krikorian (Southworks), Jorge
Rowies (Southworks), Marcos Castany (Southworks ), Hanz Zhang (Microsoft Corporation), Rathi
Velusamy, RoAnn Corbisier (Microsoft Corporation), Nelly Delgado (Microsoft Corporation), Eugenio
Pace (Microsoft Corporation), Carlos Farre (Microsoft Corporation), Trent Swanson (Full Scale 180
Inc.), Ercenk Keresteci (Full Scale 180 Inc.), Federico Boerr, Corey Sanders (Microsoft Corporation),
Nir Mashkowski (Microsoft Corporation), Ganesh Srinivasan (Microsoft Corporation), Jane Sinyagina
(Microsoft Corporation), Rick Byham (Microsoft Corporation), Boris Scholl (Microsoft Corporation),
and Paul Yuknewicz (Microsoft Corporation). I also want to thank everyone who participated in our
CodePlex community site.
Masashi Narumoto
Senior Program Manager – patterns & practices
Microsoft Corporation
September 2012
1
1
This chapter introduces a fictitious company named Adatum. It de-
scribes Adatum’s current infrastructure, its software portfolio, and
why Adatum wants to move some of its applications to Windows
Azure. As with any company considering this process, there are many
issues to take into account and challenges to be met, particularly be-
cause Adatum has not used the cloud before. At the end of this chap-
ter you will see how Adatum explored and evaluated the major re-
quirements for moving its applications to the cloud, and an overview
of the migration steps that Adatum followed. The chapters that follow
this one show in detail how Adatum modified its expense tracking and
reimbursement system, aExpense, at each stage for deployment to
Windows Azure.
The Adatum Company
Adatum is a manufacturing company of 15,000 employees that
mostly uses Microsoft technologies and tools. It also has some legacy
systems built on other platforms, such as AS400 and UNIX. As you
would expect, Adatum developers are knowledgeable about various
Microsoft products, including .NET Framework, ASP.NET, SQL Server,
Windows Server, and Visual Studio. Employees in Adatum’s IT depart-
ment are proficient at tasks such as setting up and maintaining Active
Directory and using System Center.
Adatum uses many different applications. Some are externally facing,
while others are used exclusively by its employees. The importance of
these applications ranges from “peripheral” to “critical,” with many
lying between the two extremes. A significant portion of Adatum’s IT
budget is allocated to maintaining applications that are either of mid-
level or peripheral importance.
The Adatum Scenario
Adatum uses mainly
Microsoft products,
and its developers are
knowledgeable about most
Microsoft technologies
such as Windows, SQL
Server, and the .NET
Framework.
2 chapter one
Adatum wants to change this allocation. Its aim is to spend more money on the services that differ-
entiate it from its competitors and less on those that don’t. Adatum’s competitive edge results from
assets, such as its efficient supply chain and excellent quality controls, and not from how effectively
it handles its internal email. For example, Adatum wants efficient email but is looking for more eco-
nomical ways to provide this so that it can spend most of its budget on the systems that directly affect
its customers. Adatum believes that one way to achieve this optimization is to selectively deploy ap-
plications to the cloud.
Adatum’s Challenges
Adatum faces several challenges. Currently, deploying new on-premises applications takes too long,
considering how quickly its business changes and how efficient its competitors are. The timeframe for
acquiring, provisioning, and deploying even a simple application can be at least several weeks. No
matter the application’s complexity, requirements must be analyzed, procurement processes must be
initiated, requests for proposals may need to be sent to vendors, networks must be configured, and
so on. Adatum must be able to respond to its customers’ demands more rapidly than the current
procedures allow.
Another issue is that much of Adatum’s infrastructure is used inefficiently. The majority of its servers
are underutilized, and it’s difficult to deploy new applications with the requisite service-level agree-
ments (SLAs) to the existing hardware. Virtual machines are appropriate in some cases, but they are
not appropriate in all cases. This inefficiency means that Adatum’s capital is committed to an under-
utilized infrastructure when it could be better used elsewhere in the business.
A final issue is that less critical applications typically get less attention from the IT staff. It is only when
the application fails or cannot keep up with demand that anyone takes notice. By this time, the
problem is expensive to fix, both in terms of IT time and in inefficient use of the users’ time.
Adatum wants to focus on the applications, and not on the infrastructure. Adatum believes that by
deploying some of its applications to a public cloud such as Windows Azure it can take advantage of
economies of scale, promote standardization of its applications, and have automated processes for
managing them. Most importantly, Adatum believes that this will make it more effective at addressing
its customers’ needs, a more effective competitor in the market, and a better investment for its
shareholders.
Adatum’s Goals and Concerns
One of Adatum’s goals is to improve the experience of all users of its applications. At a minimum,
applications in the cloud should perform as well as their on-premises counterparts. The hope, though,
is that they will perform better. Many of its applications are used more at some times than at others.
For example, employees use the salary tool once every two weeks but rarely at other times. They
would benefit if the applications had increased responsiveness during peak periods. This sensitivity to
demand is known as dynamic scalability.
3
The Adatum Scenario
However, on-premises applications that are associated with specific
servers don’t provide this flexibility. Adatum can’t afford to run as
many servers as are needed during peak times because this hardware
is dormant the rest of the time. If these applications were located in
the cloud, it would be easy to scale them depending on the demand.
Another goal is to expand the ways that users can access Adatum’s
applications. Currently, applications are only accessible from the in-
tranet. Applications that are located in the public cloud are, by defini-
tion, available over the Internet. However, the public cloud also raises
questions about authentication. Many of Adatum’s applications use
Windows authentication so that users aren’t required to enter appli-
cation-specific credentials. Adatum is concerned that its users would
need special credentials for each application in the public cloud.
A third goal is that at least some of Adatum’s applications should be
portable. Portability means that the application can be moved back
and forth between a hosted data center and an on-premises data
center without any modifications to the application’s code or its op-
erations. If both options are available, the risks that Adatum incurs if
it does use the cloud are reduced.
In addition to its concerns about security, Adatum has two other is-
sues. First, it would like to avoid a massive retraining program for its
IT staff. Second, very few of Adatum’s applications are truly isolated
from other systems. Most have various dependencies. Adatum has put
a great of deal effort into integrating its systems, even if not all of
them operate on the same platform. It is unsure how these dependen-
cies affect operations if some systems are moved to the public cloud.
Adatum’s Strategy
Adatum is an innovative company and open to new technologies, but
it takes carefully considered steps when it implements them. Adatum’s
plan is to evaluate the viability of moving to the cloud by starting with
some of its simpler applications. It hopes to gain some initial experi-
ence, and then expand on what it has learned. This strategy can be
described as “try, learn, fail fast, and then optimize.” Adatum has de-
cided to start with its aExpense application.
The aExpense Application
The aExpense application allows Adatum’s employees to submit,
track, and process business expenses. Everyone in Adatum uses this
application to request reimbursements. Although aExpense is not a
critical application, it is important. Employees can tolerate occasional
hours of downtime, but prolonged unavailability isn’t acceptable.
While Adatum intends that
the aExpense application
will perform at least as
well in the cloud as it does
running in its own data
center, the aim is to take
advantage of the inherent
scalability and reliability of
cloud hosting to achieve
better overall performance
and availability than the
current on-premises
deployment.
4 chapter one
Adatum’s policy is that employees must submit their expenses before the end of each month. The
majority of employees don’t submit their expenses until the last two business days. This causes rela-
tively high demands during a short time period. The infrastructure that supports the aExpense applica-
tion is scaled for average use across the month instead of for this peak demand. As a result, when the
majority of employees try to submit their expenses during the last two business days, the system is
slow and the employees complain.
The application is deployed in Adatum’s data center and is available to users on the intranet. While
traveling, employees access it through a VPN. There have been requests for publishing aExpense di-
rectly to the Internet, but it’s never happened.
The application stores a great deal of information because most expense receipts must be scanned
and then stored for seven years. For this reason, the data stores used by aExpense are frequently
backed up.
The application is representative of many other applications in Adatum’s portfolio so it’s a good test
case for using the cloud. Moving the aExpense application to Windows Azure will expose many of the
challenges Adatum is likely to encounter as it expands the number of applications that it relocates to
the cloud.
The aExpense Architecture
Figure 1 illustrates the aExpense architecture.
Browser Web site
User
profile
Active
Directory
Windows
event
log
SQL Server
File share
Integration
service
Input
file
Output
file
Payment
system
Scans
service
Database
LDAP
query
Figure 1
aExpense architecture
5
The Adatum Scenario
The architecture is straightforward and one that many other applica-
tions use. aExpense is an ASP.NET application and employees use a
browser to interact with it. The application uses Windows authenti-
cation for security. To store user preferences, it relies on ASP.NET
membership and profile providers. Exceptions and logs are imple-
mented with Enterprise Library’s Exception Handling Application
Block and Logging Application Block. The website uses Directory
Services APIs to query for employee data stored in Active Directory,
such as the employee’s manager. The manager is the person who can
approve the expenses.
The aExpense application implements the trusted subsystem to con-
nect to SQL Server. It authenticates with a Windows domain ac-
count. The SQL database uses SQL Server authentication mode. The
aExpense application stores its information on SQL Server. Scans of
receipts are stored on a file share.
There are two background services, both implemented as Windows
services. One periodically runs and generates thumbprints of the
scanned receipts. It also compresses large images for increased storage
efficiency. The other background service periodically queries the da-
tabase for expenses that need to be reimbursed. It then generates a
flat file that the payment system can process. This service also imports
the payment results and sends them back to aExpense after the pay-
ments are made.
Evaluating Cloud Hosting Opportunities
Before initiating a full technical case study for migration of the
aExpense application to Windows Azure, the designers and devel-
opers at Adatum evaluated the capabilities offered by cloud hosting
partner solutions such as Microsoft’s Windows Azure. For example,
they needed to:
• Identify which type of service offered by the hosting providers
best suits Adatum’s requirements.
• Determine whether a cloud solution can provide the necessary
secure and reliable runtime platform and storage facilities.
• Identify how Adatum can monitor and manage the application
• Determine whether the service level agreements (SLAs) are
sufficient to meet Adatum’s business requirements.
Adatum’s aExpense
application uses a standard
website architecture based
on ASP.NET with data stored
in SQL Server. However, it
does integrate with other
in-house systems.
6 chapter one
Evaluating the Runtime Platform
Currently, Adatum runs the aExpense application on its own in-house
IT infrastructure. The servers, networks, internal and external con-
nectivity, and associated systems such as power supply and cooling are
all the responsibility of Adatum. Together they provide the underlying
mechanisms for running applications such as aExpense. As part of the
initial evaluation, Adatum investigated the ways that it could move the
aExpense application to an external hosting partner.
Infrastructure as a Service
Adatum first considered whether it could simply move the application
to an external partner by renting the required infrastructure, complete
with all of the associated systems, and run the application unchanged.
Renting infrastructure from an external partner is known as Infrastruc-
ture as a Service (IaaS). Adatum would be responsible for providing and
installing the operating system and software, and maintaining it (such
as installing operating system and services updates, and upgrading to
new versions). The partner company would provide the hardware (the
server) and the associated infrastructure and connectivity.
Cloud providers can typically offer very high levels of infrastructure
reliability and availability that are beyond the capabilities of many or-
ganizations’ own datacenters. For example, most incorporate robust
disaster recovery processes, and offer the ability to deploy in more
than one geographical location.
Adopting an IaaS approach will provide some cost saving through a
reduction in overall requirements for in-house infrastructure, but it is
not easy (or, in some cases, possible) to quantify the in-house cost of
running a specific application. In Adatum’s case, the cost of the on-
premises infrastructure is effectively shared between all the applica-
tions Adatum uses.
In addition, while this approach is attractive, Adatum must take into
account the cost of management and maintenance required to keep
the hosted operating system running correctly, and the costs of oper-
ating system licenses. However, IaaS is generally less expensive than
other ways of hosting applications at remote locations. It can also
reduce development cost because applications do not need to be
refactored to run in specific types of cloud service roles.
Infrastructure now becomes a running cost rather than a capital in-
vestment.
IaaS allows you to
effectively pick up your
server and move it to the
cloud with minimal changes
required to the application.
It is especially useful if
you need to deploy on
servers that have non-
standard configuration,
where applications require
additional operating system
services, or for applications
cannot be refactored into
a structure suitable for
Platform as a Service (PaaS)
deployment.
7
The Adatum Scenario
Platform as a Service
Secondly, Adatum considered adapting the aExpense application to
run as a hosted application on a platform and operating system pro-
vided by an external partner. As the application currently runs on
Windows Server and uses the .NET Framework, the external partner
would need to offer this platform to avoid the costs of porting the
application to a different operating system.
Renting a ready-to-use platform from an external partner is known as
Platform as a Service (PaaS). Adatum would be responsible only for
providing and installing its aExpense application, and maintaining it
(such as fixing bugs and upgrading to a new version). The partner com-
pany would provide the operating system pre-installed on appropriate
hardware, with the associated infrastructure and connectivity.
The PaaS approach is attractive to Adatum because it reduces the
cost of management and maintenance (the partner is responsible for
keeping the operating system running correctly and applying up-
dates), and there is no requirement to pay for operating system li-
censes. In some cases PaaS hosting charges may be higher than for
IaaS, though this is not necessarily the case; and the cost savings in
licensing, management, and maintenance can often outweigh any
difference. Adatum considered the amount of work involved in refac-
toring the application to run in cloud-hosted roles and the corre-
sponding development cost, and considered both to be acceptable.
Software as a Service
The third option Adatum considered was to abandon their own
aExpense application and rent the use of an expenses application
provided by another company. Renting use of third party applica-
tions is an example of Software as a Service (SaaS). Many companies
have applications specially designed to handle business expense
collation and reporting tasks.
However, Adatum must ensure that the third party application can fully
meet its specific requirements; hosted third party applications must
typically offer a more generic features set to satisfy a wide range of
customers. As well as exploring the overall capabilities of the software,
Adatum will need to evaluate its security, configurability, performance,
and usability. Changing over may incur costs such as user education, as
well as the cost of migrating data and users; and perhaps maintaining the
old application for a period until changeover is complete.
PaaS is particularly useful
when applications can be
refactored to run using the
standard platform offered
by cloud hosting providers.
Responsibility for managing
and updating the operating
system and services is
delegated to the hosting
provider. Applications that
use a multi-tier architecture,
require administrative
access through a virtual
network mechanism,
or require elevated
permissions can be usually
be hosted in the cloud using
the PaaS model.
8 chapter one
Evaluating Data Storage Facilities
Most business applications use data, and so before making any deci-
sion about hosting the aExpense application externally Adatum
needed to evaluate the data storage and retrieval facilities offered by
external partners. On-premises and in-house applications typically
use a relational database system based on Structured Query Lan-
guage (SQL), and Adatum’s aExpense application is no exception.
Therefore, the external partner must be able to offer the equivalent
hosted capability.
However, other storage formats are common. Some applications re-
quire storage for disk files or for unstructured data. The aExpense
application stores unstructured data in the form of receipt images on
a file share, and it also generates disk files for use by other in-house
systems. Therefore, the chosen cloud hosting mechanism must be able
to provide support for storing unstructured data; this may be in a
format other than disk files so long as the application can be easily
adapted to use it.
Between them, these mechanisms should be able to provide the data
storage and retrieval features that Adatum requires; albeit with some
changes to the application code to use the available storage models.
By using an appropriate relational database system, or any other type
of repository that can be installed on a hosted sever, Adatum can
avoid changes to the application code.
Evaluating Security, Monitoring, and Management
Capabilities
Moving applications to outside of the corporate network prompts
several questions not directly related to the hosting platform mecha-
nisms. Adatum must be convinced that the hosting providers’ network
and infrastructure is secure, and that the hosted application will be
protected from malicious attacks and from data exposure in case of
systems failure. For example, the hosting network should be resilient
to Denial of Service (DoS) and network flooding attacks, and the
hosting platform should be able to reliably and safely reinitialize the
application after a hardware failure.
In addition, Adatum must evaluate whether hosting in a remote data-
center will meet any legal or regulatory requirements, such as a limita-
tion on the geographical location for data storage and processing.
Many cloud hosting providers, including Windows Azure, have data-
centers located around the world and allow users to specify the loca-
tion of the servers and data storage facilities. Windows Azure allows
users to specify whether storage replication for backup and resiliency
will take place across multiple datacenters in order to satisfy regula-
tory limitations.
Most business applications
rely on a relational
database, even though it
may be exposed through
a custom repository or
data access layer. However,
many applications also have
other storage requirements
such as profile and session
data, binary and formatted
data streams, and disk
files. The target hosting
platform must either
offer equivalent services,
or it must be reasonably
easy and cost-efficient
to adapt the application
to use available storage
mechanisms.
9
The Adatum Scenario
In addition, Adatum must ensure that the chosen hosting provider and
deployment mechanism allows administrators to monitor and manage
the application and the data stores remotely. Windows Azure includes
a range of capabilities that closely match the remote access capabilities
for on-premises server, database, and application management. For
example, it supports a range of logging facilities, remote desktop ac-
cess to servers and hosted services, remote configuration, and manage-
ment of applications and data stores through a web-based portal and
APIs that supports REST calls and scripting.
Finally, Adatum must consider if the remote applications must be in-
tegrated with other services, both in the cloud and on-premises, to
access data, communicate messages, and for monitoring and manage-
ment. For example, Adatum uses Microsoft System Center Operation
Manager for monitoring applications, and it should therefore be also
to integrate the remote application and services with this. Addition-
ally, Adatum relies on domain-level authentication through Active
Directory and so it will be necessary to join the remote machines to
the on-premises domain or adopt an alternative solution that provides
equivalent functionality.
Evaluating Service Level Agreements
Adatum recognized that, although the aExpense application is used
only by company employees, it must be readily available (in other
words, only very rarely offline) and responsive to a reasonable degree.
There is no formal SLA for the application, but it should of necessity
be available to employees whenever they need to submit expense
claims. Of course, for other types of applications, especially publicly
visible or business-crucial applications, there will need to be a more
formal SLA defined.
SLAs should define not only availability of an application, but also
maximum response times. In addition, where other services are re-
quired (such as caching or access control), the SLAs should also cover
these services. Finally, SLAs should include any information required
to define security risks and to meet regulatory or legal requirements
(such as the geographical location for data storage).
Windows Azure provides formal SLAs for the IaaS, PaaS, and related
services that it offers. However, these do not and cannot cover the
customer’s hosted application, as this is outside of Microsoft’s control.
Instead, the SLAs are defined in terms of connectivity and role execu-
tion; for example, the SLA for Cloud Services guarantees that a role
instance will expose full connectivity for 99.95% of the time and that
failed role instances will be detected and restarted 99.9% of the time.
You can find details of the
Windows Azure Service
Level Agreements for all of
the services online.
10 chapter one
Evaluating Additional Opportunities
In addition to the fundamental choices of the hosting model and the
deployment approach, the designers and developers at Adatum con-
sidered if they could benefit from using the many ancillary services
and features available in Windows Azure.
For example, they considered whether the application would benefit
from the use of Windows Azure Caching to maximize performance
when retrieving data; or for caching output, session state, and profile
information.
Other features that Adatum realized would be useful for the aExpense
application included Windows Azure Active Directory for authentica-
tion and the Content Delivery Network (CDN) for delivering images
and other non-authenticated content. These features and Adatum’s
decisions regarding their use are explained in more detail in the fol-
lowing chapters of this guide.
Adatum also considered whether the application needed to commu-
nicate with the on-premises applications using messaging, or access
services exposed by on-premises applications. Windows Azure Ser-
vice Bus provides many features that would be useful in this scenario,
but Adatum decided that these were not required for the current
version of aExpense.
To learn more about Windows Azure Service Bus see “Service
Bus.” The guide “Building Hybrid Applications in the Cloud”
describes the scenarios for and usage of Service Bus in detail.
Adatum’s Migration Path for the aExpense
Application
Every company will inevitably make different decisions on the migra-
tion path they adopt for moving to the cloud. The range of contribut-
ing factors is vast, and each company will have specific goals and limi-
tations that affect the final choices. Typically, companies will begin, as
Adatum did, by understanding the concepts of cloud hosting; and
then exploring the platforms, services, and options available from
cloud hosting providers. From that comes the decision on which cloud
provider to use, and the hosting approach that will best match all the
requirements.
For a full list of the features
and services available
in Windows Azure, see
“Introducing Windows
Azure.”
11
The Adatum Scenario
This guide shows how you can make the appropriate choices when using Windows Azure. However,
to help you make those choices, this guide shows several of the hosting approaches. As you will see,
the path that Adatum chose for migrating the aExpense application to the cloud included several
stages. Adatum began by choosing the option that required the least modification to the aExpense
application and then, at each subsequent stage, considered whether moving to another hosting ap-
proach would provide additional benefits.
While the multi-step approach Adatum chose for migrating their application may not be
realistic in every real-world scenario, it allows the guide to demonstrate several options
that are available for hosting applications in Windows Azure. The discussion of the advan-
tages and limitations at each stage will help you to better understand the options avail-
able to you when migrating your own applications.
The migration steps that Adatum took for the aExpense application are shown in the following table.
The table shows the chapter that discusses each step, a high-level overview of the options chosen, and
the Windows Azure technologies that Adatum used. This will help you to follow the flow of the guide
and explore the different approaches taken at each stage.
Chapter Migration step Justification Technologies
2 – “Getting to
the Cloud”
Infrastructure as a
Service (IaaS).
Minimal code changes to the application and
familiarity with the platform. A quick and easy
way to explore the benefits of cloud hosting,
such as increased reliability and reduced costs
of managing the on-premises infrastructure.
Windows Azure Virtual
Machines, Virtual
Networks, and Connect.
3 – “Moving to
Windows Azure
Cloud Services”
Platform as a Service
(PaaS).
No operating system maintenance, easy
scalability and elasticity, more granular control
of resource usage, and the opportunity for
auto scaling.
Windows Azure Web
Sites, Cloud Services web
role, and Caching.
Windows Identity
Framework.
4 – “Moving to
Windows Azure
SQL Database”
Platform as a Service
(PaaS) for database
Lower cost although some limitations on
feature availability. No software maintenance.
Windows Azure SQL
Database.
Transient Fault Handling
Application Block.
5 – “Executing
Background
Tasks”
Maximizing efficiency
and adding additional
tasks.
Better scalability and performance, better user
experience, improved efficiency, and load
leveling across role instances.
Windows Azure Cloud
Services worker role,
queues, and blob storage.
6 – “Evaluating
Cloud Hosting
Costs”
Revisiting initial cost
estimations.
Confirm initial estimates of cost and look for
additional savings.
Windows Azure Pricing
Calculator.
7 – “Moving to
Windows Azure
Table Storage”
Switching away from
relational database
storage.
Lower cost, greater storage volume, opportu-
nity for increased performance, and scalability.
Windows Azure table
storage.
Some of the technologies described in this guide and used in the examples are preview versions, and
the subsequent release versions may differ from the information provided in this guide. This includes
Windows Azure Web Sites, Windows Azure Virtual Machines, and Windows Azure Virtual Networks.
12 chapter one
Choosing Your Own Migration Path
Just because Adatum has chosen the path described in this chapter, it doesn’t mean that you must
follow the same path. Some companies may decide which combination of hosting approach, data
store, and services they will use and go directly to this in single migration step. Others may follow a
more gradual migration by adopting, for example, Cloud Services as the hosting approach for the
application code, but use SQL Server hosted in a Virtual Machine before moving to Windows Azure
SQL Database. Meanwhile, some companies may choose the IaaS path so that they have full control
over the operating system, but decide to take advantage of the cost savings and vast storage capa-
bilities of Windows Azure table and blob storage instead of using a relational database.
How much
will I save?
On-premises
Table and
Blob Storage
Virtual
Machines
Hosted SQL
Server
PaaSville
IaaS City
Cloud Services
& Web Sites
Background
Tasks
Full Control of
the operating
system
Few code changes but
must maintain the
operating system
Refactor the
code but avoid
operating system
maintenance
All the
capabilities of
SQL Server
Easy to use
managed
data service
Simple
scalability and
multiple options
Offload
processing
from the UI
Cost efficient and
hugely scalable
Costing
SQL
Database
Figure 2
Choosing your own migration path
13
The Adatum Scenario
This is one of the major advantages with Windows Azure – you choose which of the wide range of
services it offers are most suitable for your own scenario and requirements. No two applications are
the same. Throughout this guide you will see more details of the capabilities and limitations of each
hosting option, and how to make the right choice for your applications.
More Information
All links in this book are accessible from the book’s online bibliography available at:
http://msdn.microsoft.com/en-us/library/ff803373.aspx.
Overview of Windows Azure features.
For an overview of the data storage options available in Windows Azure, “Data Storage Offerings on
the Windows Azure Platform.”
Introducing Windows Azure includes a list of features.
Windows Azure Service Level Agreements.
“Windows Azure Websites, Cloud Services, and VMs: When to use which?”
Windows Azure Service Bus.
The guide “Developing Multi-tenant Applications for the Cloud” explores techniques for building new
applications specifically designed for run in Windows Azure.
The guide “Building Hybrid Applications in the Cloud” describes the scenarios for and usage of many
Windows Azure features.
15
2 Getting to the Cloud
This chapter describes the first step the developers at Adatum took on their migration path to the
cloud. It discusses the contributing factors for the decision they made to use an IaaS approach for
hosting the aExpense application in Windows Azure, and explores the process they followed to
achieve this. The chapter also discusses issues related to application lifecycle management (ALM),
specifically for scenarios that use an IaaS hosting approach.
This first migration step is concerned only with getting the application to work in the cloud without
losing any functionality. However, it does address some “big” issues such as security and data storage
that are relevant to almost every cloud-based application.
This chapter doesn’t explore how to improve the application by exploiting the extended set of fea-
tures available in Windows Azure. In addition, the on-premises version of the application that you’ll
see is not complete; for example, it does not support uploading receipt images or interaction with
Adatum’s other on-premises systems. The following chapters discuss how to improve the application
by using other features available in Windows Azure, and you’ll see more functionality added to the
application. For now, you’ll discover how Adatum takes its first steps into the cloud.
16 chapter two
The Premise
The existing aExpense application is a business expense submission
and reimbursement system used by Adatum employees. The applica-
tion is built with ASP.NET 4.0, deployed in Adatum’s data center, and
is accessible from the Adatum intranet. The application relies on Ac-
tive Directory to authenticate employees. It also uses Active Direc-
tory to access some of the user profile data that the application re-
quires; for example, an employee’s cost center and manager. Other
user profile data is accessed using the ASP.NET profile provider and
membership provider. Because aExpense uses Windows authentica-
tion, it recognizes the credentials used when employees log on to the
corporate network and doesn’t need to prompt them again for their
user names and passwords.
The aExpense access control rules use application-specific roles such
as “Employee” and “Manager” that are accessed through the ASP.
NET role management provider. Access control is intermixed with
the application’s business logic. It uses a simple SQL Server database
for storing application data, and LINQ to SQL as its data access
mechanism. The application is configured to connect to SQL Server
by using integrated security, and the website uses a service account
to log on to the database. The aExpense application also uses the
Enterprise Library Logging Application Block and the Exception
Handling Application Block for logging diagnostic information from
the application.
Integration with Active
Directory really simplifies
the task of managing this
application. The aExpense
application leverages
Active Directory’s access
management facilities, and
the cost center and manager
information that Adatum
stores in Active Directory.
17
Getting to the Cloud
Figure 1
aExpense as an on-premises application
Goals and Requirements
Adatum wants to explore the opportunities for cloud hosting the aExpense application in an attempt
to maximize performance and availability, even during periods of peak usage, while minimizing the
associated costs. The goals at this stage are to avoid, as far as possible, changes to the application code
and the associated administrative functions while taking advantage of the flexibility and scalability
offered by cloud hosting.
Browser Web site
User
profile
Active
Directory
Windows
event
log
SQL Server
Database
Figure 1 shows a whiteboard diagram of the structure of the on-premises aExpense application.
18 chapter two
Therefore, as the first step in the migration path, Adatum has decided
to deploy the aExpense application to the cloud using an IaaS ap-
proach. This will avoid any requirement to refactor the application or
to make significant changes to the code because it can continue to run
on a hosted server running Windows Server. However, the developers
and administrators must still consider what, if any, changes are re-
quired to the application; and the impact of moving it from their on-
premises datacenter to the cloud.
Adatum chose to use Windows Azure because of its wide range of
capabilities for hosting both the application code and the data, and
the availability of additional Windows Azure services that are appro-
priate to meet the application’s requirements. For example, Adatum
wants to continue to use Active Directory for authenticating users,
and be able to integrate the application with its existing on-premises
System Center Operations Manager.
Adatum also wants to be able to deploy the application in a secure
and repeatable way to a staging environment first, and then to a
production environment when testing is complete. After deploy-
ment, Adatum’s administrators want to be able to scale the applica-
tion to cope with varying usage patterns, monitor its execution, and
be able to adjust configuration settings to fine tune it.
Overview of the Solution
This section of the chapter explores the high-level options Adatum
had for migrating the aExpense application during this step. It shows
how Adatum chose an appropriate hosting mechanism for the applica-
tion and for the data it uses, and how Adatum can establish connectiv-
ity between the cloud-hosted servers and its on-premises corporate
network.
Options for Hosting the Application
Having decided on an IaaS approach for this initial step, Adatum must
consider the hosting options available. Windows Azure provides the
following features for IaaS deployment:
• Virtual Machine. This feature allows you to provision a virtual
machine in the cloud with a choice of operating systems, and
with a range of options for preinstalling a database server on the
virtual machine. Alternatively, you can upload a prebuilt VM to
the cloud. You can use it to run any software compatible with
your chosen operating system, and configure the operating
system and services as required. Virtual Machine instances
maintain state between restarts, and so are suitable for use when
software or services you install require state to be maintained.
Your decision to move an
application to the cloud
should be based on clear
goals and requirements.
19
Getting to the Cloud
• VM Role. This feature allows you to host your own customized instance of the Windows Server
2008 R2 Enterprise or Windows Server 2008 R2 Standard within a Windows Azure data center.
However, the role does not save state when Windows Azure restarts or redeploys it as part of
the operations executed automatically within the data center (such as when the role fails), and
so it is not suitable for scenarios where the software or services you install require state to be
maintained.
• A set of associated services that provide connectivity and additional functionality for IaaS
applications. These services include Windows Azure Connect and Virtual Networks for providing
connectivity to hosted servers, and functional services such as claims-based access control,
Service Bus relay and messaging, database synchronization, and caching.
The major difference between Windows Azure Virtual Machines and the VM role is the behavior
when the machine or role is reinitialized. This can occur following a hardware failure, or auto-
matically as the Windows Azure internal systems manage allocation of resources by moving in-
stances to a different physical server.
Any changes to a virtual machine, such as installing applications or configuring the operating system,
are persisted when the instance is reinitialized – this is what is meant by the machine being able to
maintain its state. VM role instances do not persist these changes. Any changes such as installing ap-
plications or configuring the operating system are lost and the role will return to the originally de-
ployed configuration when reinitialized (although changes are persisted across restarts as long as the
VM role is not reinitialized).
This means that you must redeploy the complete VM role image each time you need to make changes
to it. When you use a virtual machine you do not need to do this. You can install and update applica-
tions on the virtual machine without needing to redeploy it every time, which makes it an attractive
option for both testing and production deployment.
For more information about how Windows Azure manages maintaining state in virtual machines,
see the section “Storing and Backing Up Virtual Machines” later in this chapter.
After considering the available application hosting options, Adatum chose to host the application in
a Windows Azure Virtual Machine at this stage of their migration process. Developers and testers will
be able to deploy to virtual machine instances in exactly the same way as when using an on-premises
server. Administrators and operators will be able to manage the live production server and deploy
applications to it just as they do with on-premises servers.
Affinity Groups
When you first create namespaces and instances of Windows Azure services, you must specify the
location or datacenter where they will be deployed. However, for some services you can specify only
a region rather than a specific datacenter. Therefore, to ensure that elements of your application (such
as the compute and storage services) are co-located in the same datacenter as close together as pos-
sible you specify an affinity group.
20 chapter two
When you specify an affinity group, which must be done when creat-
ing the services (you cannot move services into a different affinity
group after they are created), Windows Azure will attempt to locate
all of the services in the group in the same cluster in the same data-
center. This will maximize performance, reduce latency, and eliminate
unnecessary data transfer costs.
For information about using affinity groups, see “Importance of
Windows Azure Affinity Groups.”
Adatum will define an affinity group when it creates the virtual net-
work that aExpense uses to access the on-premises Active Directory
service. Adatum will also add all the virtual machines to the same af-
finity group when it creates them.
Availability Sets
In Windows Azure, fault domains are a physical unit of failure. Each
virtual machine in an availability set is deployed to a different fault
domain in Windows Azure. This helps to ensure that your application
stays available during network failures, local disk hardware failures,
and other outages.
However, improving the reliability and responsiveness of the aExpense
application by deploying multiple copies of the virtual machines in an
availability set will add to the running costs incurred by Adatum.
Options for Hosting the Data
The existing on-premises aExpense application stores its data in SQL
Server. Therefore, Adatum also had to consider how to provide a
comparable capability for the application when hosted in the cloud.
Adatum has several options:
• Keep the data on-premises. In theory this is a simple to imple-
ment option. The cloud-hosted application would communicate
with the on-premises database over the Internet. However, it
raises several issues, such as the security of the connection and
the requirement to expose the database server outside of Ada-
tum’s internal network. One approach to resolve this would be to
use Windows Azure Connect or Virtual Networks to provide a
private secure connection. Even with this approach, there are
issues around the additional connection latency and the possibil-
ity of intermittent connectivity failures, which would require
extensive caching in the application and a connection retry
mechanism.
There may be specific
reasons why you want to
keep your data on-premises,
such as physical security,
regulatory requirements,
specific management
or analysis processes,
and more. Hosting the
application in the cloud
while using an on-premises
database still allows you
to take advantage of the
intrinsic capabilities of
Windows Azure such as
reliability, scalability, and
elasticity.
You don’t need a virtual
network to use an
affinity group. You can
create affinity groups
independently of virtual
networks.
You must decide what
level of reliability
you need for your
application and how
much you are willing
to pay.
21
Getting to the Cloud
• Deploy the data in a hosted SQL Server. This approach would
require Adatum to deploy a separate virtual machine to run SQL
Server, although this can be easily provisioned using the tem-
plates available in the Windows Azure portal. Connection latency
and intermittent connectivity would be minimized by deploying it
in the same datacenter as the application.
• Deploy the data in Windows Azure SQL Database. This
approach would require Adatum to subscribe to the managed
data service offered by Windows Azure, and accept the few
limitations that it imposes when compared to the full version
of SQL Server. However, it is a viable and useful option that
Adatum will consider in a future migration step. Chapter 4,
“Moving to Windows Azure SQL Database,” of this guide looks
in detail at the differences between SQL Server and Windows
Azure SQL Database, and the factors that affect Adatum’s choice
at that stage of the migration process.
• Deploy the data in Windows Azure table and blob storage.
This approach would require Adatum to rewrite the data access
code in the application to accommodate the differences between
the relational, SQL-based data access approach and the less
structured storage mechanisms used in Windows Azure storage.
However, there are some specific advantages offered by Win-
dows Azure storage such as lower cost and vast storage capabil-
ity, and Adatum will consider this in a future migration step. At
this stage Adatum’s goal is to minimize the changes required to
the code. Chapter 7, “Moving to Windows Azure Table Storage,”
of this guide looks in detail at the differences between relational
databases and Windows Azure storage.
• Deploy the data in a custom store or repository. You can deploy
a range of operating systems and software on a hosted Virtual
Server, and so you can continue to use you existing data stores
and repositories. For example, if Adatum used a custom or third
party data storage mechanism based on a non-standard file
format, or even just use a simple file server, it could be deployed
on Windows Server or Linux on a virtual machine. However, as
Adatum uses SQL Server running on Windows Server in its
on-premises datacenter, this option is not applicable to its
migration strategy.
Chapter 4, “Moving to Windows Azure SQL Database,” describes
the differences between using a hosted SQL Server and Windows
Azure SQL Database, and how the developers at Adatum chose a
data storage mechanism for the aExpense application in the
subsequent steps of their migration path.
You do not have to use
Windows Server and SQL
Server when you choose
the IaaS approach for your
database. You can install a
range of operating systems
and database servers in
a hosted virtual machine
using the templates
available in the Windows
Azure portal. For example,
you may decide to use
MySQL running on Linux
as an alternative to SQL
Server running on Windows
Server.
22 chapter two
After considering the available data storage options, Adatum chose to
host the data in SQL Server running on a separate virtual machine in
the same datacenter as the application.
Connectivity for Authentication
Adatum’s aExpense application relies on connectivity to the Adatum
corporate domain to authenticate users against Active Directory, and
Adatum wants to maintain the existing mechanism when migrating
the application to the cloud. This will avoid the need to make changes
to the code while Adatum evaluates the results of the first step in its
migration path. In future migration steps Adatum will consider chang-
ing the authentication approach to use another mechanism, such as
claims and federated identity.
However, to continue to use Active Directory for authentication
when the application resides in the cloud, Adatum must establish con-
nectivity between the application and its on-premises corporate do-
main network. One of the advantages of Windows Azure as a hosting
environment is that it includes services to enable connectivity that is
safe, secure, and easy to set up.
Adatum has two options for establishing this connectivity between
the cloud-hosted application and its corporate domain network:
• Windows Azure Connect. This technology allows administrators
to set up a direct connection between a cloud-hosted virtual
machine (or a cloud services role) and an on-premises computer.
It relies on endpoint software installed in the remote and on-
premises computers, which establishes a secure connection across
the Internet. Connect does not require ports to be opened in the
corporate firewall, and will usually work when network address
translation (NAT) routing is in use. It is easy to set up and man-
age, and provides a secure connection.
• Windows Azure Virtual Networks. This technology uses the
virtual private network (VPN) approach to establish connectivity
across computers and hosted services in Windows Azure and
on-premises. Computers, cloud-hosted virtual machines, and
cloud service roles are configured on the network in the same
way as when running on premises, and a VPN router on the
corporate network establishes connectivity between the network
segments. Effectively, this extends the corporate network into
the cloud, allowing existing services and applications to be used
with no special software installation required on the on-premises
computers. Virtual networks are ideally suited to more complex
scenarios where scalability and additional control are required.
Adatum must establish
connectivity between its virtual
machines in the cloud and its
on-premises Active Directory
server to continue to use
Windows Authentication when
it deploys to a virtual machine
in the cloud. The current version
of aExpense also relies on
Windows Authentication to
connect to SQL Server.
23
Getting to the Cloud
Virtual networks are typically used where you need to connect
virtual machines and cloud service roles together, for connecting
between the cloud and on-premises, or when you need a virtual
machine or a role to maintain the same IP address when
redeployed. The video presentation “Migrating Applications to
Windows Azure Virtual Machines” contains a wealth of
information about setting up virtual machines and connecting
then using Windows Azure Virtual Networks.
Both of these options will allow Adatum to continue to use Active
Directory for authentication. However, there are some limitations
when using Windows Azure Connect. The Active Directory server
must also host DNS for the domain (the Connect service cannot be
used where a separate DNS server is used), and administrators will
need to install the Connect service endpoint software on the Active
Directory computer. If this is not an acceptable scenario, Adatum can
configure the cloud-hosted virtual machine as part of a Windows
Azure Virtual Network. Although this is more complex to configure,
it removes the requirement for installing endpoint software.
An alternative approach Adatum could take would be to install Active
Directory on a virtual machine running in Windows Azure, and con-
nect it to their on-premises Active Directory. However, this means
that Adatum must pay for the additional Windows Azure resources it
uses. In future releases of Windows Azure, the Access Control service
it provides will be extended to allow integration with an on-premises
Active Directory.
Session Support and Load Balancing
Applications that run in an on-premises datacenter often rely on in-
trinsic features of the network that are not supported in the cloud,
and this can affect the way that the application works when deployed
to the cloud. A typical example related to the aExpense application is
the way that Adatum implements an on-premises web farm by using
Windows Network Load Balancing (NLB), and the impact this has on
the way that it stores users’ session data.
The on-premises aExpense web application uses the built-in ASP.NET
in-memory session mechanism to support sessions for each user. This
means that session data is only available on the server that initiates
the session, and so users must be routed to the same server on each
request during a session. Adatum configured affinity for NLB in their
datacenter so that this occurs automatically.
For more information about NLB see “Overview of Network Load
Balancing.”
We could also use Windows
Azure Connect to link the
cloud-hosted application
to an on-premises database
by installing the Connect
service endpoint software
on the database server
computer if we needed
to keep that database on-
premises. Unlike opening
a public endpoint in SQL
Server, the Connect service
provides a secure channel
between the application
and the database. However,
in many organizations
installing this type of
software on the database
server may be frowned
upon, and this may
preclude you from using
an on-premises database
with your cloud-hosted
applications.
24 chapter two
However, affinity is not directly supported in Windows Azure (al-
though it can be implemented with a plug-in or with custom code).
If Adatum wants to run multiple instances of the virtual machine
that hosts the eExpense application in Windows Azure, the develop-
ers must change the way session data is stored so that it is available
to all instances. For example, they could switch to using the ASP.
NET SQL Server session store provider, Windows Azure storage, or
use Windows Azure Caching. Chapter 3 of this guide, “Moving to
Windows Azure Cloud Services,” explores these options and shows
how Adatum’s developers implemented session storage during the
next stage of their migration strategy.
At the moment Adatum is most concerned with getting the applica-
tion running in the cloud to explore the possibilities, validate usability
and performance, and gauge user acceptance. Adatum wants to avoid
making changes to the code. Therefore, in this step of its migration
plan, Adatum will run only one instance of the virtual machine that
hosts the aExpense application in the cloud.
For information about how to enable load balancing between
multiple instances of Virtual Machines in Windows Azure see the
section “Load balancing virtual machines” in the topic “Virtual
Machines.” The blog post “Setting up a webfarm using Windows
Azure Virtual Machines” provides a walkthrough of the
procedure.
Integrating with On-Premises Services
The existing on-premises aExpense application integrates with other
applications within Adatum’s corporate network. For example, it reads
and writes text files that are used to import and export expenses data
for processing by Adatum’s other on-premises systems. Therefore
Adatum must consider how it can establish the equivalent functional-
ity when the application is hosted in the cloud.
The Visual Studio solution BeforeAzure discussed in this chapter
does not include this data import and export functionality.
The Visual Studio solution Azure-TableStorage discussed in
Chapter 7, “Moving to Windows Azure Table Storage,” shows
how Adatum added the data export feature to the aExpense
application.
When using IaaS and virtual servers in the cloud, the application can
write to the virtual disk in the same way as when running on a physical
server. Administrators can enable direct connectivity with the ma-
chine by using Windows Azure Connect or a Windows Azure Virtual
Network to allow access to disk files stored on the drives of the re-
mote server.
When you move an
application to the cloud
you must consider the
impact of running multiple
instances in an environment
that does not support some
of the intrinsic features of
your own network. Session
management is a typical
example.
25
Getting to the Cloud
Alternatively, Adatum’s developers could change the code so that it
serializes the files and stores them in either Windows Azure storage
or in the database. As the files will be read and generated remotely,
and streamed to and from the in-house application over the Internet,
this is not an issue because they will need to be serialized anyway and
can be reconstructed on the on-premises server.
Both of the connectivity options, Windows Azure Connect and
Windows Azure Virtual Network, allow Adatum to connect the
cloud-hosted virtual machines running the application and SQL
Server to their corporate domain. This means that existing tools and
practices will continue to work without changes being required. For
example, administrators can browse the remote machines, use data-
base management tools, run existing scripts, and use the same
monitoring and management applications. For more details of how
Adatum’s administrators will manage the remote servers and applica-
tion, see the section “Management and Monitoring” later in this
chapter.
Inside the Implementation
Now is a good time to walk through the process of migrating aEx-
pense into a cloud-based application in more detail. As you go through
this section, you may want to download the Microsoft Visual Studio
development system solution from http://wag.codeplex.com/. This so-
lution contains an implementation of the aExpense application (in the
BeforeAzure folder) as it is when running on-premises. If you are not
interested in the mechanics, you should skip to the next section.
Profile Data
Before the migration, aExpense used the ASP.NET profile feature to
store application-specific user settings. Adatum tries to avoid custom-
izing the schema in Active Directory, so aExpense stores a user’s pre-
ferred reimbursement method by using the profile feature. The default
profile provider stores the profile properties in a database.
Using the profile feature makes it very easy for the application to
store small amounts of user data. Adatum enabled the profile feature
and specified the properties to store in the Web.config file.
We don’t like to customize
the Active Directory schema
if we can possibly avoid it.
Schema changes have far-
reaching implications and
are difficult to undo.
A virtual machine or a
VM role or can be used
simply as a file server in the
cloud. When connected
through Windows Azure
Connect or Windows Azure
Virtual Networks it will be
accessible from on-premises
computers and by other
applications running in the
cloud.
26 chapter two
XML
<profile defaultProvider="SqlProvider">
<providers>
<clear />
<add name="SqlProvider"
type="System.Web.Profile.SqlProfileProvider"
connectionStringName="aExpense"
applicationName="aExpense" />
</providers>
<properties>
<add name="PreferredReimbursementMethod" />
</properties>
</profile>
Then developers can access a profile property value in code like this.
C#
var profile = ProfileBase.Create(userName);
string prm =
profile.GetProperty<string>("PreferredReimbursementMethod");
Connecting to a hosted SQL
Server running on a virtual
machine instead of a SQL
Server on-premises requires
only a configuration change.
After migration, aExpense continues to use the profile system to store
the preferred reimbursement method for each user.
The application also uses ASP.NET membership to store the users
preferred name, and ASP.NET role management for the custom roles
used in the aExpense application. You can see how these are config-
ured in the Web.config file, and how they are accessed in the User-
Repository class.
Connecting to the Hosted SQL Server
Before the migration aExpense stored application data in a SQL
Server database running on-premises. In this first phase, the team
moved the database to a hosted SQL Server running on a virtual ma-
chine. The data access code in the application remains unchanged. The
only thing that needs to change is the connection string in the Web.
config file.
27
Getting to the Cloud
XML
<add name="aExpense" connectionString=
"Data Source={Server Name};
Initial Catalog=aExpense;
Integrated Security=True;
Encrypt=yes;"
providerName="System.Data.SqlClient" />
This connection string uses the same SQL Server security mode as the
on-premises solution. To continue using Windows Authentication
mode, both the virtual machines must be able to access the Adatum
on-premises Active Directory service. The server name must be set to
the server name of the virtual machine where SQL Server is hosted.
Adatum also chose to encrypt the connection to SQL Server; for more
information see “Encrypting Connections to SQL Server “ on MSDN.
If you choose to use SQL Server authentication instead of
Windows authentication to connect to SQL Server, your
connection string will include a user name and password in
plain text. In this scenario, you should consider encrypting
your SQL connection string in the Web.config file; to do this,
you can use the Pkcs12 Protected Configuration Provider. For
more information, see Chapter 4, “Moving to Windows Azure
SQL Database.”
The connection string also specifies that all communications with
Windows Azure SQL Database are encrypted. Even though your ap-
plication may reside on a computer in the same data center as the
server hosting SQL Server, you should treat that connection as if it
was using the internet.
Database Connection Timeouts and Dropped Connections
If a connection to SQL Server times out or drops while your application
is using the connection, you should immediately try to re-establish the
connection. If possible, you should then retry the operation that was in
progress before the connection dropped, or in the case of a transaction,
retry the transaction. It is possible for a connection to fail between
sending a message to commit a transaction and receiving a message that
reports the outcome of the transaction. In this circumstance, you must
have some way of checking whether the transaction completed suc-
cessfully in order to determine whether you must retry it.
You can also add protection
to your hosted SQL
Server by configuring the
Windows Firewall on the
virtual machine so that it
allows only a specific range
of permitted IP addresses
to connect to your database
server. However, this is
complicated by the fact
that you may not always be
able to determine ahead of
time the IP address of your
virtual machine instance(s).
For example, when you
redeploy a virtual machine,
the IP address may change.
28 chapter two
When using a hosted SQL Server, you can continue to use the same
techniques as you do in on-premises applications. As long as the
virtual machines hosting the application and the SQL Server are co-
located in the same datacenter, connection failures should arise no
more often than when running in your own datacenter. However, it
is useful to consider implementing a mechanism that can alleviate
issues with failed connections. In Chapter 4, “Moving to Windows
Azure SQL Database,” of this guide you will see how Adatum chose
to use the Enterprise Library Transient Fault Handling Block to man-
age connection retries when connecting to the database.
Deploying the aExpense Application to Windows Azure
Virtual Machines
This section outlines the steps that Adatum took to deploy the
aExpense application to two Windows Azure virtual machines: one
for the web application and one for the SQL Server database. For a
more detailed description of the steps, see the Hands-on Labs that are
available for this guide.
Deploying the Web Application
1. Create a virtual network to enable connectivity to the Adatum
on-premises Active Directory server.
2. Create a virtual machine based on the Windows Server image
available in the portal and ensure that the virtual machine is part
of the virtual network.
3. Set up remote desktop connectivity to enable access to the
virtual machine from on-premises.
4. Join the machine to the Adatum Active Directory.
5. Install .NET 4 on the virtual machine.
6. Install and configure the dependencies of the aExpense applica-
tion: install Internet Information Server (IIS), enable Windows
Communication Foundation in IIS, enable Application Pool User
Profile in IIS, install certificates required for HTTPS, and config-
ure HTTPS in IIS.
7. Copy the application code to the server, and add a web applica-
tion in IIS.
By configuring appropriate
endpoints for your virtual
machine in the Windows
Azure portal, you can
improve security by limiting
its publicly available TCP
ports.
29
Getting to the Cloud
Deploying the Database
1. Create a virtual machine that includes SQL Server. Adatum did this
by using an image available in the portal that includes SQL Server
2012, but it could have installed a different version. This virtual
machine should be part of the same virtual network and affinity
group as the virtual machine that hosts the web application.
2. Set up remote desktop connectivity to enable access to the
virtual machine from on-premises.
3. Join the machine to the Adatum Active Directory.
4. Open port 1433 in Windows Firewall to allow access to the
database (you may want to use a different port to help hide SQL
Server), and enable network connectivity in SQL Server for the
TCP/IP protocols.
5. Migrate the on-premises database used by the aExpense applica-
tion to the SQL Server installation in the virtual machine. Ensure
that the domain account used by the application pool on the web
server has access to the database.
During testing the development team at Adatum is working with
sample data. However, the developers must consider how they will
deploy both test and live data to the SQL Server instances running
in the hosted virtual machines. To migrate an existing database
schema and data to a hosted SQL Server, Adatum can use SQL
Server Management Studio. The SQL Server Integration Service and
other export tools it contains allow administrators to connect to
both the local and the Windows Azure hosted servers to create a
copy of the database and its data in the hosted server.
An alternative is to export the schema—and, if required, the data—as
a Transact-SQL script, and then connect to the remote server using
Remote Desktop Protocol (RDP) and run the script using SQL Server
Management Studio or the command line on that server. Using a script
allows Adatum to include this as part of the build process for the test
server running in Windows Azure staging, so that the application can
be tested without using the live data.
Adatum is using a virtual
network to enable
connectivity to the on-
premises services that
the aExpense application
uses. The virtual network
is not needed to enable
connectivity between the
two Windows Azure virtual
machines.
30 chapter two
Testing, Deployment, Management, and
Monitoring
This section discusses application life cycle management topics for
applications hosted in Windows Azure. Although specific require-
ments will vary between applications and across organizations, every-
one develops applications, then tests them, and finally deploys them.
Typical factors that must be considered are where applications should
be tested, and how the deployment process should be managed to
make sure that only authorized personnel have access to the live pro-
duction environment.
In this chapter the focus is on the specific scenarios
related to IaaS deployment using hosted virtual machines.
In subsequent chapters you will find additional information
related to the subsequent stages of the migration process
Adatum followed. If you choose to use the Windows
Azure VM role instead of virtual machines, you will need
to establish a testing and deployment procedure that
encompasses redeploying the server images each time
you change the application or reconfigure the server.
Adatum has a well-defined set of existing processes for deploying ap-
plications to its on-premises servers. The development and testing
teams use separate servers for testing, staging, and production. When
the development team releases a new version of the application, its
progression through the testing, staging, and production environ-
ments is tightly controlled. Very rarely, though, small fixes, such as
updating the text on an ASPX page, are applied directly to the produc-
tion servers.
Adatum has a number of goals for application life cycle management
for Windows Azure. Adatum wants to maintain its clearly defined
process for deploying applications to Windows Azure, with clearly
defined roles and responsibilities. More specifically, it wants to make
sure that access to the live environment is only available to a few key
people, and that any changes to the live environment are traceable.
You can use the Windows Azure API to get a list of create,
update, and delete operations that were performed on a
subscription during the specified timeframe. For more
information, see “List Subscription Operations.”
We want to have a clearly
defined process for
deploying applications to
Windows Azure that allows
us to control and trace
operations carried out on
our subscriptions.
Another Random Scribd Document
with Unrelated Content
closed, he set off, fatigued as he was, without recruiting himself with
any refreshment. He intended to ask for one of the ladies of St.
Catherine’s, and entreat her, if Amanda was then in a situation to be
seen, to announce his arrival to her; but after rapping repeatedly
with a rattan against the door, the only person who appeared to him
was a servant girl. From her he learned the ladies were all in the
chapel, and that Miss Fitzalan was in the prioress’s apartment. He
asked, “Was she too ill to be seen?” The girl replied, “No"—for
having only entered the room to leave the kettle in it, at a time
when Amanda was composed, she imagined she was very well. Lord
Mortimer then told her his name, and desired her to go up to Miss
Fitzalan and inquire whether she would see him. The girl attempted
not to move. She was in reality so struck of a heap by hearing that
she had been talking to a lord, that she knew not whether she was
standing on her head or her heels. Lord Mortimer imputing her
silence to disinclination to comply with his request, put a guinea into
her hand, and entreated her to be expeditious. This restored her to
animation, but ere she reached the room she forgot his title, and
being ashamed to deliver a blundering message to Miss Fitzalan, or
to appear stupid to Lord Mortimer, she returned to him, pretending
she had delivered his message, and that he might go up. She
showed him the door, and when he entered he imputed the silence
of Amanda, and her not moving, to the effects of her grief. He
advanced to the couch, and was not a little shocked on seeing her
eyes closed—concluding from this that she had fainted, but her easy
respiration soon convinced him that this was a mistake, and he
immediately concluded that the girl had deceived him. He leaned
over her till she began to stir, and then retreated behind her, lest his
presence, on her first awaking, should alarm her.
What took place in the interview between them has already been
related. Notwithstanding appearances were so much against her, and
no explanation had ensued relative to them, from the moment she
asserted her innocence with solemnity he could no longer doubt it;
and yielding at once to its conviction, to his love, to his pity for her,
he again renewed his overtures for a union. Hearing of the
stratagems laid for her destruction, the dangers she had escaped,
the distresses she had experienced, made him more anxious than
ever for completing it, that by his constant protection he might
secure her from similar trials, and by his tenderness and care restore
her to health, peace, and happiness. He longed for the period of her
triumphing over the perfidious marchioness, and the detestable Lady
Euphrasia, by being raised to that station they had so long
attempted to prevent her attaining, and thus proving to them that
virtue, sooner or later, will counteract the designs of vice. He felt a
degree of rapture at the idea of his being no longer obliged to regret
the ardent, the unabated affection he felt for her. His transports
were somewhat checked when she solemnly declared a union
between them impossible, and forbade his seeing her again. He was
piqued by the steadiness with which she repeated this resolution,
but her present weak state prevented his betraying any resentment,
and he flattered himself he would be able to conquer her obstinacy.
He could not now, indeed, despair of any event after the unexpected
restoration of Amanda to his esteem, and the revival of those hopes
of felicity, which in the certainty of having lost her had faded away.
He returned, as Johnaten said, an altered man, to the castle. He no
longer experienced horror at entering the dressing-room which
displayed so many vestiges of his Amanda’s taste.
He resolved on an immediate union as the surest proof he could give
her of his perfect confidence in her sincerity, not allowing himself to
suppose she would continue firm in the resolution she had recently
avowed to him. He then intended setting off for London, and sparing
neither time, trouble nor expense, to obtain from the inferior agents
in the plot laid against her, a full avowal of the part they had
themselves acted in it, and all they knew relative to those performed
by others. This was not designed for his own satisfaction. He wanted
no confirmation of what Amanda asserted, as his proposal to marry
her immediately demonstrated; it was to cover with confusion those
who had meditated her destruction, and add to the horrors they
would experience when they found her emerging from obscurity—
not as Miss Fitzalan, but as Lady Mortimer. Such proofs of her
innocence would also prevent malice from saying he was the dupe of
art, and he was convinced, for both their sakes, it was requisite to
procure them. He would then avow his marriage, return for his wife,
introduce her to his friends, and, if his father kept up any
resentment against them longer than he expected, he knew in Lady
Martha Dormer’s house, and at Tudor Hall, he would find not only an
eligible, but pleasant residence. Those delightful schemes kept him
awake half the night, and when he fell asleep it was only to dream
of happiness and Amanda.
In the morning, notwithstanding the prohibition he had received to
the contrary, he went to inquire how she was, and to try and see
her. The girl who had answered his repeated knocks the preceding
evening, appeared, and told him Miss Fitzalan was very bad. He
began to think that this must be a pretext to avoid seeing him, and
to come at the truth was slipping a bribe into her hand, when Sister
Mary, who had been watching them from an adjoining room,
appeared, and stopped this measure. She repeated what the girl had
just said, and, in addition to it, declared that even if Miss Fitzalan
was up she would not see him, and that he must come no more to
St. Catherine’s, as both Miss Fitzalan and the prioress would resent
such conduct exceedingly; and that, if he wanted to inquire after the
health of the former, he might easily send a servant, and it would be
much better done than to come frisking over there every moment.
Lord Mortimer was seriously displeased with this unceremonious
speech. “So, I suppose,” cried he, “you want to make a real nun of
Miss Fitzalan, and to keep her from all conversation.” “And a happy
creature she would be were she to become one of us,” replied Sister
Mary; “and as to keeping her from conversation, she might have as
much as she pleased with any one. Indeed, I believe the poor thing
likes you well enough; the more’s her misfortune for doing so.” “I
thank you, madam,” cried Lord Mortimer; “I suppose it one of your
vows to speak truth; if so, I must acknowledge you keep it
religiously.” “I have just heard her,” proceeded Sister Mary, without
minding what he had said, “tell the prioress a long story about you
and herself, by which I find it was her father’s desire she should
have nothing more to say to you, and I dare say the poor gentleman
had good reasons for doing so. I beg, my lord, you will come no
more here, and, indeed, I think it was a shame for you to give
money to the simpleton who answered you. Why, it is enough to
turn the girl’s head, and set her mad after one fal-lal or other.”
Lord Mortimer could not depart without an effort to win Sister Mary
over to his favor, and engage her to try and persuade Miss Fitzalan
to permit his visits, but she was inflexible; he then entreated to
know if Amanda was so ill as to be unable to rise. She assured him
she was, and, as some little consolation to the distress she perceived
this assurance gave him, said he might send when he pleased to
inquire after her health, and she would take care to answer the
messenger herself.
Lord Mortimer began now to be seriously alarmed lest Captain
Fitzalan had prevailed on his daughter to make a solemn
renunciation of him. If this was the case, he knew nothing could
prevail on her to break her promise. He was half distracted with
doubt and anxiety, which were scarcely supportable, when he
reflected that they could not for some time be satisfied, since, even
if he wrote to her for that purpose, she could not at present be able
to answer his letter; again he felt convinced of the instability of
earthly happiness, and the close connection there has ever been
between pleasure and pain.
CHAPTER XXXVI.
“Thy presence only ’tis can make me blest,
Heal my unquiet mind, and tune my soul.”—Otway.
The fatigue, distress, and agitation of Amanda could no longer be
struggled with; she sunk beneath their violence, and for a week was
confined to her bed by the fever which had seized her in England,
and ever since lurked in her veins. The whole sisterhood, who took it
in turn to attend her, vied with each other in kindness and care to
the poor invalid. Their efforts for her recovery were aided by a skilful
physician from the next town, who called, without being sent for, at
the convent. He said he had known Captain Fitzalan, and that,
hearing that Miss Fitzalan was indisposed, he had come in hopes he
might be of service to the daughter of a man he so much esteemed.
He would accept of no fee, and the prioress, who was a woman of
sagacity, suspected, as well as Amanda, that he came by the
direction of Lord Mortimer. Nor were they mistaken, for, distracted by
apprehensions about her, he had taken this method of lightening his
fears, flattering himself, by the excellent advice he had procured, her
recovery would be much expedited, and, of course, his suspense at
least terminated. The doctor did not withdraw his visits when
Amanda was able to rise; he attended her punctually, and often paid
her long visits, which were of infinite service to her spirits, as he was
a man of much information and cheerfulness. In a few days she was
removed from her chamber into a pleasant room below stairs, which
opened into the garden, where, leaning on the friendly doctor’s arm,
or one of the nuns’, she walked at different times a few minutes
each day. Lord Mortimer, on hearing this, thought he might now
solicit an interview, and accordingly wrote for that purpose:—
TO MISS FITZALAN.
Lord Mortimer presents his compliments to Miss Fitzalan, flatters
himself she will allow him personally to express the sincere
happiness her restoration to health has afforded him. He cannot
think she will refuse so reasonable a request. He is almost
convinced she would not hesitate a moment in granting it, could
she form an idea of the misery he has experienced on her
account, and the anxiety he feels, and must continue to feel, till
some expressions in the last interview are explained.
Castle Carberry, 10th May.
This letter greatly distressed Amanda. She had hoped the pain of
again rejecting his visits and requests would have been spared her.
She guessed at the expressions he alluded to in his letter; they were
those she had dropped relative to her promise to her father, and
from the impetuous and tender feelings of Lord Mortimer she easily
conceived the agony he would experience when he found this
promise inviolable. She felt more for his distress than her own. Her
heart, seasoned in the school of adversity, could bear its sorrows
with calmness; but this was not his case, and she paid the tribute of
tears to a love so fervent, so faithful, and so hopeless.
She then requested Sister Mary to acquaint his messenger that she
received no visits; that, as she was tolerably recovered, she
entreated his lordship would not take the trouble of continuing his
inquiries about her health, or to send her any more written
messages, as she was unable to answer them. The prioress, who
was present when she received the letter, commended her
exceedingly for the fortitude and discretion she had manifested.
Amanda had deemed it necessary to inform her, after the
conversation she heard between her and Lord Mortimer, of the terms
on which they stood with each other; and the prioress, who doubted
whether his lordship was in reality as honorable as he professed
himself, thought Amanda on the sure side in declining his visits.
The next morning the doctor called as usual. He told Amanda he had
brought her an entertaining book, for no such thing could be
procured at St. Catherine’s, and, as she had expressed her regret at
this, from the time she had been able to read he had supplied her
from his library, which was extensive and well chosen.
He did not present it to her till he was retiring, and then said, with a
significant smile, she would find it contained something worthy of
her particular attention. Amanda was alone, and immediately opened
it. Great was her astonishment when a letter dropped from it into
her lap. She snatched it up, and, perceiving the direction in Lord
Mortimer’s hand, she hesitated whether she should open a letter
conveyed in this manner; but to return it unopened was surely a
slight Lord Mortimer merited not, and she broke the seal with a
trembling hand and a palpitating heart:—
Unkind Amanda, to compel me to use stratagems in writing to
you, and destroy the delightful hopes which had sprung in my
soul, at the prospect of being about to receive a reward for my
sufferings. Am I ever to be involved in doubts and perplexity on
your account? Am I ever to see difficulty succeeded by difficulty,
and hope by disappointment?
You must be sensible of the anxiety I shall feel, until your
ambiguous expressions are fully explained, and yet you refuse
this explanation! But you have no pity for my feelings. Would it
not be more generous in you to permit an interview than to
keep me in suspense? To know the worst is some degree of
ease; besides, I should then have an opportunity of perhaps
convincing you that virtue, unlike vice, has its bounds, and that
we may sometimes carry our notions of honor and generosity
too far, and sacrifice our real happiness to chimerical ideas of
them. Surely I shall not be too presumptuous in saying that, if
the regard Amanda once flattered me with is undiminished, she
will, by rejecting a union with me, leave me not the only
sufferer.
Oh! do not, my dear and too scrupulous girl, think a moment
longer of persevering in a resolution so prejudicial to your
welfare. Your situation requires particular protection: young,
innocent, and beautiful; already the object of licentious pursuits;
your nearest relations your greatest enemies; your brother, from
his unsettled line of life, unable to be near you. Oh! my
Amanda, from such a situation what evils may accrue? Avoid
them, by taking refuge in his arms, who will be to you a tender
friend and faithful guardian. Before such evils, the obligation for
keeping a promise to reject me, fades away, particularly when
the motives which led to such a promise are considered. Captain
Fitzalan, hurt by the unfortunate letter he received from my
father, extended his resentment to his son, and called upon you
without reflecting on the consequences of such a measure to
give me up. This is the only reason I can conceive for his
desiring such a promise, and had I but arrived while he could
have listened to my arguments, I am firmly convinced, instead
of opposing, he would have sanctioned our union, and given his
beloved girl to a man who, in every instance, would study to
evince his gratitude for such a gift, and to supply his loss.
Happiness, my dear Amanda, is in long arrears with us. She is
now ready to make up for past deficiencies, if it is not our own
faults; let us not frighten her from performing her good
intentions, but hand in hand receive the lovely and long absent
guest to our bosoms.
You will not, cannot, must not, be inflexible; I shall expect, as
soon as you read this, a summons to St. Catherine’s to receive
the ratification of my hopes. In everything respecting our union
I will be guided by you, except delaying it; what we have both
suffered already from deceit makes me doubly anxious to secure
you mine, lest another vile scheme should be formed to effect
our separation.
Oh! Amanda, the faintest prospect of calling you mine gives to
my heart a felicity no language can express. Refuse not being
mine except you bring me an addition of fortune; already rich in
every virtue, I shall, in obtaining you, obtain a treasure which
the wealthiest, the proudest, and the vainest of the sons of men
may envy me the possession of, and which the good, the
sensible, and elegant, must esteem the kindest gift indulgent
heaven could bestow on me. Banish all uneasy doubts and
scruples, my Amanda, from your mind, nor think a promise,
which was demanded without reflecting on the consequences
that must attend it, can be binding. The ingenuous soul of your
father would have cancelled it in a moment, had those
consequences been represented to him; and now, when our
own reason convinces us of them, I make no doubt, if departed
souls are permitted to view the transactions of this world, his
spirit would behold our union with approbation. Yes, my
Amanda, I repeat your father’s approving spirit will smile upon
an act which gives to his lovely and beloved orphan a faithful
friend and steady protector, in her adoring
Mortimer.
Castle Carberry, 11th May.
This letter deeply affected the sensibility, but could not shake the
resolution of Amanda. She would not have answered it, as she
considered any correspondence an infringement on the promises she
had given her father to decline any further intimacy with him; but
from the warmth and agitation displayed in his letter, it was evident
to her that, if he did not receive an immediate answer to it, he
would come to St. Catherine’s and insist on seeing her; and she felt
assured, that she could much better deliver her sentiments upon
paper than to him; she accordingly wrote as follows:—
TO LORD MORTIMER.
My Lord,—You cannot change my resolution; surely, when I
solemnly declare to you it is unalterable, you will spare me any
further importunity on so painful a subject. In vain, my lord,
would you, by sophistry, cloaked with tenderness for that
purpose, try to influence me. The arguments you have made
use of, I am convinced, you never would have adopted, had you
not been mistaken in regard to those motives which prompted
my father to ask a promise from me of declining any farther
connection with you. It was not from resentment, my lord; no,
his death was then fast approaching, and he, in charity for all
mankind, forgave those who had wounded him by unjust
reproach and accusation; it was a proper respect for his own
character, and not resentment, which influenced his conduct, as
he was convinced if I consented to an alliance with you, Lord
Cherbury would be confirmed in all the suspicions he
entertained of his having entangled you with me, and
consequently load his memory with contempt. Tenderness also
for me actuated him; he was acquainted with the proud heart of
Lord Cherbury, and knew that if, poor and reduced as I was, I
entered his family I should be considered and treated as a mean
intruder. So thoroughly am I convinced that he did not err in
this idea, that, whenever reason is predominant in my mind, I
think, even if a promise did not exist for such a purpose, I
should decline your addresses; for, though I could submit with
cheerfulness to many inconveniences for your sake, I never
could support indignities. We must part, my lord; Providence
has appointed different paths for us to pursue in life: yours
smooth and flowery, if by useless regrets you do not frustrate
the intentions of the benevolent Donor; mine rough and thorny;
but both, though so different, will lead to the same goal, where
we shall again meet to be no more separated.
Let not your lordship deem me either unkind or ungrateful; my
heart disavows the justice of such accusations, and is but too
sensible of your tenderness and generosity. Yes, my lord, I will
confess that no pangs can be more pungent than those which
now rend it, at being obliged to act against its feelings; but the
greater the sacrifice the greater the merit of submitting to it,
and a ray of self-approbation is perhaps the only sunshine of the
soul which will brighten my future days.
Never, my lord, should I enjoy this, if my promise to my father
was violated. There is but one circumstance which could set it
aside, that is, having a fortune, that even Lord Cherbury might
deem equivalent to your own to bring you; for then my father
has often said he would approve our union; but this is amongst
the improbabilities of this life, and we must endeavor to
reconcile ourselves to the destiny which separates us.
I hope your lordship will not attempt to see me again; you must
be sensible that your visits would be highly injurious to me.
Even the holy and solitary asylum which I have found would not
protect me from the malice which has already been so busy
with my peace and fame. Alas! I now need the utmost vigilance
—deprived as I am of those on whom I had claim of protection,
it behooves me to exert the utmost circumspection in my
conduct; he in whom I expected to have found a guardian,
Oscar, my dear unfortunate brother, is gone, I know not whither,
persecuted and afflicted by the perfidious monster who has
been such a source of misery to me! Oh, my lord, when I think
what his sufferings may now be, my heart sinks within me. Oh!
had I been the only sufferer I should not have felt so great a
degree of agony as I now endure; but I will not despair about
my dear Oscar. The Providence which has been so kind to his
sister, which so unexpectedly raised her friends at the moment
she deemed herself deprived of all earthly comfort, may to him
have been equally merciful. I have trespassed a long time upon
your lordship’s attention, but I wished to be explicit, to avoid the
necessity of any further correspondence between us. You now
know my resolves; you also know my feelings; in pity to them
spare me any further conflicts. May the tranquil happiness you
so truly deserve soon be yours! Do not, my lord, because
disappointed in one wish, lose your sense of the many valuable
blessings with which you are surrounded, in fulfilling the claims
which your friends, your country, have upon you; show how
truly you merit those blessings, and banish all useless regrets
from your heart. Adieu, my lord!—suffer no uneasiness on my
account. If Heaven prolongs my life, I have no doubt but I shall
find a little comfortable shelter from the world, where, conscious
I have acted according to my principles of right, I shall enjoy
the serenity which ever attends self-approbation—a serenity
which no changes or chances in this life will, I trust, ever wrest
from
Amanda Fitzalan.
St. Catherine’s, May 12th.
She dispatched this by an old man who was employed in the garden
at St. Catherine’s ; but her spirits were so much affected by writing
it, she was obliged to go up and lie on the bed. She considered
herself as having taken a final adieu of Lord Mortimer, and the idea
was too painful to be supported with fortitude. Tender and fervent as
his attachment was now to her, she believed the hurry and bustle of
the world, in which he must be engaged, would soon eradicate it. A
transfer of his affections, to one equal to himself in rank and
fortune, was a probable event, and of course a total expulsion of her
from his memory would follow. A deadly coldness stole upon her
heart at the idea of being forgotten by him, and produced a flood of
tears. She then began to accuse herself of inconsistency. She had
often thought, if Lord Mortimer was restored to happiness, she
should feel more tranquil. And now, when the means of effecting
this restoration occurred, she trembled and lamented as if it would
increase her misery. “I am selfish,” said she to herself, “in desiring
the prolongation of an affection which must ever be hopeless. I am
weak in regretting the probability of its transfer, as I can never
return it.”
To conquer those feelings, she found she must banish Lord Mortimer
from her thoughts. Except she succeeded in some degree in this,
she felt she never should be able to exert the fortitude her present
situation demanded. She now saw a probability of her existence
being prolonged, and the bread of idleness or dependence could
never be sweet to Amanda Fitzalan.
She had lain about an hour on the bed, and was about rising and
returning to the parlor, when Sister Mary entered the chamber, and
delivered her a letter. Ere Amanda looked at the superscription, her
agitated heart foretold her whom it came from. She was not
mistaken in her conjecture; but as she held it in her hand, she
hesitated whether she should open it or not. “Yet,” said she to
herself, “it can be no great harm. He cannot, after what I have
declared, suppose my resolution to be shaken. He writes to assure
me of his perfect acquiescence to it.” Sister Mary left her at the
instant her deliberations ended, by opening the letter.
TO MISS FITZALAN.
Inexorable Amanda! but I will spare both you and myself the
pain of farther importunity. All I now request is, that for three
months longer at least, you will continue at St. Catherine’s ; or
that, if you find a much longer residence there unpleasant, you
will, on quitting it, leave directions where to be found. Ere half
the above-mentioned period be elapsed, I trust I shall be able
satisfactorily to account for such a request. I am quitting Castle
Carberry immediately. I shall leave it with a degree of
tranquillity that would perhaps surprise you, after what has so
lately passed, if in this one instance you will oblige your ever
faithful
Mortimer.
This laconic letter astonished Amanda. By its style it was evident
Lord Mortimer had recovered his cheerfulness—recovered it not from
a determination of giving her up, but from a hope of their again
meeting, as they could both wish. A sudden transport rushed upon
her heart at such an idea, but quickly died away when she reflected
it was almost beyond the possibility of things to bring about a
pleasing interview between them. She knew Lord Mortimer had a
sanguine temper, and though it might mislead him, she resolved it
should not mislead her. She could not form the most distant surmise
of what he had now in agitation; but whatever it was, she firmly
believed it would end in disappointment. To refuse every request of
his was painful; but propriety demanded she should not accede to
the last, for one step, she wisely considered, from the line of
prudence she had marked out for herself to take, might plunge her
in difficulties from which she would find it impossible to extricate
herself. With an unsteady hand she returned the following answer:—
TO LORD MORTIMER.
My Lord,—I cannot comply with your request. You may, if you
please, repeat inexorable Amanda. I had rather incur the
imputation of obstinacy than imprudence, and think it much
better to meet your accusation, than deserve my own. How long
I may reside at St. Catherine’s is to myself unknown. When I
quit it, I certainly will not promise to leave any directions where
you may find me.
The obstacles which have rendered our separation necessary,
are, I am convinced, beyond your lordship’s power to conquer.
Except they were removed, any farther interviews between us
would be foolish and imprudent in the extreme. I rejoice to hear
you are leaving the castle. I also rejoice, but am not surprised,
to hear of your tranquillity. From your good sense I expected
you would make exertions against useless regrets, and those
exertions I knew would be attended with success; but, as some
return for the sincere pleasure I feel for your restoration to
tranquillity, seek not to disturb again that of
Amanda Fitzalan.
St. Catherine’s, May 12th.
Scarcely had she sealed this letter when she was called to dinner;
but though she obeyed the summons she could not eat. The
exertions her writing to Lord Mortimer required, and the agitation his
letter had thrown her into, quite exhausted her strength and spirits.
The nuns withdrew soon after dinner, and left her alone with the
prioress. In a few minutes after their departure, the old gardener
returned from Castle Carberry, where he had been delivering her
letter. After informing her he had put it safely into his lordship’s
hands, he added, with a look which seemed to indicate a fear lest
she should be distressed, that he had received neither letter nor
message from him, though he waited a long time in expectation of
receiving either one or the other; but he supposed, he said, his
lordship was in too great a hurry just then to give any answer, as a
chaise and four was waiting to carry him to Dublin.
Amanda burst into tears as the man retired from the room. She saw
she had written to Lord Mortimer for the last time, and she could not
suppress this tribute of regret. She was firmly convinced, indeed,
she should behold him no more. The idea of visiting her she was
sure, nay, she hoped, he would relinquish, when he found, which
she supposed would soon be the case, the schemes or hopes which
now buoyed up his spirits impossible to be realized.
The prioress sympathized in her sorrow; though not from her own
experience, yet from the experience of others, she knew how
dangerous and bewitching a creature man is, and how difficult it is
to remove the chains which he twines around the female heart. To
remove those which lay so heavy upon the delicate and susceptible
heart of her young friend, without leaving a corrosive wound, was
her sincere wish, and by strengthening her resolution, she hoped
success would crown their endeavors.
Two hours were elapsed since her messenger’s return from the
castle, when Sister Mary entered the room with a large packet,
which she put into Amanda’s hands, saying, it was given her by Lord
Mortimer’s servant, who rode off the moment he delivered it.
Sister Mary made no scruple of saying, she should like to know what
such a weighty packet contained. The prioress chide her in a
laughing manner for her curiosity, and drew her into the garden, to
give Amanda an opportunity of examining the contents.
She was surprised, on breaking the seal, to perceive a very
handsome pocket-book in a blank cover, and found unsealed, a letter
to this effect:—
TO MISS FITZALAN.
I have put it out of your power to return this, by departing long
ere you receive it. Surely, if you have the laudable pride you
profess, you will not hesitate to use the contents of the pocket-
book, as the only means of avoiding a weight of obligations
from strangers. Though discarded as a lover, surely I may be
esteemed as a friend, and with such a title I will be contented
till I can lay claim to a tenderer one. You start at this last
expression, and I have no doubt you will call me a romantic
visionary, for entertaining hopes which you have so positively
assured me can never be realized; but ere I resign them, I must
have something more powerful than this assurance, my sweet
Amanda, to convince me of their fallacy. I was inexpressibly
shocked this morning to learn by your letter, that your brother
had met with misfortune. My blood boils with indignation
against the monster who has, to use your emphatical
expression, been such a source of misery to you both. I shall
make it my particular care to try and discover the place to which
Mr. Fitzalan is gone, and in what situation. By means of the
agents, or some of the officers belonging to the regiment, I
flatter myself with being able to gain some intelligence of him. I
need not add, that, to the utmost extent of my power I will
serve him. My success in this affair, as well as in that which
concerns a much dearer being, you may be convinced you shall
soon hear. Adieu, my Amanda; I cannot say, like Hamlet, “Go,
get you to a nunnery;" but I can say, “Stay there, I charge you.”
Seriously, I could wish, except you find your present situation
very unpleasant and inconvenient, not to change it for a short
time. I think, for a temporary abode, you could not find a more
eligible one; and, as I shall be all impatience when I return to
Ireland to see you, a search after you would be truly
insupportable. You have already refused to inform me of your
determination relative to this matter; surely I may venture to
request it may be as I wish, when I assure you, that, except I
can see you in a manner pleasing to both, I never will force into
your presence him, who, let things turn out as they may, must
ever continue Your faithful
Mortimer.
“Gracious Heaven!” said Amanda to herself, “what can he mean?
What scheme can he have in agitation which will remove the
obstacles to our union? He here seems to speak of a certainty of
success. Oh, grant, merciful Power!” she continued, raising her meek
eyes to heaven, while a rosy blush stole upon her cheeks, “grant
that indeed he may be successful. He talks of returning to Ireland;
still,” proceeded she, reading over the letter, “of requiring something
more powerful than my assurance to convince him of the fallacy of
his hopes. Surely, Lord Mortimer would not be so cruel as to raise
expectations in my bosom without those in his own were well
founded. No, dear Mortimer, I will not call you a romantic visionary,
but the most amiable, the most generous of men, who for poor
Amanda encounters difficulties and sacrifices every splendid
expectation.” She rejoiced at the intention he had declared of
seeking out Oscar. She looked forward either to a speedy interview,
or speedy intelligence of this beloved brother, as she knew Lord
Mortimer would seek him with the persevering spirit of benevolence,
and leave no means untried to restore him to her.
She now examined the contents of the pocket-book. It contained a
number of small bills, to the amount of two hundred pounds,—a
large present, but one so delicately presented, that even her ideas of
propriety could scarcely raise a scruple against her accepting it. They
did, however, suggest one. Uncertain how matters would yet
terminate between her and Lord Mortimer, she was unwilling to
receive pecuniary obligations from him. But when she reflected on
his noble and feeling heart, she knew she should severely wound it
by returning his present; she therefore resolved on keeping it,
making a kind of compromise with her feelings about the matter, by
determining that, except entitled to receive them, she would never
more accept favors of this nature from his lordship. The present one,
indeed, was a most seasonable relief, and removed from her heart a
load of anxiety which had weighed on it. After paying her father’s
funeral expenses, the people with whom he lodged, and the
apothecary who had attended him, she found herself mistress of but
twenty guineas in the whole world, and more than half of this she
considered as already due to the benevolent sisters of St.
Catherine’s, who were ill able to afford any additional expense.
She had resolved to force them to accept, what indeed she deemed
a poor return for their kindness to her, and she then intended to
retire to some obscure hovel in the neighborhood, as better suited to
the state of her finances, and continue there till her health was
sufficiently restored to enable her to make exertions for her
livelihood. But she shuddered at the idea of leaving St. Catherine’s
and residing amongst a set of boors. She felt sensations something
similar to those we may suppose a person would feel who was about
being committed to a tempestuous ocean without any means of
security.
Lord Mortimer had prevented the necessity which had prompted her
to think of a removal, and she now resolved to reside, at least for
the time he had mentioned, in the convent, during which she
supposed her uncertainties relative to him would be over, and that, if
it was not her fate to be his, she should, by the perfect re-
establishment of her health, be enabled to use her abilities in the
manner her situation required. Tears of heartfelt gratitude and
sensibility flowed down her cheeks for him who had lightened her
mind of the care which had so oppressed it.
She at length recollected the prioress had retired into the garden
from complaisance to her, and yet continued in it, waiting no doubt
to be summoned back to her. She hastily wiped away her tears, and
folding up the precious letter which was bedewed with them,
repaired to the garden, resolving not to communicate its contents,
as the divulgement of expectations (considering how liable all
human ones are to be disappointed) she ever considered a piece of
folly.
She found the prioress and Sister Mary seated under a broken and
ivy-covered arch. “Jesu! my dear,” said the latter, “I thought you
would never come to us. Our good mother has been keeping me
here in spite of my teeth, though I told her the sweet cakes I made
for tea would be burned by this time, and that, supposing you were
reading a letter from Lord Mortimer, there could be no harm in my
seeing you.” Amanda relieved the impatient Mary, and she took her
seat. The prioress cast her piercing eyes upon her. She perceived
she had been weeping, and that joy rather than sorrow caused her
tears. She was too delicate to inquire into its source; but she took
Amanda’s hand, and gave it a pressure, which seemed to say, “I see,
my dear child, you have met with something which pleases you, and
my heart sympathizes as much in your happiness as in your grief.”
Amanda returned the affectionate pressure with one equally tender
and a starting tear. They were soon called by Sister Mary to partake
of her hot cakes, which she had made indeed in hopes of tempting
Amanda to eat after her bad dinner. The whole community were
assembled at tea when the doctor entered the parlor. Amanda
blushed and looked grave at his first entrance; but he soon rallied
her out of her gravity. And when the prioress and the nuns,
according to custom, had withdrawn to evening vespers, he said,
with a significant smile, “he feared she had not attended as much as
he wished she should to the contents of the book he had last
brought her.” She saw by his manner he was acquainted with her
situation relative to Lord Mortimer, and therefore replied by saying,
“that perhaps, if he knew the motives which influenced her conduct,
he would not think her wrong in disregarding what he had just
mentioned.” She also said, “she detested all kinds of stratagem, and
was really displeased with him for practising one upon her.” “In a
good cause,” he said, “he should never hesitate using one. Lord
Mortimer was the finest young fellow he had ever seen, and had
won his favor, and the best wishes of his heart, from the first
moment that he beheld him. He made me contrive,” continued the
doctor, “a story to gain admission to your ladyship, and when I
found him so dreadfully anxious about you, I gave you credit (as I
had then no opportunity of judging for myself) for all the virtues and
graces he ascribed to you, and which I have since perceived you to
possess. You smile, and look as if you would call me a flatterer;
seriously, I assure you I am not one. I really think you worthy of
Lord Mortimer, and I assure you that is as great a compliment as
could be paid any woman. His mind was troubled with grief; he
revealed his troubles and perplexities to me, and after hearing them,
no good Christian ever prayed more devoutly for another than I
prayed for your recovery, that all your sorrows, like a novel, might
terminate in marriage.” “You are obliging in your wishes,” said
Amanda, smiling. “Faith, I am sincere in them,” exclaimed he, “and
do not know when I have been so disconcerted as at things not
turning out smoothly between you and his lordship; but I will not
despair. In all my troubles, and Heaven has given me my share, I
ever looked to the bright side of things, and shall always do so for
my friends. I yet expect to see you settled at Castle Carberry, and to
be appointed myself physician-general to your ladyship’s household.”
The mention of an event yet so uncertain greatly agitated Amanda;
she blushed and turned pale alternately, and convinced her good-
natured but loquacious friend, he had touched a chord which could
not bear vibration. He hastily changed the discourse, and as soon as
he saw her composed, rose to take his leave. Amanda detained him
for a minute, to try and prevail on him to take a ten-guinea note;
but he was inflexible, and said with some archness, “till the disorder
which preyed upon Lord Mortimer’s heart was in some degree
alleviated, he would receive no recompense for his visits, which he
assured Amanda, from time to time, he would continue to pay her,
adding, a certain person had enjoined him now and then to take a
peep within the holy walls of St. Catherine’s.”
The next morning Amanda set about a temporary arrangement of
her affairs. She presented thirty guineas to the sisterhood, which,
with much difficulty, she forced them to accept, though, in reality, it
was much required by them. But when she came to speak of paying
for a continuance, they positively declared they would agree to no
such thing, as she had already so liberally rewarded them for any
expense they had incurred on her account. She told them that if
they would not agree to be paid for lodging and board, she would
certainly leave them, though such a step was contrary to her
inclinations; she assured them also she was at present well able to
pay.
At last it was settled she should give them at the rate of forty
pounds a-year—a salary they thought extremely ample, considering
the plain manner in which they lived. She then had all the things
which belonged to her father and herself brought to the convent,
and had the former, with whatever she did not immediately want,
nailed up in a large chest, that on a short notice they might be
removed. Her harp and guitar she had, in her distress, proposed
sending back to the person in Dublin from whom they were
purchased, to sell for her; but she now determined to keep those
presents of her beloved father, except again urged by necessity to
part with them. She had a variety of materials for painting and
working, and proposed employing herself in executing pieces in each
way, not only as a means of amusing her time, but as a resource on
an evil day; thus wisely making use of the present sunshine, lest
another storm should arise which she should not be so well able to
struggle against.
CHAPTER XXXVII.
“In struggling with misfortunes
Lies the proof of virtue,”—Shakspeare.
The turbulence of grief, and the agitation of suspense, gradually
lessened in the mind of Amanda, and were succeeded by a soft and
pleasing melancholy, which sprang from the consciousness of having
always, to the best of her abilities, performed the duties imposed
upon her, and supported her misfortunes with placid resignation. She
loved to think on her father, for amidst her sighs for his loss were
mingled the delightful ideas of having ever been a source of comfort
to him, and she believed, if departed spirits were allowed to review
this world, his would look down upon her with delight and
approbation at beholding her undeviating in the path he had marked
out for her to take. The calm derived from such meditations she
considered as a recompense for many sorrows; it was such, indeed,
as nothing earthly gives, or can destroy, and what the good must
experience, though “amidst the wreck of matter and the crush of
worlds.”
She tried to prevent her thoughts from wandering to Lord Mortimer,
as the surest means of retaining her composure, which fled
whenever she reflected on the doubtful balance in which her fate yet
hung concerning him.
The solitude of St. Catherine’s was well adapted to her present
situation and frame of mind. She was neither teased with
impertinent or unmeaning ceremony, but perfect mistress of her own
time and actions, read, worked, and walked, as most agreeable to
herself. She did not extend her walks beyond the convent, as the
scenes around it would awaken remembrances she had not sufficient
fortitude to bear; but the space it covered was ample enough to
afford her many different and extensive rambles. And of a still
evening, when nothing but the lowing of the cattle, or the buzzing of
the summer flies, was to be heard, she loved to wander through the
solemn and romantic ruins, sometimes accompanied by a nun, but
much oftener alone.
A fortnight had elapsed in this manner since Lord Mortimer’s
departure, when, one morning, a carriage was heard driving across
the common and stopping at the outer gate of St. Catherine’s.
Amanda, who was sitting at work in the parlor with the prioress,
started in a universal trepidation at the sound. It may be easily
imagined the idea of Lord Mortimer was uppermost in her thoughts.
The door opened in a few minutes, and, to her great astonishment,
Mrs. Kilcorban and her two daughters made their appearance.
Agitation and surprise prevented Amanda from speaking; she
curtseyed, and motioned them to be seated. The young ladies
saluted her with an icy civility, and the mother treated her with a
rude familiarity, which she thought herself authorized in using to one
so reduced in circumstances as Amanda. “Dear me,” cried she, “you
can’t think, child, how shocked we have all been to hear of your
misfortunes. We only returned to the country yesterday, for we have
been in town the whole winter, and to be sure a most delightful
winter we have had of it—such balls, such routs, such racketings;
but, as I was going to say, as soon as we came home I began,
according to my old custom, to inquire after all my neighbors; and to
be sure the very first thing I heard of was the poor captain’s death.
Don’t cry, my dear, we must all go one time or another; those are
things, of course, as the doctor says in his sermon; so, when I heard
of your father’s death and your distress, I began to cast about in my
brains some plan for helping you; and at last I hit upon one which,
says I to the girls, will delight the poor soul, as it will give her an
opportunity of earning decent bread for herself. You must know, my
dear, the tutoress we brought to town would not come back with us
—a dirty trollop, by the bye, and I think her place would be quite the
thing for you. You will have the four young girls to learn French and
work too, and I will expect you, as you have a good taste, to assist
the eldest Miss Kilcorbans in making up their things and dressing. I
give twenty guineas a-year. When we have no company, the tutoress
always sits at the table, and gets, besides this, the best of treatment
in every respect.”
A blush of indignation had gradually conquered Amanda’s paleness
during Mrs. Kilcorban’s long and eloquent speech. “Your intentions
may be friendly, madam,” cried she, “but I must decline your
proposal.” “Bless me, and why must you decline it? perhaps you
think yourself not qualified to instruct; indeed, this may be the case,
for people often get credit for accomplishments they do not possess.
Well, if this is so, I am still content to take you, as you were always
a decent behaved young body. Indeed, you cannot expect I should
give you twenty guineas a-year. No, no, I must make some
abatement in the salary, if I am forced to get masters to help you in
learning the girls.” “Miss Fitzalan, madam,” exclaimed the prioress,
who had hitherto continued silent, “never got credit for
accomplishments which she did not possess; her modesty has rather
obscured than blazoned forth her perfections; she does not,
therefore, madam, decline your offer from a consciousness of
inability to undertake the office of an instructor, but from a
conviction she never could support impertinence and folly; should
her situation ever require her to exert her talents for subsistence, I
trust she will never experience the mortification of associating with
those who are insensible of her worth, or unwilling to pay her the
respect she merits.” “Hoity, toity,” cried Mrs. Kilcorban, “what
assurance! Why, madam, many a better man’s child would be glad to
jump at such an offer.” “Dear madam,” said Miss Kilcorban, “perhaps
the young lady has a better settlement in view. We forget Lord
Mortimer has been lately at Castle Carberry, and we all know his
lordship is a friend to Captain Fitzalan’s daughter.” “Or perhaps,”
cried Miss Alicia, in a giggling tone, “she means to be a nun.”
“Indeed, I suppose she means to be nothing good,” rejoined Mrs.
Kilcorban; “and I suppose it was by some impertinence or other she
had a tiff with Lady Greystock. Lord! (looking round the room), only
see her music-books—her harp—her guitar—as if she had nothing to
do but sing and thrum away the whole day. Well, miss (rising from
her chair), you may yet be sorry your friend said so much about you.
I did not come merely to offer to take you into my house, but to
offer you also a good sum for your harp and guitar, supposing you
had no business with such things nowadays; but I dare say you
would have refused this offer.” “I certainly should, madam,” said
Amanda; “it must be strong necessity which compels me to part with
my beloved father’s presents.” “Well, well, child, I wish this pride of
thine may not yet be humbled.” So saying, she flounced out of the
room, followed by her daughters, who, under an affectation of
contempt, evidently showed they were chagrined by the reception
they had met.
The prioress indulged herself in a long fit of laughter at the passion
into which she had thrown Mrs. Kilcorban; and Amanda, who
considered the lady and her daughters as the most insignificant of
beings, soon recovered from the discomposure their visit had
occasioned. In the course of the evening a letter was delivered her
by the servant, who said the messenger who brought it waited for
an answer. Amanda, in a universal trepidation, broke the seal; but,
instead of Lord Mortimer’s as she expected, a hand, to her entirely
new, struck her view:—
TO MISS FITZALAN.
My dear Creature,—I think I never was so diverted in my life as
at the account my mother and sisters gave of the reception they
met with from you to-day at St. Catherine’s. I vow to God it was
excellent. Nor can I help still wondering at their absurdity, in
thinking such a devilish fine girl as you are would sacrifice your
time in instructing a parcel of chits, when it can be devoted to
so much better a purpose! To be brief, my dear girl, I will take
you immediately under my protection, if not your own fault,
bring you to Dublin, settle you in elegant lodgings with a
handsome allowance, and not only make you, but declare you
to be, the grand Sultana of my affection; a situation which, I
can assure you, you will not be a little envied enjoying. In your
answer to this, I shall expect to hear when I may have the
felicity of bringing you from obscurity, to the brilliant scene you
were formed to ornament. Adieu, my dear. Believe me your
devoted,
B. Kilcorban.
The indignation which filled Amanda’s breast at reading this scrawl
cannot be expressed. Her blood seemed to boil in her veins. It was
some time ere she could sufficiently compose herself to acquaint the
prioress with the cause of her agitation. It was then agreed that the
letter should be returned with the following lines written on it:—
The author of this effusion of ignorance and impertinence has
already inspired all the contempt he merits. Should he repeat
his insolence, something even more mortifying than contempt—
chastisement—must ensue.
That a repetition of this kind would be the case, she did not believe.
From Kilcorban she had no reason to suspect either the
perseverance or designs of Belgrave. One was a libertine from
principle, the other she believed from fashion; and that to pique his
pride would be a sure method of getting rid of him.
But the calm she had for some time experienced was destined to be
interrupted. The next morning brought Father O’Gallaghan, the little
fat priest (of whom we have made mention before in our pages), to
the convent. He was not the officiating priest; but notwithstanding
this, paid many visits to the sisterhood, with whom he was a great
favorite; he had been much concerned about Amanda’s illness. She
was sitting alone in the parlor, drawing, when he entered it. He
seated himself by her, and the expression of his countenance
seemed to declare his heart was brimful of something pleasant.
“You won’t be offended now, my dear sowl,” said he, smirking up in
her face, “with a body for asking you how you would like to leave
this dismal solitude and have a comfortable home of your own,
where you might see your own friends, and have everything warm
and cosy about you?” “Why,” said Amanda, “though I do not
consider this a dismal solitude, yet, to be sure, I should have no
objection to a pleasant settled habitation.” “Ay, I always thought you
a sensible young body. Well, and what would you say to the person
then who could point out such a habitation? Ay, you little rogue, who
could say they had just such a one in their eye for you.” Amanda
stared at him with astonishment. She had at first believed him
jesting, but now found him serious.
“Ay, faith, my dear creature,” cried he, continuing his discourse with
a look of the most perfect satisfaction, “I have an offer to make you,
which, I believe, would make many girls jump out of their skins with
joy to hear. You remember the O’Flannaghans, I am sure, where you
took tea last summer. Well, the eldest of the sons (as honest a lad as
ever broke bread) cast a sheep’s eye upon you then. But what with
your going from the country, and some other matters, he thought
there was no use then in revealing his flame; but now, when you are
come plump in his way again, faith he plucked up his courage, and
told his father all about it. Old Flannaghan is a good-natured sowl,
and is very willing the match should take place. They have
everything snug about them. The old man will give everything into
your spouse’s hands. The youngest son will live in the house till he
gets married, and goes off to a farm of his own. The eldest daughter
is married; the second will live with her, and the youngest will be a
little handy assistant to you. So you see, you will not be tormented
with a large family. There is one little matter which, to be sure, they
are a little uneasy about, and that is your being of different
persuasions; but says I to them, when this was started, faith, says I,
you need not give yourself any trouble about it, for I know the
young woman to be a discreet sowl, and I am sure she will make no
hesitation about going to chapel instead of church, when she knows,
too, it is for her own interest. So, my dear sowl, I hope soon to give
you the nuptial benediction, and to be also your spiritual director.”
Amanda had listened to this speech in silent amazement. She now
rose, and would have quitted the room without speaking, to evince
her contempt, had not an idea darted into her mind that such
conduct perhaps might not be construed by the ignorant priest in
the manner she wished. She therefore stopped, and turning to him
said; “He could not wonder at her being offended at his pretending
to answer so freely for her in matters so important as religion; but to
prove how presumptuous he was in everything he said about her,
she must assure him his embassy to her was equally fruitless and
disagreeable; and that if Mr. O’Flannaghan consulted his own
happiness, he would seek to unite himself with a woman brought up
in his own sphere of life.” So saying, she quitted the room with a
look of dignity which quite confounded the poor priest, who
snatched up his hat in a great hurry, and waddled away to the farm,
to communicate the ill-success of his visit, which had quite crushed
his expectations of wedding presents and pudding feasts, which he
had contemplated in idea with delight.
It was some time ere Amanda recovered from the discomposure into
which the impertinence of the Kilcorbans and the priest had thrown
her. From what she suffered in consequence of it, she was forcibly
convinced how ill-qualified she was to struggle with a world where
she would be continually liable to such shocks. She had yet a hope
of escaping them—a hope of being guarded by the tutelary care of
Lord Mortimer, and of being one of the happiest of her sex.
Welcome to Our Bookstore - The Ultimate Destination for Book Lovers
Are you passionate about books and eager to explore new worlds of
knowledge? At our website, we offer a vast collection of books that
cater to every interest and age group. From classic literature to
specialized publications, self-help books, and children’s stories, we
have it all! Each book is a gateway to new adventures, helping you
expand your knowledge and nourish your soul
Experience Convenient and Enjoyable Book Shopping Our website is more
than just an online bookstore—it’s a bridge connecting readers to the
timeless values of culture and wisdom. With a sleek and user-friendly
interface and a smart search system, you can find your favorite books
quickly and easily. Enjoy special promotions, fast home delivery, and
a seamless shopping experience that saves you time and enhances your
love for reading.
Let us accompany you on the journey of exploring knowledge and
personal growth!
ebookgate.com

Moving Applications to the Cloud on Windows Azure 3rd Edition Dominic Betts

  • 1.
    Get the fullebook with Bonus Features for a Better Reading Experience on ebookgate.com Moving Applications to the Cloud on Windows Azure 3rd Edition Dominic Betts https://ebookgate.com/product/moving-applications-to-the- cloud-on-windows-azure-3rd-edition-dominic-betts/ OR CLICK HERE DOWLOAD NOW Download more ebook instantly today at https://ebookgate.com
  • 2.
    Instant digital products(PDF, ePub, MOBI) available Download now and explore formats that suit you... Cloud Computing with the Windows Azure Platform Wrox Programmer to Programmer 1st Edition Roger Jennings https://ebookgate.com/product/cloud-computing-with-the-windows-azure- platform-wrox-programmer-to-programmer-1st-edition-roger-jennings/ ebookgate.com Windows Phone 7 Developer Guide Building connected mobile applications with Microsoft Silverlight Developer Series 1st Edition Dominic Betts https://ebookgate.com/product/windows-phone-7-developer-guide- building-connected-mobile-applications-with-microsoft-silverlight- developer-series-1st-edition-dominic-betts/ ebookgate.com Moving Hadoop to the cloud harnessing cloud features and flexibility for Hadoop clusters First Edition, Release Edition Havanki https://ebookgate.com/product/moving-hadoop-to-the-cloud-harnessing- cloud-features-and-flexibility-for-hadoop-clusters-first-edition- release-edition-havanki/ ebookgate.com Windows Azure SQL Reporting Succinctly Stacia Misner https://ebookgate.com/product/windows-azure-sql-reporting-succinctly- stacia-misner/ ebookgate.com
  • 3.
    Moving from Windowsto Linux Networking Series 1st Edition Chuck Easttom https://ebookgate.com/product/moving-from-windows-to-linux-networking- series-1st-edition-chuck-easttom/ ebookgate.com Complete Latin Beginner to Intermediate Course 3rd Edition Gavin Betts https://ebookgate.com/product/complete-latin-beginner-to-intermediate- course-3rd-edition-gavin-betts/ ebookgate.com Mastering Multi Cloud Paradigm for Enterprises Transform Enterprise Infrastructure with Multi Cloud Strategies Using Azure AWS and GCP for and Disaster Recovery English Edition -- https://ebookgate.com/product/mastering-multi-cloud-paradigm-for- enterprises-transform-enterprise-infrastructure-with-multi-cloud- strategies-using-azure-aws-and-gcp-for-and-disaster-recovery-english- edition/ ebookgate.com To the Cloud 1st Edition Vincent Mosco https://ebookgate.com/product/to-the-cloud-1st-edition-vincent-mosco/ ebookgate.com Hacking Exposed Windows 3rd Edition Scambray https://ebookgate.com/product/hacking-exposed-windows-3rd-edition- scambray/ ebookgate.com
  • 5.
    Moving Applications tothe Cloud, 3rd Edition M oving A pplications to the C loud on M icrosoft W indows A zure ™ T hird E dition For more information explore: msdn.microsoft.com/practices Software Architecture and Software Development patterns & practices Proven practices for predictable results Save time and reduce risk on your software development projects by incorporating patterns & practices, Microsoft’s applied engineering guidance that includes both production quality source code and documentation. The guidance is designed to help software development teams: Make critical design and technology selection decisions by highlighting the appropriate solution architectures, technologies, and Microsoft products for common scenarios Understand the most important concepts needed for success by explaining the relevant patterns and prescribing the important practices Get started with a proven code base by providing thoroughly tested software and source that embodies Microsoft’s recommendations The patterns & practices team consists of experienced architects, developers, writers, and testers. We work openly with the developer community and industry experts, on every project, to ensure that some of the best minds in the industry have contributed to and reviewed the guidance as it is being developed. We also love our role as the bridge between the real world needs of our customers and the wide range of products and technologies that Microsoft provides. How do you build and deploy applications to be scalable and have high availability? Along with developing the applications, you must also have an infrastructure that can support them. You may need to scale up or add servers, have redundant hardware, and add logic to the application to handle distributed computing and failovers—even if an application is in high demand for only short periods of time. The cloud offers a solution. It is made up of interconnected servers located in various data centers, but you see what appears to be a centralized location that someone else hosts and manages. By removing the responsibility for maintaining an infrastructure, you’re free to concentrate on what matters most: the application. This guide is the third edition of the first volume in a series about Windows Azure. It demonstrates how you can adapt an existing on-premises ASP .NET application to one that operates in the cloud by introducing a fictitious company named Adatum that modifies its expense tracking and reimbursement system, aExpense, so that it can be deployed to Windows Azure. Mo v i n g Ap p l i c at i o n s to t h e Clo u d Dominic Betts Alex Homer Alejandro Jezierski Masashi Narumoto Hanz Zhang To illustrate the wide range of options and features in Windows Azure, this guide and the code examples available for it show a step-by-step migration process that includes using Windows Azure Web Sites, Virtual Machines, Cloud Services, and SQL Database. Together with useful information on developing, deploying, managing, and costing cloud-hosted applications, this guide provides you with a comprehensive resource for moving your applications to Window Azure. Moving to Windows Azure Cloud Services PaaS, deployment management, monitoring Executing Background Tasks Asynchronous processing, blobs, shared access signatures The Adatum Scenario Motivation, constraints, goals Getting to the Cloud IaaS, Virtual Machines, Hosted SQL Server Moving to Windows Azure SQL Database PaaS for data, deployment, management Moving to Windows Azure Table Storage Data access, transactions, fine tuning Evaluating Cloud Hosting Costs Pricing and cost considerations Third Edition on Microsoft Windows Azure™
  • 7.
    Moving Applications to theCloud 3rd Edition Dominic Betts Alex Homer Alejandro Jezierski Masashi Narumoto Hanz Zhang
  • 8.
    978-1-62114-021-4 This document isprovided "as-is." Information and views expressed in this document, including URL and other Internet website references, may change without notice. You bear the risk of using it. Some examples depicted herein are provided for illustration only and are fictitious. No real association or connection is intended or should be inferred. © 2012 Microsoft. All rights reserved. Microsoft, Active Directory, MSDN, SQL Server, Visual C#, Visual C++, Visual Basic, Visual Studio, Windows, Windows Azure, Windows Azure SQL Database, Windows Live, Windows PowerShell, Windows Server, and Windows Vista are trademarks of the Microsoft group of companies. All other trademarks are the property of their respective owners.
  • 9.
    Contents Foreword – YousefKhalidi xi Foreword for the Third Edition xi Who This Book Is For xiii Preface xiii Why This Book Is Pertinent Now xiv How This Book Is Structured xiv What You Need to Use the Code xv Who’s Who xvi Acknowledgments xvii Acknowledgements of Contributors to the Third Edition xix 1 The Adatum Scenario 1 The Adatum Company 1 Adatum’s Challenges 2 Adatum’s Goals and Concerns 2 Adatum’s Strategy 3 The aExpense Application 3 The aExpense Architecture 4 Evaluating Cloud Hosting Opportunities 5 Evaluating the Runtime Platform 6 Infrastructure as a Service 6 Platform as a Service 7 Software as a Service 7 Evaluating Data Storage Facilities 8 Evaluating Security, Monitoring, and Management Capabilities 8 Evaluating Service Level Agreements 9 Evaluating Additional Opportunities 10 Adatum’s Migration Path for the aExpense Application 10 Choosing Your Own Migration Path 12 More Information 13 v
  • 10.
    vi 2 Getting tothe Cloud 15 The Premise 16 Goals and Requirements 17 Overview of the Solution 18 Options for Hosting the Application 18 Affinity Groups 19 Availability Sets 20 Options for Hosting the Data 20 Connectivity for Authentication 22 Session Support and Load Balancing 23 Integrating with On-Premises Services 24 Inside the Implementation 25 Profile Data 25 Connecting to the Hosted SQL Server 26 Database Connection Timeouts and Dropped Connections 27 Deploying the aExpense Application to Windows Azure Virtual Machines 28 Deploying the Web Application 28 Deploying the Database 29 Testing, Deployment, Management, and Monitoring 30 Testing Applications for Virtual Machine Deployment 31 Test and Production Environments 31 Management and Monitoring 33 Storing and Backing Up Virtual Machines 34 Managing Virtual Machine Instances 34 Elasticity and Scaling 35 Isolating Active Directory 35 More Information 37 3 Moving to Windows Azure Cloud Services 39 The Premise 39 Goals and Requirements 39 Overview of the Solution 41 Evaluating the PaaS Approach for Hosting the Application 41 Options for Hosting the Application 42 Choosing Between Web Sites and Cloud Services 43 Service Instances, Fault Domains, and Update Domains 45 Options for Authentication and Access Control 46 Profile Management 48 Session Data Management 48 Storing Session State Data in a Database 49 Storing Session State Data in Windows Azure Storage 49 Storing Session State Data in a Windows Azure Cache 49 Data Storage 50
  • 11.
    vii Application Configuration 51 ApplicationStartup Processes 52 Copying Configuration Values in a Startup Task 53 Solution Summary 54 Inside the Implementation 55 Creating a Web Role 55 Reading Configuration Information 57 Using the Windows Azure CloudConfigurationManager Class 58 Implementing Claims-based Authentication 59 Managing User Data 62 Managing Session Data 63 Testing, Deployment, Management, and Monitoring 64 Testing Cloud Services Applications 64 Cloud Services Staging and Production Areas 65 Separate Test and Live Subscriptions 66 Managing Windows Azure Services 68 Setup and Deployment 68 Managing Different Local, Test, and Live Configurations 68 Preparing for Deployment to Windows Azure 72 Deploying to Cloud Services in Windows Azure 72 Continuous Delivery 79 Using a Mock Issuer 80 Converting to a Production Issuer 80 Accessing Diagnostics Log Files 81 More Information 84 4 Moving to Windows Azure SQL Database 85 The Premise 85 Goals and Requirements 85 Overview of the Solution 86 PaaS Options for Data Storage 86 Comparing SQL Server and Windows Azure SQL Database 87 Limitations of Windows Azure SQL Database 88 Database Management and Data Backup 89 Database Connection Reliability 90 Implementing Retry Logic for Database Connections 91 Inside the Implementation 92 Connecting to Windows Azure SQL Database 92 Handling Transient Connection Failures 93 Setup, Deployment, Management, and Monitoring 95 Data for Development and Testing 95 Data Migration 96 Data Management 96 Database Monitoring 97 More Information 97
  • 12.
    viii 5 Executing BackgroundTasks 99 The Premise 99 Goals and Requirements 99 Overview of the Solution 100 Storing Receipt Images 100 Background Processing 101 Detecting an New Uploaded Image 102 Using Windows Azure Storage Queues 103 Handling Transient Faults when Accessing Windows Azure Storage 104 Controlling Access to Receipt Images 105 Inside the Implementation 107 Uploading and Saving Images 107 Abstracting the Worker Role 108 User Code in the aExpense Application 110 The Plumbing Code Classes 113 Processing the Images 120 Making the Images Available Using Shared Access Signatures 121 More Information 122 6 Evaluating Cloud Hosting Costs 123 The Premise 123 Goals and Requirements 123 Detailed Costing Estimates 124 Bandwidth Cost Estimate for aExpense 127 Compute Estimate for aExpense 127 Receipt Image Storage Estimate for aExpense 127 Windows Azure SQL Database Storage Requirements Estimate 128 Total Cost Approximation 128 Variations 128 Costing the IaaS Hosting Approach 128 Combined IaaS and PaaS Approach 130 Costing for Peak and Reduced Demand 131 Costing for Windows Azure Table Storage 132 More Information 132
  • 13.
    ix 7 Moving toWindows Azure Table Storage 133 The Premise 133 Goals and Requirements 133 Overview of the Solution 135 Why Use Windows Azure Table Storage? 135 Profile Data 136 The Data Export Process 137 Initiating the Export Process 137 Generating the Export Data 138 Exporting the Report Data 139 Inside the Implementation 141 Storing Business Expense Data in Windows Azure Table Storage 141 How Many Tables? 142 Partition Keys and Row Keys 145 Defining the Schemas 149 Retrieving Records from a Multi-Entity Schema Table 151 Materializing Entities 153 Query Performance 154 Working with Development Storage 155 Storing Profile Data 157 Generating and Exporting the Expense Data 158 Generating the Expense Report Table 158 Exporting the Expenses Data 161 Performance Testing, Tuning, To-Do Items 166 Initializing the Storage Tables, Blobs, and Queues 166 Implementing Paging with Windows Azure Table Storage 167 Preventing Users from Uploading Large Images 172 Validating User Input 172 System.Net Configuration Changes 172 WCF Data Service Optimizations 173 More Information 174 Glossary 175 Index 179
  • 15.
    xi Foreword – YousefKhalidi Microsoft’s Windows Azure platform, an operating environment for developing, hosting, and manag- ing cloud-based services, established a foundation that allows customers to easily move their applica- tions from on-premises locations to the cloud. With Windows Azure, customers benefit from in- creased agility, a very scalable platform, and reduced costs. Microsoft’s cloud strategy has three broad tenets: to offer flexibility of choice for deploying services based on business needs; to provide enterprise-level services with no compromises on availability, reliability, or security; and to support consistent, connected experiences across devices and platforms. Windows Azure is a key component of Microsoft’s cloud strategy. Windows Azure builds on Microsoft’s many years of experience running online services for millions of users, and on our long history of building platforms for developers. We focused on making the transition from on-premises to the cloud easy for both programmers and IT professionals. Their exist- ing skills and experience are exactly what they need to start using the Windows Azure platform. Microsoft is committed to Windows Azure, and will continue to expand it as we learn how all our customers around the globe, from the largest enterprises to the smallest ISVs, use it. One of the ad- vantages of an online platform is that it allows us to introduce innovations quickly. I’m excited to introduce this guide from the Microsoft patterns & practices team, proof of our com- mitment to help customers be successful with the Windows Azure platform. Whether you’re new to Windows Azure, or if you’re already using it, you’ll find guide a great source of things to consider. I encourage you to get started exploring Microsoft’s public cloud and to stay tuned for further guidance from the patterns & practices team. Foreword for the Third Edition Since its first beginnings, and since I reviewed the original edition of this guide from the patterns & practices team, Windows Azure has continued to mature by offering exciting new services and capa- bilities. Now that we have achieved general release, with a comprehensive SLA, we have seen a huge uptake of the platform across all sectors of our industry. In my original foreword I talked about our commitment to the enterprise. We have proved not only that we can deliver on these commitments, but go beyond them to offer even more innovative fea- tures; including many that make migration of existing on-premises applications to the cloud much easier. The business case for Windows Azure continues to prove itself, and there is even more to come! Sincerely, Yousef Khalidi Distinguished Engineer, Windows Azure
  • 17.
    xiii Preface How can acompany’s applications be scalable and have high availability? To achieve this, along with developing the applications, you must also have an infrastructure that can support them. For example, you may need to add servers or increase the capacities of existing ones, have redundant hardware, add logic to the application to handle distributed computing, and add mechanisms to handle failover. You have to do this even if an application is in high demand for only short periods of time. Life becomes even more complicated (and expensive) when you start to consider issues such as network latency and security boundaries. The cloud offers a solution to this dilemma. The cloud is made up of interconnected servers located in various data centers. However, you see what appears to be a centralized location that someone else hosts and manages. By shifting the responsibility of maintaining an infrastructure to someone else, you’re free to concentrate on what matters most: the application. If the cloud has data centers in different geographical areas, you can move your content closer to the people who are using it most. If an application is heavily used in Asia, have an instance running in a data center located there. This kind of flexibility may not be available to you if you have to own all the hardware. Another advantage to the cloud is that it’s a “pay as you go” proposition. If you don’t need it, you don’t have to pay for it. When demand is high, you can scale up, and when demand is low, you can scale back. Yes, by moving applications to the cloud, you’re giving up some control and autonomy, but you’re also going to benefit from reduced costs, increased flexibility, and scalable computation and storage. This guide shows you how to do this. Who This Book Is For This book is the first volume in a series about Windows Azure. It demonstrates how you can adapt an existing, on-premises ASP.NET application to one that operates in the cloud. The book is intended for any architect, developer, or information technology (IT) professional who designs, builds, or operates applications and services that are appropriate for the cloud. Although applications do not need to be based on the Microsoft Windows operating system to work in Windows Azure or written using a .NET language, this book is written for people who work with Windows-based systems. You should be familiar with the Microsoft .NET Framework, Microsoft Visual Studio, ASP.NET, and Microsoft Visual C#.
  • 18.
    xiv Why This BookIs Pertinent Now In general, the cloud has become a viable option for making your applications accessible to a broad set of customers. In particular, Windows Azure now has in place a complete set of tools for developers and IT professionals. Developers can use the tools they already know, such as Visual Studio, to write their applications. In addition, the Windows Azure SDK includes the compute emulator and the stor- age emulator. Developers can use these to write, test, and debug their applications locally before they deploy them to the cloud. There are also tools and an API to manage your Windows Azure accounts. This book shows you how to use all these tools in the context of a common scenario—how to adapt an existing ASP.NET application and deploy it to Windows Azure. Moving to Windows Azure Cloud Services PaaS, deployment management, monitoring Executing Background Tasks Asynchronous processing, blobs, shared access signatures The Adatum Scenario Motivation, constraints, goals Getting to the Cloud IaaS, Virtual Machines, Hosted SQL Server Moving to Windows Azure SQL Database PaaS for data, deployment, management Moving to Windows Azure Table Storage Data access, transactions, fine tuning Evaluating Cloud Hosting Costs Pricing and cost considerations How This Book Is Structured Chapter 1, “The Adatum Scenario” introduces you to the Adatum company and the aExpense applica- tion. The following chapters describe how Adatum migrates the aExpense application to the cloud. Reading this chapter will help you understand why Adatum wants to migrate some of its business applications to the cloud, and it describes some of its concerns. It will also help you to understand basic options for hosting applications and services in the cloud. Chapter 2, “Getting to the Cloud” describes the first steps that Adatum took in migrating the aExpense application. Adatum’s goal here is simply to get the application working in the cloud, but this includes “big” issues such as security and storage. The chapter shows how Adatum used Windows Azure virtual machines and network services to deploy and communicate with the hosted servers.
  • 19.
    xv preface Chapter 3, “Movingto Windows Azure Cloud Services” describes how Adatum adapted the aExpense application to run as a hosted service in Windows Azure by using the Cloud Services feature. The chapter describes how Adatum modified the solution, converted it to use claims authentication in- stead of Active Directory, and took advantage of Windows Azure Caching for the session data. Chapter 4, “Moving to Windows Azure SQL Database” describes how Adatum evaluated the use of Windows Azure SQL Database instead of a hosted SQL Server by exploring the limitations this might impose and the cost savings that it might provide. The chapter then goes in to show how Adatum converted the aExpense application to use Windows Azure SQL Database. Chapter 5, “Executing Background Tasks” describes adding a worker role to the aExpense applica- tion to process scanned receipt images as a background task. It also shows how aExpense uses Windows Azure blob storage for storing these images, and shared access signatures to provide se- cure access to them. Chapter 6, “Evaluating Cloud Hosting Costs” introduces a basic cost model for the aExpense applica- tion running on Windows Azure and shows how Adatum calculated the estimated annual running costs for the application. Chapter 7, “Moving to Windows Azure Table Storage” describes how Adatum switched from using a SQL database to using Windows Azure table storage in the aExpense application. It discusses the differences between the two storage models, and shows how Adatum adapted the data access code to work with Windows Azure table storage. This chapter also discusses how Adatum fine- tuned the application after deployment, and the options it is considering for improving the applica- tion in the future. What You Need to Use the Code These are the system requirements for running the scenarios: • Microsoft Windows 7 with Service Pack 1, Microsoft Windows 8, Microsoft Windows Server 2008 R2 with Service Pack 1, or Microsoft Windows Server 2012 (32 bit or 64 bit editions). • Microsoft .NET Framework version 4.0. • Microsoft Visual Studio 2010 Ultimate, Premium, or Professional edition with Service Pack 1 installed, or Visual Studio 2012 Ultimate, Premium, or Professional edition. • Windows Azure SDK for .NET (includes the Windows Azure Tools for Visual Studio). See the Release Notes for information on the specific version required. • Microsoft SQL Server 2012, SQL Server Express 2012, SQL Server 2008, or SQL Server Express 2008. See the Release Notes for information on specific versions depending on your operating system. • Windows Identity Foundation. This is required for claims-based authorization. • WatiN 2.0. Open the Properties dialog and unblock the zip file after you download it and before you extract the contents. Place the contents in the LibWatin folder of the examples. Other components and frameworks required by the examples are installed using NuGet when you run the solutions. See the Release Notes included with the examples for instructions on installing and configuring them.
  • 20.
    xvi Who’s Who As mentionedearlier, this book uses a set of scenarios that demonstrates how to move applications to the cloud. A panel of experts comments on the development efforts. The panel includes a cloud spe- cialist, a software architect, a software developer, and an IT professional. The scenarios can be consid- ered from each of these points of view. The following table lists the experts for these scenarios. Bharath is a cloud specialist. He checks that a cloud-based solution will work for a company and provide tangible benefits. He is a cautious person, for good reasons. “Moving a single application to the cloud is easy. Realizing the benefits that a cloud-based solution can offer is not always so straight-forward”. Jana is a software architect. She plans the overall structure of an application. Her perspective is both practical and strategic. In other words, she considers not only what technical approaches are needed today, but also what direction a company needs to consider for the future. Markus is a senior software developer. He is analytical, detail-oriented, and methodical. He’s focused on the task at hand, which is building a great cloud- based application. He knows that he’s the person who’s ultimately responsible for the code. “I don’t care what platform you want to use for the application, I’ll make it work.” Poe is an IT professional who’s an expert in deploying and running in a corporate data center. Poe has a keen interest in practical solutions; after all, he’s the one who gets paged at 3:00 AM when there’s a problem. “It’s not easy to balance the needs of the company, the users, the IT organization, the developers, and the technical platforms we rely on. If you have a particular area of interest, look for notes provided by the specialists whose interests align with yours. “Migrating to the cloud involves a big change in the way we manage our applications. I want to make sure our cloud apps are as reliable and secure as our on-premise apps.”
  • 21.
    xvii Acknowledgments On March 4th2010 I saw an email from our CEO, Steve Ballmer, in my inbox. I don’t normally receive much email from him, so I gave it my full attention. The subject line of the email was: “We are all in,” and it summarized the commitment of Microsoft to cloud computing. If I needed another confirma- tion of what I already knew, that Microsoft is serious about the cloud, there it was. My first contact with what eventually became Windows Azure was about three years ago. I was in the Developer & Platform Evangelism (DPE) team, and my job was to explore the world of software de- livered as a service. Some of you might even remember a very early mockup I developed in late 2007, called Northwind Hosting. It demonstrated many of the capabilities that the Windows Azure platform offers today. (Watching an initiative I’ve been involved with since the early days become a reality makes me very, very happy.) In February 2009, I left DPE and joined the patterns & practices team. My mission was to lead the “cloud program”: a collection of projects that examined the design challenges of building applications for the cloud. When the Windows Azure platform was announced, demand for guidance about it skyrocketed. As we examined different application development scenarios, it became quite clear that identity man- agement is something you must get right before you can consider anything else. It’s especially impor- tant if you are a company with a large portfolio of on-premises investments, and you want to move some of those assets to the cloud. This describes many of our customers. Therefore, patterns & practices’s first deliverable, and an important milestone in our cloud program, was A Guide to Claims- Based identity and Access Control. The Windows Azure platform is special in many ways. One is the rate of innovation. The various teams that deliver all of the platform’s systems proved that they could rapidly ship new functionality. To keep up with them, I felt we had to develop content very quickly. We decided to run our projects in two- months sprints, each one focused on a specific set of considerations. This guide, now fully updated to cover the new capabilities of Windows Azure, mainly covers a migra- tion scenario: how to move an existing application to the Windows Azure platform. As in the claims guide, we’ve developed a fictitious case study that explains, step by step, the challenges our customers are likely to encounter.
  • 22.
    xviii I want tostart by thanking the following subject matter experts and contributors to this guide: Dominic Betts, Scott Densmore, Ryan Dunn, Steve Marx, and Matias Woloski. Dominic has the un- usual skill of knowing a subject in great detail and of finding a way to explain it to the rest of us that is precise, complete, and yet simple to understand. Scott brought us a wealth of knowledge about how to build scalable Windows Azure applications, which is what he did before he joined my team. He also brings years of experience about how to build frameworks and tools for developers. I’ve had the privi- lege of working with Ryan in previous projects, and I’ve always benefited from his acuity, insights, and experience. As a Windows Azure evangelist, he’s been able to show us what customers with very real requirements need. Steve is a technical strategist for Windows Azure. He’s been instrumental in shap- ing this guide. We rely on him to show us not just what the platform can do today but how it will evolve. This is important because we want to provide guidance today that is aligned with longer-term goals. Last but not least, Matias is a veteran of many projects with me. He’s been involved with Windows Azure since the very first day, and his efforts have been invaluable in creating this guide. As it happens with all our written content, we have sample code for most of the chapters. They demonstrate what we talk about in the guide. Many thanks to the project’s development and test teams for providing a good balance of technically sound, focused and simple-to-understand code: Masashi Narumoto (Microsoft Corporation), Scott Densmore (Microsoft Corporation), Federico Boerr (Southworks), Adrián Menegatti (Southworks), Hanz Zhang (Microsoft Corporation), Ravindra Mahendravarman (Infosys Ltd.), Rathi Velusamy (Infosys Ltd.). Our guides must not only be technically accurate but also entertaining and interesting to read. This is no simple task, and I want to thank Dominic Betts, RoAnn Corbisier (Microsoft Corporation), Alex Homer (Microsoft Corporation), and Tina Burden from the writing and editing team for excelling at this. The visual design concept used for this guide was originally developed by Roberta Leibovitz and Colin Campbell (Modeled Computation LLC) for A Guide to Claims-Based Identity and Access Control. Based on the excellent responses we received, we decided to reuse it for this book. The book design was created by John Hubbard (eson). The cartoon faces were drawn by the award-winning Seattle- based cartoonist Ellen Forney. The technical illustrations were adapted from my Tablet PC mockups by Chris Burns. All of our guides are reviewed, commented upon, scrutinized, and criticized by a large number of customers, partners, and colleagues. We also received feedback from the larger community through our CodePlex website. The Windows Azure platform is broad and spans many disciplines. We were very fortunate to have the intellectual power of a very diverse and skillful group of readers available to us. I also want to thank all of these people who volunteered their time and expertise on our early content and drafts. Among those, we want to highlight the exceptional contributions of Jorge Rowies (South- works), Marcos Castany (Southworks), Federico Boerr (Southworks), Corey Sanders (Microsoft Corporation), Nir Mashkowski (Microsoft Corporation), Ganesh Srinivasan (Microsoft Corporation), Jane Sinyagina (Microsoft Corporation), Rick Byham (Microsoft Corporation), Boris Scholl (Microsoft Corporation), and Paul Yuknewicz (Microsoft Corporation). I hope you find this guide useful! Eugenio Pace Senior Program Manager – patterns & practices Microsoft Corporation
  • 23.
    xix Acknowledgements of Contributorsto the Third Edition Windows Azure is an evolving platform. We originally published the first edition of this guide in 2010, demonstrating a basic set of Windows Azure features. I’m now pleased to release the third edition of this guide, which incorporates the latest and greatest features of Windows Azure such as Virtual Machines, Web Sites, Caching, and more. By taking advantage of these new features, you have a lot more options to choose from when migrating your own applications from on-premises to the cloud. As our scope increased, we also added new community members and industry experts who have provided significant help throughout the development of this edition. I want to acknowledge the exceptional contributions of the following people: Dominic Betts (Content Master), Alex Homer (Microsoft Corporation), Alejandro Jezierski (Southworks), Mauro Krikorian (Southworks), Jorge Rowies (Southworks), Marcos Castany (Southworks ), Hanz Zhang (Microsoft Corporation), Rathi Velusamy, RoAnn Corbisier (Microsoft Corporation), Nelly Delgado (Microsoft Corporation), Eugenio Pace (Microsoft Corporation), Carlos Farre (Microsoft Corporation), Trent Swanson (Full Scale 180 Inc.), Ercenk Keresteci (Full Scale 180 Inc.), Federico Boerr, Corey Sanders (Microsoft Corporation), Nir Mashkowski (Microsoft Corporation), Ganesh Srinivasan (Microsoft Corporation), Jane Sinyagina (Microsoft Corporation), Rick Byham (Microsoft Corporation), Boris Scholl (Microsoft Corporation), and Paul Yuknewicz (Microsoft Corporation). I also want to thank everyone who participated in our CodePlex community site. Masashi Narumoto Senior Program Manager – patterns & practices Microsoft Corporation September 2012
  • 25.
    1 1 This chapter introducesa fictitious company named Adatum. It de- scribes Adatum’s current infrastructure, its software portfolio, and why Adatum wants to move some of its applications to Windows Azure. As with any company considering this process, there are many issues to take into account and challenges to be met, particularly be- cause Adatum has not used the cloud before. At the end of this chap- ter you will see how Adatum explored and evaluated the major re- quirements for moving its applications to the cloud, and an overview of the migration steps that Adatum followed. The chapters that follow this one show in detail how Adatum modified its expense tracking and reimbursement system, aExpense, at each stage for deployment to Windows Azure. The Adatum Company Adatum is a manufacturing company of 15,000 employees that mostly uses Microsoft technologies and tools. It also has some legacy systems built on other platforms, such as AS400 and UNIX. As you would expect, Adatum developers are knowledgeable about various Microsoft products, including .NET Framework, ASP.NET, SQL Server, Windows Server, and Visual Studio. Employees in Adatum’s IT depart- ment are proficient at tasks such as setting up and maintaining Active Directory and using System Center. Adatum uses many different applications. Some are externally facing, while others are used exclusively by its employees. The importance of these applications ranges from “peripheral” to “critical,” with many lying between the two extremes. A significant portion of Adatum’s IT budget is allocated to maintaining applications that are either of mid- level or peripheral importance. The Adatum Scenario Adatum uses mainly Microsoft products, and its developers are knowledgeable about most Microsoft technologies such as Windows, SQL Server, and the .NET Framework.
  • 26.
    2 chapter one Adatumwants to change this allocation. Its aim is to spend more money on the services that differ- entiate it from its competitors and less on those that don’t. Adatum’s competitive edge results from assets, such as its efficient supply chain and excellent quality controls, and not from how effectively it handles its internal email. For example, Adatum wants efficient email but is looking for more eco- nomical ways to provide this so that it can spend most of its budget on the systems that directly affect its customers. Adatum believes that one way to achieve this optimization is to selectively deploy ap- plications to the cloud. Adatum’s Challenges Adatum faces several challenges. Currently, deploying new on-premises applications takes too long, considering how quickly its business changes and how efficient its competitors are. The timeframe for acquiring, provisioning, and deploying even a simple application can be at least several weeks. No matter the application’s complexity, requirements must be analyzed, procurement processes must be initiated, requests for proposals may need to be sent to vendors, networks must be configured, and so on. Adatum must be able to respond to its customers’ demands more rapidly than the current procedures allow. Another issue is that much of Adatum’s infrastructure is used inefficiently. The majority of its servers are underutilized, and it’s difficult to deploy new applications with the requisite service-level agree- ments (SLAs) to the existing hardware. Virtual machines are appropriate in some cases, but they are not appropriate in all cases. This inefficiency means that Adatum’s capital is committed to an under- utilized infrastructure when it could be better used elsewhere in the business. A final issue is that less critical applications typically get less attention from the IT staff. It is only when the application fails or cannot keep up with demand that anyone takes notice. By this time, the problem is expensive to fix, both in terms of IT time and in inefficient use of the users’ time. Adatum wants to focus on the applications, and not on the infrastructure. Adatum believes that by deploying some of its applications to a public cloud such as Windows Azure it can take advantage of economies of scale, promote standardization of its applications, and have automated processes for managing them. Most importantly, Adatum believes that this will make it more effective at addressing its customers’ needs, a more effective competitor in the market, and a better investment for its shareholders. Adatum’s Goals and Concerns One of Adatum’s goals is to improve the experience of all users of its applications. At a minimum, applications in the cloud should perform as well as their on-premises counterparts. The hope, though, is that they will perform better. Many of its applications are used more at some times than at others. For example, employees use the salary tool once every two weeks but rarely at other times. They would benefit if the applications had increased responsiveness during peak periods. This sensitivity to demand is known as dynamic scalability.
  • 27.
    3 The Adatum Scenario However,on-premises applications that are associated with specific servers don’t provide this flexibility. Adatum can’t afford to run as many servers as are needed during peak times because this hardware is dormant the rest of the time. If these applications were located in the cloud, it would be easy to scale them depending on the demand. Another goal is to expand the ways that users can access Adatum’s applications. Currently, applications are only accessible from the in- tranet. Applications that are located in the public cloud are, by defini- tion, available over the Internet. However, the public cloud also raises questions about authentication. Many of Adatum’s applications use Windows authentication so that users aren’t required to enter appli- cation-specific credentials. Adatum is concerned that its users would need special credentials for each application in the public cloud. A third goal is that at least some of Adatum’s applications should be portable. Portability means that the application can be moved back and forth between a hosted data center and an on-premises data center without any modifications to the application’s code or its op- erations. If both options are available, the risks that Adatum incurs if it does use the cloud are reduced. In addition to its concerns about security, Adatum has two other is- sues. First, it would like to avoid a massive retraining program for its IT staff. Second, very few of Adatum’s applications are truly isolated from other systems. Most have various dependencies. Adatum has put a great of deal effort into integrating its systems, even if not all of them operate on the same platform. It is unsure how these dependen- cies affect operations if some systems are moved to the public cloud. Adatum’s Strategy Adatum is an innovative company and open to new technologies, but it takes carefully considered steps when it implements them. Adatum’s plan is to evaluate the viability of moving to the cloud by starting with some of its simpler applications. It hopes to gain some initial experi- ence, and then expand on what it has learned. This strategy can be described as “try, learn, fail fast, and then optimize.” Adatum has de- cided to start with its aExpense application. The aExpense Application The aExpense application allows Adatum’s employees to submit, track, and process business expenses. Everyone in Adatum uses this application to request reimbursements. Although aExpense is not a critical application, it is important. Employees can tolerate occasional hours of downtime, but prolonged unavailability isn’t acceptable. While Adatum intends that the aExpense application will perform at least as well in the cloud as it does running in its own data center, the aim is to take advantage of the inherent scalability and reliability of cloud hosting to achieve better overall performance and availability than the current on-premises deployment.
  • 28.
    4 chapter one Adatum’spolicy is that employees must submit their expenses before the end of each month. The majority of employees don’t submit their expenses until the last two business days. This causes rela- tively high demands during a short time period. The infrastructure that supports the aExpense applica- tion is scaled for average use across the month instead of for this peak demand. As a result, when the majority of employees try to submit their expenses during the last two business days, the system is slow and the employees complain. The application is deployed in Adatum’s data center and is available to users on the intranet. While traveling, employees access it through a VPN. There have been requests for publishing aExpense di- rectly to the Internet, but it’s never happened. The application stores a great deal of information because most expense receipts must be scanned and then stored for seven years. For this reason, the data stores used by aExpense are frequently backed up. The application is representative of many other applications in Adatum’s portfolio so it’s a good test case for using the cloud. Moving the aExpense application to Windows Azure will expose many of the challenges Adatum is likely to encounter as it expands the number of applications that it relocates to the cloud. The aExpense Architecture Figure 1 illustrates the aExpense architecture. Browser Web site User profile Active Directory Windows event log SQL Server File share Integration service Input file Output file Payment system Scans service Database LDAP query Figure 1 aExpense architecture
  • 29.
    5 The Adatum Scenario Thearchitecture is straightforward and one that many other applica- tions use. aExpense is an ASP.NET application and employees use a browser to interact with it. The application uses Windows authenti- cation for security. To store user preferences, it relies on ASP.NET membership and profile providers. Exceptions and logs are imple- mented with Enterprise Library’s Exception Handling Application Block and Logging Application Block. The website uses Directory Services APIs to query for employee data stored in Active Directory, such as the employee’s manager. The manager is the person who can approve the expenses. The aExpense application implements the trusted subsystem to con- nect to SQL Server. It authenticates with a Windows domain ac- count. The SQL database uses SQL Server authentication mode. The aExpense application stores its information on SQL Server. Scans of receipts are stored on a file share. There are two background services, both implemented as Windows services. One periodically runs and generates thumbprints of the scanned receipts. It also compresses large images for increased storage efficiency. The other background service periodically queries the da- tabase for expenses that need to be reimbursed. It then generates a flat file that the payment system can process. This service also imports the payment results and sends them back to aExpense after the pay- ments are made. Evaluating Cloud Hosting Opportunities Before initiating a full technical case study for migration of the aExpense application to Windows Azure, the designers and devel- opers at Adatum evaluated the capabilities offered by cloud hosting partner solutions such as Microsoft’s Windows Azure. For example, they needed to: • Identify which type of service offered by the hosting providers best suits Adatum’s requirements. • Determine whether a cloud solution can provide the necessary secure and reliable runtime platform and storage facilities. • Identify how Adatum can monitor and manage the application • Determine whether the service level agreements (SLAs) are sufficient to meet Adatum’s business requirements. Adatum’s aExpense application uses a standard website architecture based on ASP.NET with data stored in SQL Server. However, it does integrate with other in-house systems.
  • 30.
    6 chapter one Evaluatingthe Runtime Platform Currently, Adatum runs the aExpense application on its own in-house IT infrastructure. The servers, networks, internal and external con- nectivity, and associated systems such as power supply and cooling are all the responsibility of Adatum. Together they provide the underlying mechanisms for running applications such as aExpense. As part of the initial evaluation, Adatum investigated the ways that it could move the aExpense application to an external hosting partner. Infrastructure as a Service Adatum first considered whether it could simply move the application to an external partner by renting the required infrastructure, complete with all of the associated systems, and run the application unchanged. Renting infrastructure from an external partner is known as Infrastruc- ture as a Service (IaaS). Adatum would be responsible for providing and installing the operating system and software, and maintaining it (such as installing operating system and services updates, and upgrading to new versions). The partner company would provide the hardware (the server) and the associated infrastructure and connectivity. Cloud providers can typically offer very high levels of infrastructure reliability and availability that are beyond the capabilities of many or- ganizations’ own datacenters. For example, most incorporate robust disaster recovery processes, and offer the ability to deploy in more than one geographical location. Adopting an IaaS approach will provide some cost saving through a reduction in overall requirements for in-house infrastructure, but it is not easy (or, in some cases, possible) to quantify the in-house cost of running a specific application. In Adatum’s case, the cost of the on- premises infrastructure is effectively shared between all the applica- tions Adatum uses. In addition, while this approach is attractive, Adatum must take into account the cost of management and maintenance required to keep the hosted operating system running correctly, and the costs of oper- ating system licenses. However, IaaS is generally less expensive than other ways of hosting applications at remote locations. It can also reduce development cost because applications do not need to be refactored to run in specific types of cloud service roles. Infrastructure now becomes a running cost rather than a capital in- vestment. IaaS allows you to effectively pick up your server and move it to the cloud with minimal changes required to the application. It is especially useful if you need to deploy on servers that have non- standard configuration, where applications require additional operating system services, or for applications cannot be refactored into a structure suitable for Platform as a Service (PaaS) deployment.
  • 31.
    7 The Adatum Scenario Platformas a Service Secondly, Adatum considered adapting the aExpense application to run as a hosted application on a platform and operating system pro- vided by an external partner. As the application currently runs on Windows Server and uses the .NET Framework, the external partner would need to offer this platform to avoid the costs of porting the application to a different operating system. Renting a ready-to-use platform from an external partner is known as Platform as a Service (PaaS). Adatum would be responsible only for providing and installing its aExpense application, and maintaining it (such as fixing bugs and upgrading to a new version). The partner com- pany would provide the operating system pre-installed on appropriate hardware, with the associated infrastructure and connectivity. The PaaS approach is attractive to Adatum because it reduces the cost of management and maintenance (the partner is responsible for keeping the operating system running correctly and applying up- dates), and there is no requirement to pay for operating system li- censes. In some cases PaaS hosting charges may be higher than for IaaS, though this is not necessarily the case; and the cost savings in licensing, management, and maintenance can often outweigh any difference. Adatum considered the amount of work involved in refac- toring the application to run in cloud-hosted roles and the corre- sponding development cost, and considered both to be acceptable. Software as a Service The third option Adatum considered was to abandon their own aExpense application and rent the use of an expenses application provided by another company. Renting use of third party applica- tions is an example of Software as a Service (SaaS). Many companies have applications specially designed to handle business expense collation and reporting tasks. However, Adatum must ensure that the third party application can fully meet its specific requirements; hosted third party applications must typically offer a more generic features set to satisfy a wide range of customers. As well as exploring the overall capabilities of the software, Adatum will need to evaluate its security, configurability, performance, and usability. Changing over may incur costs such as user education, as well as the cost of migrating data and users; and perhaps maintaining the old application for a period until changeover is complete. PaaS is particularly useful when applications can be refactored to run using the standard platform offered by cloud hosting providers. Responsibility for managing and updating the operating system and services is delegated to the hosting provider. Applications that use a multi-tier architecture, require administrative access through a virtual network mechanism, or require elevated permissions can be usually be hosted in the cloud using the PaaS model.
  • 32.
    8 chapter one EvaluatingData Storage Facilities Most business applications use data, and so before making any deci- sion about hosting the aExpense application externally Adatum needed to evaluate the data storage and retrieval facilities offered by external partners. On-premises and in-house applications typically use a relational database system based on Structured Query Lan- guage (SQL), and Adatum’s aExpense application is no exception. Therefore, the external partner must be able to offer the equivalent hosted capability. However, other storage formats are common. Some applications re- quire storage for disk files or for unstructured data. The aExpense application stores unstructured data in the form of receipt images on a file share, and it also generates disk files for use by other in-house systems. Therefore, the chosen cloud hosting mechanism must be able to provide support for storing unstructured data; this may be in a format other than disk files so long as the application can be easily adapted to use it. Between them, these mechanisms should be able to provide the data storage and retrieval features that Adatum requires; albeit with some changes to the application code to use the available storage models. By using an appropriate relational database system, or any other type of repository that can be installed on a hosted sever, Adatum can avoid changes to the application code. Evaluating Security, Monitoring, and Management Capabilities Moving applications to outside of the corporate network prompts several questions not directly related to the hosting platform mecha- nisms. Adatum must be convinced that the hosting providers’ network and infrastructure is secure, and that the hosted application will be protected from malicious attacks and from data exposure in case of systems failure. For example, the hosting network should be resilient to Denial of Service (DoS) and network flooding attacks, and the hosting platform should be able to reliably and safely reinitialize the application after a hardware failure. In addition, Adatum must evaluate whether hosting in a remote data- center will meet any legal or regulatory requirements, such as a limita- tion on the geographical location for data storage and processing. Many cloud hosting providers, including Windows Azure, have data- centers located around the world and allow users to specify the loca- tion of the servers and data storage facilities. Windows Azure allows users to specify whether storage replication for backup and resiliency will take place across multiple datacenters in order to satisfy regula- tory limitations. Most business applications rely on a relational database, even though it may be exposed through a custom repository or data access layer. However, many applications also have other storage requirements such as profile and session data, binary and formatted data streams, and disk files. The target hosting platform must either offer equivalent services, or it must be reasonably easy and cost-efficient to adapt the application to use available storage mechanisms.
  • 33.
    9 The Adatum Scenario Inaddition, Adatum must ensure that the chosen hosting provider and deployment mechanism allows administrators to monitor and manage the application and the data stores remotely. Windows Azure includes a range of capabilities that closely match the remote access capabilities for on-premises server, database, and application management. For example, it supports a range of logging facilities, remote desktop ac- cess to servers and hosted services, remote configuration, and manage- ment of applications and data stores through a web-based portal and APIs that supports REST calls and scripting. Finally, Adatum must consider if the remote applications must be in- tegrated with other services, both in the cloud and on-premises, to access data, communicate messages, and for monitoring and manage- ment. For example, Adatum uses Microsoft System Center Operation Manager for monitoring applications, and it should therefore be also to integrate the remote application and services with this. Addition- ally, Adatum relies on domain-level authentication through Active Directory and so it will be necessary to join the remote machines to the on-premises domain or adopt an alternative solution that provides equivalent functionality. Evaluating Service Level Agreements Adatum recognized that, although the aExpense application is used only by company employees, it must be readily available (in other words, only very rarely offline) and responsive to a reasonable degree. There is no formal SLA for the application, but it should of necessity be available to employees whenever they need to submit expense claims. Of course, for other types of applications, especially publicly visible or business-crucial applications, there will need to be a more formal SLA defined. SLAs should define not only availability of an application, but also maximum response times. In addition, where other services are re- quired (such as caching or access control), the SLAs should also cover these services. Finally, SLAs should include any information required to define security risks and to meet regulatory or legal requirements (such as the geographical location for data storage). Windows Azure provides formal SLAs for the IaaS, PaaS, and related services that it offers. However, these do not and cannot cover the customer’s hosted application, as this is outside of Microsoft’s control. Instead, the SLAs are defined in terms of connectivity and role execu- tion; for example, the SLA for Cloud Services guarantees that a role instance will expose full connectivity for 99.95% of the time and that failed role instances will be detected and restarted 99.9% of the time. You can find details of the Windows Azure Service Level Agreements for all of the services online.
  • 34.
    10 chapter one EvaluatingAdditional Opportunities In addition to the fundamental choices of the hosting model and the deployment approach, the designers and developers at Adatum con- sidered if they could benefit from using the many ancillary services and features available in Windows Azure. For example, they considered whether the application would benefit from the use of Windows Azure Caching to maximize performance when retrieving data; or for caching output, session state, and profile information. Other features that Adatum realized would be useful for the aExpense application included Windows Azure Active Directory for authentica- tion and the Content Delivery Network (CDN) for delivering images and other non-authenticated content. These features and Adatum’s decisions regarding their use are explained in more detail in the fol- lowing chapters of this guide. Adatum also considered whether the application needed to commu- nicate with the on-premises applications using messaging, or access services exposed by on-premises applications. Windows Azure Ser- vice Bus provides many features that would be useful in this scenario, but Adatum decided that these were not required for the current version of aExpense. To learn more about Windows Azure Service Bus see “Service Bus.” The guide “Building Hybrid Applications in the Cloud” describes the scenarios for and usage of Service Bus in detail. Adatum’s Migration Path for the aExpense Application Every company will inevitably make different decisions on the migra- tion path they adopt for moving to the cloud. The range of contribut- ing factors is vast, and each company will have specific goals and limi- tations that affect the final choices. Typically, companies will begin, as Adatum did, by understanding the concepts of cloud hosting; and then exploring the platforms, services, and options available from cloud hosting providers. From that comes the decision on which cloud provider to use, and the hosting approach that will best match all the requirements. For a full list of the features and services available in Windows Azure, see “Introducing Windows Azure.”
  • 35.
    11 The Adatum Scenario Thisguide shows how you can make the appropriate choices when using Windows Azure. However, to help you make those choices, this guide shows several of the hosting approaches. As you will see, the path that Adatum chose for migrating the aExpense application to the cloud included several stages. Adatum began by choosing the option that required the least modification to the aExpense application and then, at each subsequent stage, considered whether moving to another hosting ap- proach would provide additional benefits. While the multi-step approach Adatum chose for migrating their application may not be realistic in every real-world scenario, it allows the guide to demonstrate several options that are available for hosting applications in Windows Azure. The discussion of the advan- tages and limitations at each stage will help you to better understand the options avail- able to you when migrating your own applications. The migration steps that Adatum took for the aExpense application are shown in the following table. The table shows the chapter that discusses each step, a high-level overview of the options chosen, and the Windows Azure technologies that Adatum used. This will help you to follow the flow of the guide and explore the different approaches taken at each stage. Chapter Migration step Justification Technologies 2 – “Getting to the Cloud” Infrastructure as a Service (IaaS). Minimal code changes to the application and familiarity with the platform. A quick and easy way to explore the benefits of cloud hosting, such as increased reliability and reduced costs of managing the on-premises infrastructure. Windows Azure Virtual Machines, Virtual Networks, and Connect. 3 – “Moving to Windows Azure Cloud Services” Platform as a Service (PaaS). No operating system maintenance, easy scalability and elasticity, more granular control of resource usage, and the opportunity for auto scaling. Windows Azure Web Sites, Cloud Services web role, and Caching. Windows Identity Framework. 4 – “Moving to Windows Azure SQL Database” Platform as a Service (PaaS) for database Lower cost although some limitations on feature availability. No software maintenance. Windows Azure SQL Database. Transient Fault Handling Application Block. 5 – “Executing Background Tasks” Maximizing efficiency and adding additional tasks. Better scalability and performance, better user experience, improved efficiency, and load leveling across role instances. Windows Azure Cloud Services worker role, queues, and blob storage. 6 – “Evaluating Cloud Hosting Costs” Revisiting initial cost estimations. Confirm initial estimates of cost and look for additional savings. Windows Azure Pricing Calculator. 7 – “Moving to Windows Azure Table Storage” Switching away from relational database storage. Lower cost, greater storage volume, opportu- nity for increased performance, and scalability. Windows Azure table storage. Some of the technologies described in this guide and used in the examples are preview versions, and the subsequent release versions may differ from the information provided in this guide. This includes Windows Azure Web Sites, Windows Azure Virtual Machines, and Windows Azure Virtual Networks.
  • 36.
    12 chapter one ChoosingYour Own Migration Path Just because Adatum has chosen the path described in this chapter, it doesn’t mean that you must follow the same path. Some companies may decide which combination of hosting approach, data store, and services they will use and go directly to this in single migration step. Others may follow a more gradual migration by adopting, for example, Cloud Services as the hosting approach for the application code, but use SQL Server hosted in a Virtual Machine before moving to Windows Azure SQL Database. Meanwhile, some companies may choose the IaaS path so that they have full control over the operating system, but decide to take advantage of the cost savings and vast storage capa- bilities of Windows Azure table and blob storage instead of using a relational database. How much will I save? On-premises Table and Blob Storage Virtual Machines Hosted SQL Server PaaSville IaaS City Cloud Services & Web Sites Background Tasks Full Control of the operating system Few code changes but must maintain the operating system Refactor the code but avoid operating system maintenance All the capabilities of SQL Server Easy to use managed data service Simple scalability and multiple options Offload processing from the UI Cost efficient and hugely scalable Costing SQL Database Figure 2 Choosing your own migration path
  • 37.
    13 The Adatum Scenario Thisis one of the major advantages with Windows Azure – you choose which of the wide range of services it offers are most suitable for your own scenario and requirements. No two applications are the same. Throughout this guide you will see more details of the capabilities and limitations of each hosting option, and how to make the right choice for your applications. More Information All links in this book are accessible from the book’s online bibliography available at: http://msdn.microsoft.com/en-us/library/ff803373.aspx. Overview of Windows Azure features. For an overview of the data storage options available in Windows Azure, “Data Storage Offerings on the Windows Azure Platform.” Introducing Windows Azure includes a list of features. Windows Azure Service Level Agreements. “Windows Azure Websites, Cloud Services, and VMs: When to use which?” Windows Azure Service Bus. The guide “Developing Multi-tenant Applications for the Cloud” explores techniques for building new applications specifically designed for run in Windows Azure. The guide “Building Hybrid Applications in the Cloud” describes the scenarios for and usage of many Windows Azure features.
  • 39.
    15 2 Getting tothe Cloud This chapter describes the first step the developers at Adatum took on their migration path to the cloud. It discusses the contributing factors for the decision they made to use an IaaS approach for hosting the aExpense application in Windows Azure, and explores the process they followed to achieve this. The chapter also discusses issues related to application lifecycle management (ALM), specifically for scenarios that use an IaaS hosting approach. This first migration step is concerned only with getting the application to work in the cloud without losing any functionality. However, it does address some “big” issues such as security and data storage that are relevant to almost every cloud-based application. This chapter doesn’t explore how to improve the application by exploiting the extended set of fea- tures available in Windows Azure. In addition, the on-premises version of the application that you’ll see is not complete; for example, it does not support uploading receipt images or interaction with Adatum’s other on-premises systems. The following chapters discuss how to improve the application by using other features available in Windows Azure, and you’ll see more functionality added to the application. For now, you’ll discover how Adatum takes its first steps into the cloud.
  • 40.
    16 chapter two ThePremise The existing aExpense application is a business expense submission and reimbursement system used by Adatum employees. The applica- tion is built with ASP.NET 4.0, deployed in Adatum’s data center, and is accessible from the Adatum intranet. The application relies on Ac- tive Directory to authenticate employees. It also uses Active Direc- tory to access some of the user profile data that the application re- quires; for example, an employee’s cost center and manager. Other user profile data is accessed using the ASP.NET profile provider and membership provider. Because aExpense uses Windows authentica- tion, it recognizes the credentials used when employees log on to the corporate network and doesn’t need to prompt them again for their user names and passwords. The aExpense access control rules use application-specific roles such as “Employee” and “Manager” that are accessed through the ASP. NET role management provider. Access control is intermixed with the application’s business logic. It uses a simple SQL Server database for storing application data, and LINQ to SQL as its data access mechanism. The application is configured to connect to SQL Server by using integrated security, and the website uses a service account to log on to the database. The aExpense application also uses the Enterprise Library Logging Application Block and the Exception Handling Application Block for logging diagnostic information from the application. Integration with Active Directory really simplifies the task of managing this application. The aExpense application leverages Active Directory’s access management facilities, and the cost center and manager information that Adatum stores in Active Directory.
  • 41.
    17 Getting to theCloud Figure 1 aExpense as an on-premises application Goals and Requirements Adatum wants to explore the opportunities for cloud hosting the aExpense application in an attempt to maximize performance and availability, even during periods of peak usage, while minimizing the associated costs. The goals at this stage are to avoid, as far as possible, changes to the application code and the associated administrative functions while taking advantage of the flexibility and scalability offered by cloud hosting. Browser Web site User profile Active Directory Windows event log SQL Server Database Figure 1 shows a whiteboard diagram of the structure of the on-premises aExpense application.
  • 42.
    18 chapter two Therefore,as the first step in the migration path, Adatum has decided to deploy the aExpense application to the cloud using an IaaS ap- proach. This will avoid any requirement to refactor the application or to make significant changes to the code because it can continue to run on a hosted server running Windows Server. However, the developers and administrators must still consider what, if any, changes are re- quired to the application; and the impact of moving it from their on- premises datacenter to the cloud. Adatum chose to use Windows Azure because of its wide range of capabilities for hosting both the application code and the data, and the availability of additional Windows Azure services that are appro- priate to meet the application’s requirements. For example, Adatum wants to continue to use Active Directory for authenticating users, and be able to integrate the application with its existing on-premises System Center Operations Manager. Adatum also wants to be able to deploy the application in a secure and repeatable way to a staging environment first, and then to a production environment when testing is complete. After deploy- ment, Adatum’s administrators want to be able to scale the applica- tion to cope with varying usage patterns, monitor its execution, and be able to adjust configuration settings to fine tune it. Overview of the Solution This section of the chapter explores the high-level options Adatum had for migrating the aExpense application during this step. It shows how Adatum chose an appropriate hosting mechanism for the applica- tion and for the data it uses, and how Adatum can establish connectiv- ity between the cloud-hosted servers and its on-premises corporate network. Options for Hosting the Application Having decided on an IaaS approach for this initial step, Adatum must consider the hosting options available. Windows Azure provides the following features for IaaS deployment: • Virtual Machine. This feature allows you to provision a virtual machine in the cloud with a choice of operating systems, and with a range of options for preinstalling a database server on the virtual machine. Alternatively, you can upload a prebuilt VM to the cloud. You can use it to run any software compatible with your chosen operating system, and configure the operating system and services as required. Virtual Machine instances maintain state between restarts, and so are suitable for use when software or services you install require state to be maintained. Your decision to move an application to the cloud should be based on clear goals and requirements.
  • 43.
    19 Getting to theCloud • VM Role. This feature allows you to host your own customized instance of the Windows Server 2008 R2 Enterprise or Windows Server 2008 R2 Standard within a Windows Azure data center. However, the role does not save state when Windows Azure restarts or redeploys it as part of the operations executed automatically within the data center (such as when the role fails), and so it is not suitable for scenarios where the software or services you install require state to be maintained. • A set of associated services that provide connectivity and additional functionality for IaaS applications. These services include Windows Azure Connect and Virtual Networks for providing connectivity to hosted servers, and functional services such as claims-based access control, Service Bus relay and messaging, database synchronization, and caching. The major difference between Windows Azure Virtual Machines and the VM role is the behavior when the machine or role is reinitialized. This can occur following a hardware failure, or auto- matically as the Windows Azure internal systems manage allocation of resources by moving in- stances to a different physical server. Any changes to a virtual machine, such as installing applications or configuring the operating system, are persisted when the instance is reinitialized – this is what is meant by the machine being able to maintain its state. VM role instances do not persist these changes. Any changes such as installing ap- plications or configuring the operating system are lost and the role will return to the originally de- ployed configuration when reinitialized (although changes are persisted across restarts as long as the VM role is not reinitialized). This means that you must redeploy the complete VM role image each time you need to make changes to it. When you use a virtual machine you do not need to do this. You can install and update applica- tions on the virtual machine without needing to redeploy it every time, which makes it an attractive option for both testing and production deployment. For more information about how Windows Azure manages maintaining state in virtual machines, see the section “Storing and Backing Up Virtual Machines” later in this chapter. After considering the available application hosting options, Adatum chose to host the application in a Windows Azure Virtual Machine at this stage of their migration process. Developers and testers will be able to deploy to virtual machine instances in exactly the same way as when using an on-premises server. Administrators and operators will be able to manage the live production server and deploy applications to it just as they do with on-premises servers. Affinity Groups When you first create namespaces and instances of Windows Azure services, you must specify the location or datacenter where they will be deployed. However, for some services you can specify only a region rather than a specific datacenter. Therefore, to ensure that elements of your application (such as the compute and storage services) are co-located in the same datacenter as close together as pos- sible you specify an affinity group.
  • 44.
    20 chapter two Whenyou specify an affinity group, which must be done when creat- ing the services (you cannot move services into a different affinity group after they are created), Windows Azure will attempt to locate all of the services in the group in the same cluster in the same data- center. This will maximize performance, reduce latency, and eliminate unnecessary data transfer costs. For information about using affinity groups, see “Importance of Windows Azure Affinity Groups.” Adatum will define an affinity group when it creates the virtual net- work that aExpense uses to access the on-premises Active Directory service. Adatum will also add all the virtual machines to the same af- finity group when it creates them. Availability Sets In Windows Azure, fault domains are a physical unit of failure. Each virtual machine in an availability set is deployed to a different fault domain in Windows Azure. This helps to ensure that your application stays available during network failures, local disk hardware failures, and other outages. However, improving the reliability and responsiveness of the aExpense application by deploying multiple copies of the virtual machines in an availability set will add to the running costs incurred by Adatum. Options for Hosting the Data The existing on-premises aExpense application stores its data in SQL Server. Therefore, Adatum also had to consider how to provide a comparable capability for the application when hosted in the cloud. Adatum has several options: • Keep the data on-premises. In theory this is a simple to imple- ment option. The cloud-hosted application would communicate with the on-premises database over the Internet. However, it raises several issues, such as the security of the connection and the requirement to expose the database server outside of Ada- tum’s internal network. One approach to resolve this would be to use Windows Azure Connect or Virtual Networks to provide a private secure connection. Even with this approach, there are issues around the additional connection latency and the possibil- ity of intermittent connectivity failures, which would require extensive caching in the application and a connection retry mechanism. There may be specific reasons why you want to keep your data on-premises, such as physical security, regulatory requirements, specific management or analysis processes, and more. Hosting the application in the cloud while using an on-premises database still allows you to take advantage of the intrinsic capabilities of Windows Azure such as reliability, scalability, and elasticity. You don’t need a virtual network to use an affinity group. You can create affinity groups independently of virtual networks. You must decide what level of reliability you need for your application and how much you are willing to pay.
  • 45.
    21 Getting to theCloud • Deploy the data in a hosted SQL Server. This approach would require Adatum to deploy a separate virtual machine to run SQL Server, although this can be easily provisioned using the tem- plates available in the Windows Azure portal. Connection latency and intermittent connectivity would be minimized by deploying it in the same datacenter as the application. • Deploy the data in Windows Azure SQL Database. This approach would require Adatum to subscribe to the managed data service offered by Windows Azure, and accept the few limitations that it imposes when compared to the full version of SQL Server. However, it is a viable and useful option that Adatum will consider in a future migration step. Chapter 4, “Moving to Windows Azure SQL Database,” of this guide looks in detail at the differences between SQL Server and Windows Azure SQL Database, and the factors that affect Adatum’s choice at that stage of the migration process. • Deploy the data in Windows Azure table and blob storage. This approach would require Adatum to rewrite the data access code in the application to accommodate the differences between the relational, SQL-based data access approach and the less structured storage mechanisms used in Windows Azure storage. However, there are some specific advantages offered by Win- dows Azure storage such as lower cost and vast storage capabil- ity, and Adatum will consider this in a future migration step. At this stage Adatum’s goal is to minimize the changes required to the code. Chapter 7, “Moving to Windows Azure Table Storage,” of this guide looks in detail at the differences between relational databases and Windows Azure storage. • Deploy the data in a custom store or repository. You can deploy a range of operating systems and software on a hosted Virtual Server, and so you can continue to use you existing data stores and repositories. For example, if Adatum used a custom or third party data storage mechanism based on a non-standard file format, or even just use a simple file server, it could be deployed on Windows Server or Linux on a virtual machine. However, as Adatum uses SQL Server running on Windows Server in its on-premises datacenter, this option is not applicable to its migration strategy. Chapter 4, “Moving to Windows Azure SQL Database,” describes the differences between using a hosted SQL Server and Windows Azure SQL Database, and how the developers at Adatum chose a data storage mechanism for the aExpense application in the subsequent steps of their migration path. You do not have to use Windows Server and SQL Server when you choose the IaaS approach for your database. You can install a range of operating systems and database servers in a hosted virtual machine using the templates available in the Windows Azure portal. For example, you may decide to use MySQL running on Linux as an alternative to SQL Server running on Windows Server.
  • 46.
    22 chapter two Afterconsidering the available data storage options, Adatum chose to host the data in SQL Server running on a separate virtual machine in the same datacenter as the application. Connectivity for Authentication Adatum’s aExpense application relies on connectivity to the Adatum corporate domain to authenticate users against Active Directory, and Adatum wants to maintain the existing mechanism when migrating the application to the cloud. This will avoid the need to make changes to the code while Adatum evaluates the results of the first step in its migration path. In future migration steps Adatum will consider chang- ing the authentication approach to use another mechanism, such as claims and federated identity. However, to continue to use Active Directory for authentication when the application resides in the cloud, Adatum must establish con- nectivity between the application and its on-premises corporate do- main network. One of the advantages of Windows Azure as a hosting environment is that it includes services to enable connectivity that is safe, secure, and easy to set up. Adatum has two options for establishing this connectivity between the cloud-hosted application and its corporate domain network: • Windows Azure Connect. This technology allows administrators to set up a direct connection between a cloud-hosted virtual machine (or a cloud services role) and an on-premises computer. It relies on endpoint software installed in the remote and on- premises computers, which establishes a secure connection across the Internet. Connect does not require ports to be opened in the corporate firewall, and will usually work when network address translation (NAT) routing is in use. It is easy to set up and man- age, and provides a secure connection. • Windows Azure Virtual Networks. This technology uses the virtual private network (VPN) approach to establish connectivity across computers and hosted services in Windows Azure and on-premises. Computers, cloud-hosted virtual machines, and cloud service roles are configured on the network in the same way as when running on premises, and a VPN router on the corporate network establishes connectivity between the network segments. Effectively, this extends the corporate network into the cloud, allowing existing services and applications to be used with no special software installation required on the on-premises computers. Virtual networks are ideally suited to more complex scenarios where scalability and additional control are required. Adatum must establish connectivity between its virtual machines in the cloud and its on-premises Active Directory server to continue to use Windows Authentication when it deploys to a virtual machine in the cloud. The current version of aExpense also relies on Windows Authentication to connect to SQL Server.
  • 47.
    23 Getting to theCloud Virtual networks are typically used where you need to connect virtual machines and cloud service roles together, for connecting between the cloud and on-premises, or when you need a virtual machine or a role to maintain the same IP address when redeployed. The video presentation “Migrating Applications to Windows Azure Virtual Machines” contains a wealth of information about setting up virtual machines and connecting then using Windows Azure Virtual Networks. Both of these options will allow Adatum to continue to use Active Directory for authentication. However, there are some limitations when using Windows Azure Connect. The Active Directory server must also host DNS for the domain (the Connect service cannot be used where a separate DNS server is used), and administrators will need to install the Connect service endpoint software on the Active Directory computer. If this is not an acceptable scenario, Adatum can configure the cloud-hosted virtual machine as part of a Windows Azure Virtual Network. Although this is more complex to configure, it removes the requirement for installing endpoint software. An alternative approach Adatum could take would be to install Active Directory on a virtual machine running in Windows Azure, and con- nect it to their on-premises Active Directory. However, this means that Adatum must pay for the additional Windows Azure resources it uses. In future releases of Windows Azure, the Access Control service it provides will be extended to allow integration with an on-premises Active Directory. Session Support and Load Balancing Applications that run in an on-premises datacenter often rely on in- trinsic features of the network that are not supported in the cloud, and this can affect the way that the application works when deployed to the cloud. A typical example related to the aExpense application is the way that Adatum implements an on-premises web farm by using Windows Network Load Balancing (NLB), and the impact this has on the way that it stores users’ session data. The on-premises aExpense web application uses the built-in ASP.NET in-memory session mechanism to support sessions for each user. This means that session data is only available on the server that initiates the session, and so users must be routed to the same server on each request during a session. Adatum configured affinity for NLB in their datacenter so that this occurs automatically. For more information about NLB see “Overview of Network Load Balancing.” We could also use Windows Azure Connect to link the cloud-hosted application to an on-premises database by installing the Connect service endpoint software on the database server computer if we needed to keep that database on- premises. Unlike opening a public endpoint in SQL Server, the Connect service provides a secure channel between the application and the database. However, in many organizations installing this type of software on the database server may be frowned upon, and this may preclude you from using an on-premises database with your cloud-hosted applications.
  • 48.
    24 chapter two However,affinity is not directly supported in Windows Azure (al- though it can be implemented with a plug-in or with custom code). If Adatum wants to run multiple instances of the virtual machine that hosts the eExpense application in Windows Azure, the develop- ers must change the way session data is stored so that it is available to all instances. For example, they could switch to using the ASP. NET SQL Server session store provider, Windows Azure storage, or use Windows Azure Caching. Chapter 3 of this guide, “Moving to Windows Azure Cloud Services,” explores these options and shows how Adatum’s developers implemented session storage during the next stage of their migration strategy. At the moment Adatum is most concerned with getting the applica- tion running in the cloud to explore the possibilities, validate usability and performance, and gauge user acceptance. Adatum wants to avoid making changes to the code. Therefore, in this step of its migration plan, Adatum will run only one instance of the virtual machine that hosts the aExpense application in the cloud. For information about how to enable load balancing between multiple instances of Virtual Machines in Windows Azure see the section “Load balancing virtual machines” in the topic “Virtual Machines.” The blog post “Setting up a webfarm using Windows Azure Virtual Machines” provides a walkthrough of the procedure. Integrating with On-Premises Services The existing on-premises aExpense application integrates with other applications within Adatum’s corporate network. For example, it reads and writes text files that are used to import and export expenses data for processing by Adatum’s other on-premises systems. Therefore Adatum must consider how it can establish the equivalent functional- ity when the application is hosted in the cloud. The Visual Studio solution BeforeAzure discussed in this chapter does not include this data import and export functionality. The Visual Studio solution Azure-TableStorage discussed in Chapter 7, “Moving to Windows Azure Table Storage,” shows how Adatum added the data export feature to the aExpense application. When using IaaS and virtual servers in the cloud, the application can write to the virtual disk in the same way as when running on a physical server. Administrators can enable direct connectivity with the ma- chine by using Windows Azure Connect or a Windows Azure Virtual Network to allow access to disk files stored on the drives of the re- mote server. When you move an application to the cloud you must consider the impact of running multiple instances in an environment that does not support some of the intrinsic features of your own network. Session management is a typical example.
  • 49.
    25 Getting to theCloud Alternatively, Adatum’s developers could change the code so that it serializes the files and stores them in either Windows Azure storage or in the database. As the files will be read and generated remotely, and streamed to and from the in-house application over the Internet, this is not an issue because they will need to be serialized anyway and can be reconstructed on the on-premises server. Both of the connectivity options, Windows Azure Connect and Windows Azure Virtual Network, allow Adatum to connect the cloud-hosted virtual machines running the application and SQL Server to their corporate domain. This means that existing tools and practices will continue to work without changes being required. For example, administrators can browse the remote machines, use data- base management tools, run existing scripts, and use the same monitoring and management applications. For more details of how Adatum’s administrators will manage the remote servers and applica- tion, see the section “Management and Monitoring” later in this chapter. Inside the Implementation Now is a good time to walk through the process of migrating aEx- pense into a cloud-based application in more detail. As you go through this section, you may want to download the Microsoft Visual Studio development system solution from http://wag.codeplex.com/. This so- lution contains an implementation of the aExpense application (in the BeforeAzure folder) as it is when running on-premises. If you are not interested in the mechanics, you should skip to the next section. Profile Data Before the migration, aExpense used the ASP.NET profile feature to store application-specific user settings. Adatum tries to avoid custom- izing the schema in Active Directory, so aExpense stores a user’s pre- ferred reimbursement method by using the profile feature. The default profile provider stores the profile properties in a database. Using the profile feature makes it very easy for the application to store small amounts of user data. Adatum enabled the profile feature and specified the properties to store in the Web.config file. We don’t like to customize the Active Directory schema if we can possibly avoid it. Schema changes have far- reaching implications and are difficult to undo. A virtual machine or a VM role or can be used simply as a file server in the cloud. When connected through Windows Azure Connect or Windows Azure Virtual Networks it will be accessible from on-premises computers and by other applications running in the cloud.
  • 50.
    26 chapter two XML <profiledefaultProvider="SqlProvider"> <providers> <clear /> <add name="SqlProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="aExpense" applicationName="aExpense" /> </providers> <properties> <add name="PreferredReimbursementMethod" /> </properties> </profile> Then developers can access a profile property value in code like this. C# var profile = ProfileBase.Create(userName); string prm = profile.GetProperty<string>("PreferredReimbursementMethod"); Connecting to a hosted SQL Server running on a virtual machine instead of a SQL Server on-premises requires only a configuration change. After migration, aExpense continues to use the profile system to store the preferred reimbursement method for each user. The application also uses ASP.NET membership to store the users preferred name, and ASP.NET role management for the custom roles used in the aExpense application. You can see how these are config- ured in the Web.config file, and how they are accessed in the User- Repository class. Connecting to the Hosted SQL Server Before the migration aExpense stored application data in a SQL Server database running on-premises. In this first phase, the team moved the database to a hosted SQL Server running on a virtual ma- chine. The data access code in the application remains unchanged. The only thing that needs to change is the connection string in the Web. config file.
  • 51.
    27 Getting to theCloud XML <add name="aExpense" connectionString= "Data Source={Server Name}; Initial Catalog=aExpense; Integrated Security=True; Encrypt=yes;" providerName="System.Data.SqlClient" /> This connection string uses the same SQL Server security mode as the on-premises solution. To continue using Windows Authentication mode, both the virtual machines must be able to access the Adatum on-premises Active Directory service. The server name must be set to the server name of the virtual machine where SQL Server is hosted. Adatum also chose to encrypt the connection to SQL Server; for more information see “Encrypting Connections to SQL Server “ on MSDN. If you choose to use SQL Server authentication instead of Windows authentication to connect to SQL Server, your connection string will include a user name and password in plain text. In this scenario, you should consider encrypting your SQL connection string in the Web.config file; to do this, you can use the Pkcs12 Protected Configuration Provider. For more information, see Chapter 4, “Moving to Windows Azure SQL Database.” The connection string also specifies that all communications with Windows Azure SQL Database are encrypted. Even though your ap- plication may reside on a computer in the same data center as the server hosting SQL Server, you should treat that connection as if it was using the internet. Database Connection Timeouts and Dropped Connections If a connection to SQL Server times out or drops while your application is using the connection, you should immediately try to re-establish the connection. If possible, you should then retry the operation that was in progress before the connection dropped, or in the case of a transaction, retry the transaction. It is possible for a connection to fail between sending a message to commit a transaction and receiving a message that reports the outcome of the transaction. In this circumstance, you must have some way of checking whether the transaction completed suc- cessfully in order to determine whether you must retry it. You can also add protection to your hosted SQL Server by configuring the Windows Firewall on the virtual machine so that it allows only a specific range of permitted IP addresses to connect to your database server. However, this is complicated by the fact that you may not always be able to determine ahead of time the IP address of your virtual machine instance(s). For example, when you redeploy a virtual machine, the IP address may change.
  • 52.
    28 chapter two Whenusing a hosted SQL Server, you can continue to use the same techniques as you do in on-premises applications. As long as the virtual machines hosting the application and the SQL Server are co- located in the same datacenter, connection failures should arise no more often than when running in your own datacenter. However, it is useful to consider implementing a mechanism that can alleviate issues with failed connections. In Chapter 4, “Moving to Windows Azure SQL Database,” of this guide you will see how Adatum chose to use the Enterprise Library Transient Fault Handling Block to man- age connection retries when connecting to the database. Deploying the aExpense Application to Windows Azure Virtual Machines This section outlines the steps that Adatum took to deploy the aExpense application to two Windows Azure virtual machines: one for the web application and one for the SQL Server database. For a more detailed description of the steps, see the Hands-on Labs that are available for this guide. Deploying the Web Application 1. Create a virtual network to enable connectivity to the Adatum on-premises Active Directory server. 2. Create a virtual machine based on the Windows Server image available in the portal and ensure that the virtual machine is part of the virtual network. 3. Set up remote desktop connectivity to enable access to the virtual machine from on-premises. 4. Join the machine to the Adatum Active Directory. 5. Install .NET 4 on the virtual machine. 6. Install and configure the dependencies of the aExpense applica- tion: install Internet Information Server (IIS), enable Windows Communication Foundation in IIS, enable Application Pool User Profile in IIS, install certificates required for HTTPS, and config- ure HTTPS in IIS. 7. Copy the application code to the server, and add a web applica- tion in IIS. By configuring appropriate endpoints for your virtual machine in the Windows Azure portal, you can improve security by limiting its publicly available TCP ports.
  • 53.
    29 Getting to theCloud Deploying the Database 1. Create a virtual machine that includes SQL Server. Adatum did this by using an image available in the portal that includes SQL Server 2012, but it could have installed a different version. This virtual machine should be part of the same virtual network and affinity group as the virtual machine that hosts the web application. 2. Set up remote desktop connectivity to enable access to the virtual machine from on-premises. 3. Join the machine to the Adatum Active Directory. 4. Open port 1433 in Windows Firewall to allow access to the database (you may want to use a different port to help hide SQL Server), and enable network connectivity in SQL Server for the TCP/IP protocols. 5. Migrate the on-premises database used by the aExpense applica- tion to the SQL Server installation in the virtual machine. Ensure that the domain account used by the application pool on the web server has access to the database. During testing the development team at Adatum is working with sample data. However, the developers must consider how they will deploy both test and live data to the SQL Server instances running in the hosted virtual machines. To migrate an existing database schema and data to a hosted SQL Server, Adatum can use SQL Server Management Studio. The SQL Server Integration Service and other export tools it contains allow administrators to connect to both the local and the Windows Azure hosted servers to create a copy of the database and its data in the hosted server. An alternative is to export the schema—and, if required, the data—as a Transact-SQL script, and then connect to the remote server using Remote Desktop Protocol (RDP) and run the script using SQL Server Management Studio or the command line on that server. Using a script allows Adatum to include this as part of the build process for the test server running in Windows Azure staging, so that the application can be tested without using the live data. Adatum is using a virtual network to enable connectivity to the on- premises services that the aExpense application uses. The virtual network is not needed to enable connectivity between the two Windows Azure virtual machines.
  • 54.
    30 chapter two Testing,Deployment, Management, and Monitoring This section discusses application life cycle management topics for applications hosted in Windows Azure. Although specific require- ments will vary between applications and across organizations, every- one develops applications, then tests them, and finally deploys them. Typical factors that must be considered are where applications should be tested, and how the deployment process should be managed to make sure that only authorized personnel have access to the live pro- duction environment. In this chapter the focus is on the specific scenarios related to IaaS deployment using hosted virtual machines. In subsequent chapters you will find additional information related to the subsequent stages of the migration process Adatum followed. If you choose to use the Windows Azure VM role instead of virtual machines, you will need to establish a testing and deployment procedure that encompasses redeploying the server images each time you change the application or reconfigure the server. Adatum has a well-defined set of existing processes for deploying ap- plications to its on-premises servers. The development and testing teams use separate servers for testing, staging, and production. When the development team releases a new version of the application, its progression through the testing, staging, and production environ- ments is tightly controlled. Very rarely, though, small fixes, such as updating the text on an ASPX page, are applied directly to the produc- tion servers. Adatum has a number of goals for application life cycle management for Windows Azure. Adatum wants to maintain its clearly defined process for deploying applications to Windows Azure, with clearly defined roles and responsibilities. More specifically, it wants to make sure that access to the live environment is only available to a few key people, and that any changes to the live environment are traceable. You can use the Windows Azure API to get a list of create, update, and delete operations that were performed on a subscription during the specified timeframe. For more information, see “List Subscription Operations.” We want to have a clearly defined process for deploying applications to Windows Azure that allows us to control and trace operations carried out on our subscriptions.
  • 55.
    Another Random ScribdDocument with Unrelated Content
  • 56.
    closed, he setoff, fatigued as he was, without recruiting himself with any refreshment. He intended to ask for one of the ladies of St. Catherine’s, and entreat her, if Amanda was then in a situation to be seen, to announce his arrival to her; but after rapping repeatedly with a rattan against the door, the only person who appeared to him was a servant girl. From her he learned the ladies were all in the chapel, and that Miss Fitzalan was in the prioress’s apartment. He asked, “Was she too ill to be seen?” The girl replied, “No"—for having only entered the room to leave the kettle in it, at a time when Amanda was composed, she imagined she was very well. Lord Mortimer then told her his name, and desired her to go up to Miss Fitzalan and inquire whether she would see him. The girl attempted not to move. She was in reality so struck of a heap by hearing that she had been talking to a lord, that she knew not whether she was standing on her head or her heels. Lord Mortimer imputing her silence to disinclination to comply with his request, put a guinea into her hand, and entreated her to be expeditious. This restored her to animation, but ere she reached the room she forgot his title, and being ashamed to deliver a blundering message to Miss Fitzalan, or to appear stupid to Lord Mortimer, she returned to him, pretending she had delivered his message, and that he might go up. She showed him the door, and when he entered he imputed the silence of Amanda, and her not moving, to the effects of her grief. He advanced to the couch, and was not a little shocked on seeing her eyes closed—concluding from this that she had fainted, but her easy respiration soon convinced him that this was a mistake, and he immediately concluded that the girl had deceived him. He leaned over her till she began to stir, and then retreated behind her, lest his presence, on her first awaking, should alarm her. What took place in the interview between them has already been related. Notwithstanding appearances were so much against her, and no explanation had ensued relative to them, from the moment she asserted her innocence with solemnity he could no longer doubt it; and yielding at once to its conviction, to his love, to his pity for her, he again renewed his overtures for a union. Hearing of the
  • 57.
    stratagems laid forher destruction, the dangers she had escaped, the distresses she had experienced, made him more anxious than ever for completing it, that by his constant protection he might secure her from similar trials, and by his tenderness and care restore her to health, peace, and happiness. He longed for the period of her triumphing over the perfidious marchioness, and the detestable Lady Euphrasia, by being raised to that station they had so long attempted to prevent her attaining, and thus proving to them that virtue, sooner or later, will counteract the designs of vice. He felt a degree of rapture at the idea of his being no longer obliged to regret the ardent, the unabated affection he felt for her. His transports were somewhat checked when she solemnly declared a union between them impossible, and forbade his seeing her again. He was piqued by the steadiness with which she repeated this resolution, but her present weak state prevented his betraying any resentment, and he flattered himself he would be able to conquer her obstinacy. He could not now, indeed, despair of any event after the unexpected restoration of Amanda to his esteem, and the revival of those hopes of felicity, which in the certainty of having lost her had faded away. He returned, as Johnaten said, an altered man, to the castle. He no longer experienced horror at entering the dressing-room which displayed so many vestiges of his Amanda’s taste. He resolved on an immediate union as the surest proof he could give her of his perfect confidence in her sincerity, not allowing himself to suppose she would continue firm in the resolution she had recently avowed to him. He then intended setting off for London, and sparing neither time, trouble nor expense, to obtain from the inferior agents in the plot laid against her, a full avowal of the part they had themselves acted in it, and all they knew relative to those performed by others. This was not designed for his own satisfaction. He wanted no confirmation of what Amanda asserted, as his proposal to marry her immediately demonstrated; it was to cover with confusion those who had meditated her destruction, and add to the horrors they would experience when they found her emerging from obscurity— not as Miss Fitzalan, but as Lady Mortimer. Such proofs of her
  • 58.
    innocence would alsoprevent malice from saying he was the dupe of art, and he was convinced, for both their sakes, it was requisite to procure them. He would then avow his marriage, return for his wife, introduce her to his friends, and, if his father kept up any resentment against them longer than he expected, he knew in Lady Martha Dormer’s house, and at Tudor Hall, he would find not only an eligible, but pleasant residence. Those delightful schemes kept him awake half the night, and when he fell asleep it was only to dream of happiness and Amanda. In the morning, notwithstanding the prohibition he had received to the contrary, he went to inquire how she was, and to try and see her. The girl who had answered his repeated knocks the preceding evening, appeared, and told him Miss Fitzalan was very bad. He began to think that this must be a pretext to avoid seeing him, and to come at the truth was slipping a bribe into her hand, when Sister Mary, who had been watching them from an adjoining room, appeared, and stopped this measure. She repeated what the girl had just said, and, in addition to it, declared that even if Miss Fitzalan was up she would not see him, and that he must come no more to St. Catherine’s, as both Miss Fitzalan and the prioress would resent such conduct exceedingly; and that, if he wanted to inquire after the health of the former, he might easily send a servant, and it would be much better done than to come frisking over there every moment. Lord Mortimer was seriously displeased with this unceremonious speech. “So, I suppose,” cried he, “you want to make a real nun of Miss Fitzalan, and to keep her from all conversation.” “And a happy creature she would be were she to become one of us,” replied Sister Mary; “and as to keeping her from conversation, she might have as much as she pleased with any one. Indeed, I believe the poor thing likes you well enough; the more’s her misfortune for doing so.” “I thank you, madam,” cried Lord Mortimer; “I suppose it one of your vows to speak truth; if so, I must acknowledge you keep it religiously.” “I have just heard her,” proceeded Sister Mary, without minding what he had said, “tell the prioress a long story about you and herself, by which I find it was her father’s desire she should
  • 59.
    have nothing moreto say to you, and I dare say the poor gentleman had good reasons for doing so. I beg, my lord, you will come no more here, and, indeed, I think it was a shame for you to give money to the simpleton who answered you. Why, it is enough to turn the girl’s head, and set her mad after one fal-lal or other.” Lord Mortimer could not depart without an effort to win Sister Mary over to his favor, and engage her to try and persuade Miss Fitzalan to permit his visits, but she was inflexible; he then entreated to know if Amanda was so ill as to be unable to rise. She assured him she was, and, as some little consolation to the distress she perceived this assurance gave him, said he might send when he pleased to inquire after her health, and she would take care to answer the messenger herself. Lord Mortimer began now to be seriously alarmed lest Captain Fitzalan had prevailed on his daughter to make a solemn renunciation of him. If this was the case, he knew nothing could prevail on her to break her promise. He was half distracted with doubt and anxiety, which were scarcely supportable, when he reflected that they could not for some time be satisfied, since, even if he wrote to her for that purpose, she could not at present be able to answer his letter; again he felt convinced of the instability of earthly happiness, and the close connection there has ever been between pleasure and pain.
  • 60.
    CHAPTER XXXVI. “Thy presenceonly ’tis can make me blest, Heal my unquiet mind, and tune my soul.”—Otway. The fatigue, distress, and agitation of Amanda could no longer be struggled with; she sunk beneath their violence, and for a week was confined to her bed by the fever which had seized her in England, and ever since lurked in her veins. The whole sisterhood, who took it in turn to attend her, vied with each other in kindness and care to the poor invalid. Their efforts for her recovery were aided by a skilful physician from the next town, who called, without being sent for, at the convent. He said he had known Captain Fitzalan, and that, hearing that Miss Fitzalan was indisposed, he had come in hopes he might be of service to the daughter of a man he so much esteemed. He would accept of no fee, and the prioress, who was a woman of sagacity, suspected, as well as Amanda, that he came by the direction of Lord Mortimer. Nor were they mistaken, for, distracted by apprehensions about her, he had taken this method of lightening his fears, flattering himself, by the excellent advice he had procured, her recovery would be much expedited, and, of course, his suspense at least terminated. The doctor did not withdraw his visits when Amanda was able to rise; he attended her punctually, and often paid her long visits, which were of infinite service to her spirits, as he was a man of much information and cheerfulness. In a few days she was removed from her chamber into a pleasant room below stairs, which opened into the garden, where, leaning on the friendly doctor’s arm, or one of the nuns’, she walked at different times a few minutes each day. Lord Mortimer, on hearing this, thought he might now solicit an interview, and accordingly wrote for that purpose:—
  • 61.
    TO MISS FITZALAN. LordMortimer presents his compliments to Miss Fitzalan, flatters himself she will allow him personally to express the sincere happiness her restoration to health has afforded him. He cannot think she will refuse so reasonable a request. He is almost convinced she would not hesitate a moment in granting it, could she form an idea of the misery he has experienced on her account, and the anxiety he feels, and must continue to feel, till some expressions in the last interview are explained. Castle Carberry, 10th May. This letter greatly distressed Amanda. She had hoped the pain of again rejecting his visits and requests would have been spared her. She guessed at the expressions he alluded to in his letter; they were those she had dropped relative to her promise to her father, and from the impetuous and tender feelings of Lord Mortimer she easily conceived the agony he would experience when he found this promise inviolable. She felt more for his distress than her own. Her heart, seasoned in the school of adversity, could bear its sorrows with calmness; but this was not his case, and she paid the tribute of tears to a love so fervent, so faithful, and so hopeless. She then requested Sister Mary to acquaint his messenger that she received no visits; that, as she was tolerably recovered, she entreated his lordship would not take the trouble of continuing his inquiries about her health, or to send her any more written messages, as she was unable to answer them. The prioress, who was present when she received the letter, commended her exceedingly for the fortitude and discretion she had manifested. Amanda had deemed it necessary to inform her, after the conversation she heard between her and Lord Mortimer, of the terms on which they stood with each other; and the prioress, who doubted whether his lordship was in reality as honorable as he professed himself, thought Amanda on the sure side in declining his visits.
  • 62.
    The next morningthe doctor called as usual. He told Amanda he had brought her an entertaining book, for no such thing could be procured at St. Catherine’s, and, as she had expressed her regret at this, from the time she had been able to read he had supplied her from his library, which was extensive and well chosen. He did not present it to her till he was retiring, and then said, with a significant smile, she would find it contained something worthy of her particular attention. Amanda was alone, and immediately opened it. Great was her astonishment when a letter dropped from it into her lap. She snatched it up, and, perceiving the direction in Lord Mortimer’s hand, she hesitated whether she should open a letter conveyed in this manner; but to return it unopened was surely a slight Lord Mortimer merited not, and she broke the seal with a trembling hand and a palpitating heart:— Unkind Amanda, to compel me to use stratagems in writing to you, and destroy the delightful hopes which had sprung in my soul, at the prospect of being about to receive a reward for my sufferings. Am I ever to be involved in doubts and perplexity on your account? Am I ever to see difficulty succeeded by difficulty, and hope by disappointment? You must be sensible of the anxiety I shall feel, until your ambiguous expressions are fully explained, and yet you refuse this explanation! But you have no pity for my feelings. Would it not be more generous in you to permit an interview than to keep me in suspense? To know the worst is some degree of ease; besides, I should then have an opportunity of perhaps convincing you that virtue, unlike vice, has its bounds, and that we may sometimes carry our notions of honor and generosity too far, and sacrifice our real happiness to chimerical ideas of them. Surely I shall not be too presumptuous in saying that, if the regard Amanda once flattered me with is undiminished, she will, by rejecting a union with me, leave me not the only sufferer.
  • 63.
    Oh! do not,my dear and too scrupulous girl, think a moment longer of persevering in a resolution so prejudicial to your welfare. Your situation requires particular protection: young, innocent, and beautiful; already the object of licentious pursuits; your nearest relations your greatest enemies; your brother, from his unsettled line of life, unable to be near you. Oh! my Amanda, from such a situation what evils may accrue? Avoid them, by taking refuge in his arms, who will be to you a tender friend and faithful guardian. Before such evils, the obligation for keeping a promise to reject me, fades away, particularly when the motives which led to such a promise are considered. Captain Fitzalan, hurt by the unfortunate letter he received from my father, extended his resentment to his son, and called upon you without reflecting on the consequences of such a measure to give me up. This is the only reason I can conceive for his desiring such a promise, and had I but arrived while he could have listened to my arguments, I am firmly convinced, instead of opposing, he would have sanctioned our union, and given his beloved girl to a man who, in every instance, would study to evince his gratitude for such a gift, and to supply his loss. Happiness, my dear Amanda, is in long arrears with us. She is now ready to make up for past deficiencies, if it is not our own faults; let us not frighten her from performing her good intentions, but hand in hand receive the lovely and long absent guest to our bosoms. You will not, cannot, must not, be inflexible; I shall expect, as soon as you read this, a summons to St. Catherine’s to receive the ratification of my hopes. In everything respecting our union I will be guided by you, except delaying it; what we have both suffered already from deceit makes me doubly anxious to secure you mine, lest another vile scheme should be formed to effect our separation. Oh! Amanda, the faintest prospect of calling you mine gives to my heart a felicity no language can express. Refuse not being
  • 64.
    mine except youbring me an addition of fortune; already rich in every virtue, I shall, in obtaining you, obtain a treasure which the wealthiest, the proudest, and the vainest of the sons of men may envy me the possession of, and which the good, the sensible, and elegant, must esteem the kindest gift indulgent heaven could bestow on me. Banish all uneasy doubts and scruples, my Amanda, from your mind, nor think a promise, which was demanded without reflecting on the consequences that must attend it, can be binding. The ingenuous soul of your father would have cancelled it in a moment, had those consequences been represented to him; and now, when our own reason convinces us of them, I make no doubt, if departed souls are permitted to view the transactions of this world, his spirit would behold our union with approbation. Yes, my Amanda, I repeat your father’s approving spirit will smile upon an act which gives to his lovely and beloved orphan a faithful friend and steady protector, in her adoring Mortimer. Castle Carberry, 11th May. This letter deeply affected the sensibility, but could not shake the resolution of Amanda. She would not have answered it, as she considered any correspondence an infringement on the promises she had given her father to decline any further intimacy with him; but from the warmth and agitation displayed in his letter, it was evident to her that, if he did not receive an immediate answer to it, he would come to St. Catherine’s and insist on seeing her; and she felt assured, that she could much better deliver her sentiments upon paper than to him; she accordingly wrote as follows:— TO LORD MORTIMER. My Lord,—You cannot change my resolution; surely, when I solemnly declare to you it is unalterable, you will spare me any further importunity on so painful a subject. In vain, my lord, would you, by sophistry, cloaked with tenderness for that
  • 65.
    purpose, try toinfluence me. The arguments you have made use of, I am convinced, you never would have adopted, had you not been mistaken in regard to those motives which prompted my father to ask a promise from me of declining any farther connection with you. It was not from resentment, my lord; no, his death was then fast approaching, and he, in charity for all mankind, forgave those who had wounded him by unjust reproach and accusation; it was a proper respect for his own character, and not resentment, which influenced his conduct, as he was convinced if I consented to an alliance with you, Lord Cherbury would be confirmed in all the suspicions he entertained of his having entangled you with me, and consequently load his memory with contempt. Tenderness also for me actuated him; he was acquainted with the proud heart of Lord Cherbury, and knew that if, poor and reduced as I was, I entered his family I should be considered and treated as a mean intruder. So thoroughly am I convinced that he did not err in this idea, that, whenever reason is predominant in my mind, I think, even if a promise did not exist for such a purpose, I should decline your addresses; for, though I could submit with cheerfulness to many inconveniences for your sake, I never could support indignities. We must part, my lord; Providence has appointed different paths for us to pursue in life: yours smooth and flowery, if by useless regrets you do not frustrate the intentions of the benevolent Donor; mine rough and thorny; but both, though so different, will lead to the same goal, where we shall again meet to be no more separated. Let not your lordship deem me either unkind or ungrateful; my heart disavows the justice of such accusations, and is but too sensible of your tenderness and generosity. Yes, my lord, I will confess that no pangs can be more pungent than those which now rend it, at being obliged to act against its feelings; but the greater the sacrifice the greater the merit of submitting to it, and a ray of self-approbation is perhaps the only sunshine of the soul which will brighten my future days.
  • 66.
    Never, my lord,should I enjoy this, if my promise to my father was violated. There is but one circumstance which could set it aside, that is, having a fortune, that even Lord Cherbury might deem equivalent to your own to bring you; for then my father has often said he would approve our union; but this is amongst the improbabilities of this life, and we must endeavor to reconcile ourselves to the destiny which separates us. I hope your lordship will not attempt to see me again; you must be sensible that your visits would be highly injurious to me. Even the holy and solitary asylum which I have found would not protect me from the malice which has already been so busy with my peace and fame. Alas! I now need the utmost vigilance —deprived as I am of those on whom I had claim of protection, it behooves me to exert the utmost circumspection in my conduct; he in whom I expected to have found a guardian, Oscar, my dear unfortunate brother, is gone, I know not whither, persecuted and afflicted by the perfidious monster who has been such a source of misery to me! Oh, my lord, when I think what his sufferings may now be, my heart sinks within me. Oh! had I been the only sufferer I should not have felt so great a degree of agony as I now endure; but I will not despair about my dear Oscar. The Providence which has been so kind to his sister, which so unexpectedly raised her friends at the moment she deemed herself deprived of all earthly comfort, may to him have been equally merciful. I have trespassed a long time upon your lordship’s attention, but I wished to be explicit, to avoid the necessity of any further correspondence between us. You now know my resolves; you also know my feelings; in pity to them spare me any further conflicts. May the tranquil happiness you so truly deserve soon be yours! Do not, my lord, because disappointed in one wish, lose your sense of the many valuable blessings with which you are surrounded, in fulfilling the claims which your friends, your country, have upon you; show how truly you merit those blessings, and banish all useless regrets from your heart. Adieu, my lord!—suffer no uneasiness on my
  • 67.
    account. If Heavenprolongs my life, I have no doubt but I shall find a little comfortable shelter from the world, where, conscious I have acted according to my principles of right, I shall enjoy the serenity which ever attends self-approbation—a serenity which no changes or chances in this life will, I trust, ever wrest from Amanda Fitzalan. St. Catherine’s, May 12th. She dispatched this by an old man who was employed in the garden at St. Catherine’s ; but her spirits were so much affected by writing it, she was obliged to go up and lie on the bed. She considered herself as having taken a final adieu of Lord Mortimer, and the idea was too painful to be supported with fortitude. Tender and fervent as his attachment was now to her, she believed the hurry and bustle of the world, in which he must be engaged, would soon eradicate it. A transfer of his affections, to one equal to himself in rank and fortune, was a probable event, and of course a total expulsion of her from his memory would follow. A deadly coldness stole upon her heart at the idea of being forgotten by him, and produced a flood of tears. She then began to accuse herself of inconsistency. She had often thought, if Lord Mortimer was restored to happiness, she should feel more tranquil. And now, when the means of effecting this restoration occurred, she trembled and lamented as if it would increase her misery. “I am selfish,” said she to herself, “in desiring the prolongation of an affection which must ever be hopeless. I am weak in regretting the probability of its transfer, as I can never return it.” To conquer those feelings, she found she must banish Lord Mortimer from her thoughts. Except she succeeded in some degree in this, she felt she never should be able to exert the fortitude her present situation demanded. She now saw a probability of her existence being prolonged, and the bread of idleness or dependence could never be sweet to Amanda Fitzalan.
  • 68.
    She had lainabout an hour on the bed, and was about rising and returning to the parlor, when Sister Mary entered the chamber, and delivered her a letter. Ere Amanda looked at the superscription, her agitated heart foretold her whom it came from. She was not mistaken in her conjecture; but as she held it in her hand, she hesitated whether she should open it or not. “Yet,” said she to herself, “it can be no great harm. He cannot, after what I have declared, suppose my resolution to be shaken. He writes to assure me of his perfect acquiescence to it.” Sister Mary left her at the instant her deliberations ended, by opening the letter. TO MISS FITZALAN. Inexorable Amanda! but I will spare both you and myself the pain of farther importunity. All I now request is, that for three months longer at least, you will continue at St. Catherine’s ; or that, if you find a much longer residence there unpleasant, you will, on quitting it, leave directions where to be found. Ere half the above-mentioned period be elapsed, I trust I shall be able satisfactorily to account for such a request. I am quitting Castle Carberry immediately. I shall leave it with a degree of tranquillity that would perhaps surprise you, after what has so lately passed, if in this one instance you will oblige your ever faithful Mortimer. This laconic letter astonished Amanda. By its style it was evident Lord Mortimer had recovered his cheerfulness—recovered it not from a determination of giving her up, but from a hope of their again meeting, as they could both wish. A sudden transport rushed upon her heart at such an idea, but quickly died away when she reflected it was almost beyond the possibility of things to bring about a pleasing interview between them. She knew Lord Mortimer had a sanguine temper, and though it might mislead him, she resolved it should not mislead her. She could not form the most distant surmise of what he had now in agitation; but whatever it was, she firmly
  • 69.
    believed it wouldend in disappointment. To refuse every request of his was painful; but propriety demanded she should not accede to the last, for one step, she wisely considered, from the line of prudence she had marked out for herself to take, might plunge her in difficulties from which she would find it impossible to extricate herself. With an unsteady hand she returned the following answer:— TO LORD MORTIMER. My Lord,—I cannot comply with your request. You may, if you please, repeat inexorable Amanda. I had rather incur the imputation of obstinacy than imprudence, and think it much better to meet your accusation, than deserve my own. How long I may reside at St. Catherine’s is to myself unknown. When I quit it, I certainly will not promise to leave any directions where you may find me. The obstacles which have rendered our separation necessary, are, I am convinced, beyond your lordship’s power to conquer. Except they were removed, any farther interviews between us would be foolish and imprudent in the extreme. I rejoice to hear you are leaving the castle. I also rejoice, but am not surprised, to hear of your tranquillity. From your good sense I expected you would make exertions against useless regrets, and those exertions I knew would be attended with success; but, as some return for the sincere pleasure I feel for your restoration to tranquillity, seek not to disturb again that of Amanda Fitzalan. St. Catherine’s, May 12th. Scarcely had she sealed this letter when she was called to dinner; but though she obeyed the summons she could not eat. The exertions her writing to Lord Mortimer required, and the agitation his letter had thrown her into, quite exhausted her strength and spirits. The nuns withdrew soon after dinner, and left her alone with the prioress. In a few minutes after their departure, the old gardener
  • 70.
    returned from CastleCarberry, where he had been delivering her letter. After informing her he had put it safely into his lordship’s hands, he added, with a look which seemed to indicate a fear lest she should be distressed, that he had received neither letter nor message from him, though he waited a long time in expectation of receiving either one or the other; but he supposed, he said, his lordship was in too great a hurry just then to give any answer, as a chaise and four was waiting to carry him to Dublin. Amanda burst into tears as the man retired from the room. She saw she had written to Lord Mortimer for the last time, and she could not suppress this tribute of regret. She was firmly convinced, indeed, she should behold him no more. The idea of visiting her she was sure, nay, she hoped, he would relinquish, when he found, which she supposed would soon be the case, the schemes or hopes which now buoyed up his spirits impossible to be realized. The prioress sympathized in her sorrow; though not from her own experience, yet from the experience of others, she knew how dangerous and bewitching a creature man is, and how difficult it is to remove the chains which he twines around the female heart. To remove those which lay so heavy upon the delicate and susceptible heart of her young friend, without leaving a corrosive wound, was her sincere wish, and by strengthening her resolution, she hoped success would crown their endeavors. Two hours were elapsed since her messenger’s return from the castle, when Sister Mary entered the room with a large packet, which she put into Amanda’s hands, saying, it was given her by Lord Mortimer’s servant, who rode off the moment he delivered it. Sister Mary made no scruple of saying, she should like to know what such a weighty packet contained. The prioress chide her in a laughing manner for her curiosity, and drew her into the garden, to give Amanda an opportunity of examining the contents. She was surprised, on breaking the seal, to perceive a very handsome pocket-book in a blank cover, and found unsealed, a letter
  • 71.
    to this effect:— TOMISS FITZALAN. I have put it out of your power to return this, by departing long ere you receive it. Surely, if you have the laudable pride you profess, you will not hesitate to use the contents of the pocket- book, as the only means of avoiding a weight of obligations from strangers. Though discarded as a lover, surely I may be esteemed as a friend, and with such a title I will be contented till I can lay claim to a tenderer one. You start at this last expression, and I have no doubt you will call me a romantic visionary, for entertaining hopes which you have so positively assured me can never be realized; but ere I resign them, I must have something more powerful than this assurance, my sweet Amanda, to convince me of their fallacy. I was inexpressibly shocked this morning to learn by your letter, that your brother had met with misfortune. My blood boils with indignation against the monster who has, to use your emphatical expression, been such a source of misery to you both. I shall make it my particular care to try and discover the place to which Mr. Fitzalan is gone, and in what situation. By means of the agents, or some of the officers belonging to the regiment, I flatter myself with being able to gain some intelligence of him. I need not add, that, to the utmost extent of my power I will serve him. My success in this affair, as well as in that which concerns a much dearer being, you may be convinced you shall soon hear. Adieu, my Amanda; I cannot say, like Hamlet, “Go, get you to a nunnery;" but I can say, “Stay there, I charge you.” Seriously, I could wish, except you find your present situation very unpleasant and inconvenient, not to change it for a short time. I think, for a temporary abode, you could not find a more eligible one; and, as I shall be all impatience when I return to Ireland to see you, a search after you would be truly insupportable. You have already refused to inform me of your determination relative to this matter; surely I may venture to
  • 72.
    request it maybe as I wish, when I assure you, that, except I can see you in a manner pleasing to both, I never will force into your presence him, who, let things turn out as they may, must ever continue Your faithful Mortimer. “Gracious Heaven!” said Amanda to herself, “what can he mean? What scheme can he have in agitation which will remove the obstacles to our union? He here seems to speak of a certainty of success. Oh, grant, merciful Power!” she continued, raising her meek eyes to heaven, while a rosy blush stole upon her cheeks, “grant that indeed he may be successful. He talks of returning to Ireland; still,” proceeded she, reading over the letter, “of requiring something more powerful than my assurance to convince him of the fallacy of his hopes. Surely, Lord Mortimer would not be so cruel as to raise expectations in my bosom without those in his own were well founded. No, dear Mortimer, I will not call you a romantic visionary, but the most amiable, the most generous of men, who for poor Amanda encounters difficulties and sacrifices every splendid expectation.” She rejoiced at the intention he had declared of seeking out Oscar. She looked forward either to a speedy interview, or speedy intelligence of this beloved brother, as she knew Lord Mortimer would seek him with the persevering spirit of benevolence, and leave no means untried to restore him to her. She now examined the contents of the pocket-book. It contained a number of small bills, to the amount of two hundred pounds,—a large present, but one so delicately presented, that even her ideas of propriety could scarcely raise a scruple against her accepting it. They did, however, suggest one. Uncertain how matters would yet terminate between her and Lord Mortimer, she was unwilling to receive pecuniary obligations from him. But when she reflected on his noble and feeling heart, she knew she should severely wound it by returning his present; she therefore resolved on keeping it, making a kind of compromise with her feelings about the matter, by determining that, except entitled to receive them, she would never
  • 73.
    more accept favorsof this nature from his lordship. The present one, indeed, was a most seasonable relief, and removed from her heart a load of anxiety which had weighed on it. After paying her father’s funeral expenses, the people with whom he lodged, and the apothecary who had attended him, she found herself mistress of but twenty guineas in the whole world, and more than half of this she considered as already due to the benevolent sisters of St. Catherine’s, who were ill able to afford any additional expense. She had resolved to force them to accept, what indeed she deemed a poor return for their kindness to her, and she then intended to retire to some obscure hovel in the neighborhood, as better suited to the state of her finances, and continue there till her health was sufficiently restored to enable her to make exertions for her livelihood. But she shuddered at the idea of leaving St. Catherine’s and residing amongst a set of boors. She felt sensations something similar to those we may suppose a person would feel who was about being committed to a tempestuous ocean without any means of security. Lord Mortimer had prevented the necessity which had prompted her to think of a removal, and she now resolved to reside, at least for the time he had mentioned, in the convent, during which she supposed her uncertainties relative to him would be over, and that, if it was not her fate to be his, she should, by the perfect re- establishment of her health, be enabled to use her abilities in the manner her situation required. Tears of heartfelt gratitude and sensibility flowed down her cheeks for him who had lightened her mind of the care which had so oppressed it. She at length recollected the prioress had retired into the garden from complaisance to her, and yet continued in it, waiting no doubt to be summoned back to her. She hastily wiped away her tears, and folding up the precious letter which was bedewed with them, repaired to the garden, resolving not to communicate its contents, as the divulgement of expectations (considering how liable all
  • 74.
    human ones areto be disappointed) she ever considered a piece of folly. She found the prioress and Sister Mary seated under a broken and ivy-covered arch. “Jesu! my dear,” said the latter, “I thought you would never come to us. Our good mother has been keeping me here in spite of my teeth, though I told her the sweet cakes I made for tea would be burned by this time, and that, supposing you were reading a letter from Lord Mortimer, there could be no harm in my seeing you.” Amanda relieved the impatient Mary, and she took her seat. The prioress cast her piercing eyes upon her. She perceived she had been weeping, and that joy rather than sorrow caused her tears. She was too delicate to inquire into its source; but she took Amanda’s hand, and gave it a pressure, which seemed to say, “I see, my dear child, you have met with something which pleases you, and my heart sympathizes as much in your happiness as in your grief.” Amanda returned the affectionate pressure with one equally tender and a starting tear. They were soon called by Sister Mary to partake of her hot cakes, which she had made indeed in hopes of tempting Amanda to eat after her bad dinner. The whole community were assembled at tea when the doctor entered the parlor. Amanda blushed and looked grave at his first entrance; but he soon rallied her out of her gravity. And when the prioress and the nuns, according to custom, had withdrawn to evening vespers, he said, with a significant smile, “he feared she had not attended as much as he wished she should to the contents of the book he had last brought her.” She saw by his manner he was acquainted with her situation relative to Lord Mortimer, and therefore replied by saying, “that perhaps, if he knew the motives which influenced her conduct, he would not think her wrong in disregarding what he had just mentioned.” She also said, “she detested all kinds of stratagem, and was really displeased with him for practising one upon her.” “In a good cause,” he said, “he should never hesitate using one. Lord Mortimer was the finest young fellow he had ever seen, and had won his favor, and the best wishes of his heart, from the first moment that he beheld him. He made me contrive,” continued the
  • 75.
    doctor, “a storyto gain admission to your ladyship, and when I found him so dreadfully anxious about you, I gave you credit (as I had then no opportunity of judging for myself) for all the virtues and graces he ascribed to you, and which I have since perceived you to possess. You smile, and look as if you would call me a flatterer; seriously, I assure you I am not one. I really think you worthy of Lord Mortimer, and I assure you that is as great a compliment as could be paid any woman. His mind was troubled with grief; he revealed his troubles and perplexities to me, and after hearing them, no good Christian ever prayed more devoutly for another than I prayed for your recovery, that all your sorrows, like a novel, might terminate in marriage.” “You are obliging in your wishes,” said Amanda, smiling. “Faith, I am sincere in them,” exclaimed he, “and do not know when I have been so disconcerted as at things not turning out smoothly between you and his lordship; but I will not despair. In all my troubles, and Heaven has given me my share, I ever looked to the bright side of things, and shall always do so for my friends. I yet expect to see you settled at Castle Carberry, and to be appointed myself physician-general to your ladyship’s household.” The mention of an event yet so uncertain greatly agitated Amanda; she blushed and turned pale alternately, and convinced her good- natured but loquacious friend, he had touched a chord which could not bear vibration. He hastily changed the discourse, and as soon as he saw her composed, rose to take his leave. Amanda detained him for a minute, to try and prevail on him to take a ten-guinea note; but he was inflexible, and said with some archness, “till the disorder which preyed upon Lord Mortimer’s heart was in some degree alleviated, he would receive no recompense for his visits, which he assured Amanda, from time to time, he would continue to pay her, adding, a certain person had enjoined him now and then to take a peep within the holy walls of St. Catherine’s.” The next morning Amanda set about a temporary arrangement of her affairs. She presented thirty guineas to the sisterhood, which, with much difficulty, she forced them to accept, though, in reality, it was much required by them. But when she came to speak of paying
  • 76.
    for a continuance,they positively declared they would agree to no such thing, as she had already so liberally rewarded them for any expense they had incurred on her account. She told them that if they would not agree to be paid for lodging and board, she would certainly leave them, though such a step was contrary to her inclinations; she assured them also she was at present well able to pay. At last it was settled she should give them at the rate of forty pounds a-year—a salary they thought extremely ample, considering the plain manner in which they lived. She then had all the things which belonged to her father and herself brought to the convent, and had the former, with whatever she did not immediately want, nailed up in a large chest, that on a short notice they might be removed. Her harp and guitar she had, in her distress, proposed sending back to the person in Dublin from whom they were purchased, to sell for her; but she now determined to keep those presents of her beloved father, except again urged by necessity to part with them. She had a variety of materials for painting and working, and proposed employing herself in executing pieces in each way, not only as a means of amusing her time, but as a resource on an evil day; thus wisely making use of the present sunshine, lest another storm should arise which she should not be so well able to struggle against.
  • 77.
  • 78.
    “In struggling withmisfortunes Lies the proof of virtue,”—Shakspeare. The turbulence of grief, and the agitation of suspense, gradually lessened in the mind of Amanda, and were succeeded by a soft and pleasing melancholy, which sprang from the consciousness of having always, to the best of her abilities, performed the duties imposed upon her, and supported her misfortunes with placid resignation. She loved to think on her father, for amidst her sighs for his loss were mingled the delightful ideas of having ever been a source of comfort to him, and she believed, if departed spirits were allowed to review this world, his would look down upon her with delight and approbation at beholding her undeviating in the path he had marked out for her to take. The calm derived from such meditations she considered as a recompense for many sorrows; it was such, indeed, as nothing earthly gives, or can destroy, and what the good must experience, though “amidst the wreck of matter and the crush of worlds.” She tried to prevent her thoughts from wandering to Lord Mortimer, as the surest means of retaining her composure, which fled whenever she reflected on the doubtful balance in which her fate yet hung concerning him. The solitude of St. Catherine’s was well adapted to her present situation and frame of mind. She was neither teased with impertinent or unmeaning ceremony, but perfect mistress of her own time and actions, read, worked, and walked, as most agreeable to herself. She did not extend her walks beyond the convent, as the scenes around it would awaken remembrances she had not sufficient fortitude to bear; but the space it covered was ample enough to afford her many different and extensive rambles. And of a still evening, when nothing but the lowing of the cattle, or the buzzing of the summer flies, was to be heard, she loved to wander through the
  • 79.
    solemn and romanticruins, sometimes accompanied by a nun, but much oftener alone. A fortnight had elapsed in this manner since Lord Mortimer’s departure, when, one morning, a carriage was heard driving across the common and stopping at the outer gate of St. Catherine’s. Amanda, who was sitting at work in the parlor with the prioress, started in a universal trepidation at the sound. It may be easily imagined the idea of Lord Mortimer was uppermost in her thoughts. The door opened in a few minutes, and, to her great astonishment, Mrs. Kilcorban and her two daughters made their appearance. Agitation and surprise prevented Amanda from speaking; she curtseyed, and motioned them to be seated. The young ladies saluted her with an icy civility, and the mother treated her with a rude familiarity, which she thought herself authorized in using to one so reduced in circumstances as Amanda. “Dear me,” cried she, “you can’t think, child, how shocked we have all been to hear of your misfortunes. We only returned to the country yesterday, for we have been in town the whole winter, and to be sure a most delightful winter we have had of it—such balls, such routs, such racketings; but, as I was going to say, as soon as we came home I began, according to my old custom, to inquire after all my neighbors; and to be sure the very first thing I heard of was the poor captain’s death. Don’t cry, my dear, we must all go one time or another; those are things, of course, as the doctor says in his sermon; so, when I heard of your father’s death and your distress, I began to cast about in my brains some plan for helping you; and at last I hit upon one which, says I to the girls, will delight the poor soul, as it will give her an opportunity of earning decent bread for herself. You must know, my dear, the tutoress we brought to town would not come back with us —a dirty trollop, by the bye, and I think her place would be quite the thing for you. You will have the four young girls to learn French and work too, and I will expect you, as you have a good taste, to assist the eldest Miss Kilcorbans in making up their things and dressing. I give twenty guineas a-year. When we have no company, the tutoress
  • 80.
    always sits atthe table, and gets, besides this, the best of treatment in every respect.” A blush of indignation had gradually conquered Amanda’s paleness during Mrs. Kilcorban’s long and eloquent speech. “Your intentions may be friendly, madam,” cried she, “but I must decline your proposal.” “Bless me, and why must you decline it? perhaps you think yourself not qualified to instruct; indeed, this may be the case, for people often get credit for accomplishments they do not possess. Well, if this is so, I am still content to take you, as you were always a decent behaved young body. Indeed, you cannot expect I should give you twenty guineas a-year. No, no, I must make some abatement in the salary, if I am forced to get masters to help you in learning the girls.” “Miss Fitzalan, madam,” exclaimed the prioress, who had hitherto continued silent, “never got credit for accomplishments which she did not possess; her modesty has rather obscured than blazoned forth her perfections; she does not, therefore, madam, decline your offer from a consciousness of inability to undertake the office of an instructor, but from a conviction she never could support impertinence and folly; should her situation ever require her to exert her talents for subsistence, I trust she will never experience the mortification of associating with those who are insensible of her worth, or unwilling to pay her the respect she merits.” “Hoity, toity,” cried Mrs. Kilcorban, “what assurance! Why, madam, many a better man’s child would be glad to jump at such an offer.” “Dear madam,” said Miss Kilcorban, “perhaps the young lady has a better settlement in view. We forget Lord Mortimer has been lately at Castle Carberry, and we all know his lordship is a friend to Captain Fitzalan’s daughter.” “Or perhaps,” cried Miss Alicia, in a giggling tone, “she means to be a nun.” “Indeed, I suppose she means to be nothing good,” rejoined Mrs. Kilcorban; “and I suppose it was by some impertinence or other she had a tiff with Lady Greystock. Lord! (looking round the room), only see her music-books—her harp—her guitar—as if she had nothing to do but sing and thrum away the whole day. Well, miss (rising from her chair), you may yet be sorry your friend said so much about you.
  • 81.
    I did notcome merely to offer to take you into my house, but to offer you also a good sum for your harp and guitar, supposing you had no business with such things nowadays; but I dare say you would have refused this offer.” “I certainly should, madam,” said Amanda; “it must be strong necessity which compels me to part with my beloved father’s presents.” “Well, well, child, I wish this pride of thine may not yet be humbled.” So saying, she flounced out of the room, followed by her daughters, who, under an affectation of contempt, evidently showed they were chagrined by the reception they had met. The prioress indulged herself in a long fit of laughter at the passion into which she had thrown Mrs. Kilcorban; and Amanda, who considered the lady and her daughters as the most insignificant of beings, soon recovered from the discomposure their visit had occasioned. In the course of the evening a letter was delivered her by the servant, who said the messenger who brought it waited for an answer. Amanda, in a universal trepidation, broke the seal; but, instead of Lord Mortimer’s as she expected, a hand, to her entirely new, struck her view:— TO MISS FITZALAN. My dear Creature,—I think I never was so diverted in my life as at the account my mother and sisters gave of the reception they met with from you to-day at St. Catherine’s. I vow to God it was excellent. Nor can I help still wondering at their absurdity, in thinking such a devilish fine girl as you are would sacrifice your time in instructing a parcel of chits, when it can be devoted to so much better a purpose! To be brief, my dear girl, I will take you immediately under my protection, if not your own fault, bring you to Dublin, settle you in elegant lodgings with a handsome allowance, and not only make you, but declare you to be, the grand Sultana of my affection; a situation which, I can assure you, you will not be a little envied enjoying. In your answer to this, I shall expect to hear when I may have the felicity of bringing you from obscurity, to the brilliant scene you
  • 82.
    were formed toornament. Adieu, my dear. Believe me your devoted, B. Kilcorban. The indignation which filled Amanda’s breast at reading this scrawl cannot be expressed. Her blood seemed to boil in her veins. It was some time ere she could sufficiently compose herself to acquaint the prioress with the cause of her agitation. It was then agreed that the letter should be returned with the following lines written on it:— The author of this effusion of ignorance and impertinence has already inspired all the contempt he merits. Should he repeat his insolence, something even more mortifying than contempt— chastisement—must ensue. That a repetition of this kind would be the case, she did not believe. From Kilcorban she had no reason to suspect either the perseverance or designs of Belgrave. One was a libertine from principle, the other she believed from fashion; and that to pique his pride would be a sure method of getting rid of him. But the calm she had for some time experienced was destined to be interrupted. The next morning brought Father O’Gallaghan, the little fat priest (of whom we have made mention before in our pages), to the convent. He was not the officiating priest; but notwithstanding this, paid many visits to the sisterhood, with whom he was a great favorite; he had been much concerned about Amanda’s illness. She was sitting alone in the parlor, drawing, when he entered it. He seated himself by her, and the expression of his countenance seemed to declare his heart was brimful of something pleasant. “You won’t be offended now, my dear sowl,” said he, smirking up in her face, “with a body for asking you how you would like to leave this dismal solitude and have a comfortable home of your own, where you might see your own friends, and have everything warm and cosy about you?” “Why,” said Amanda, “though I do not consider this a dismal solitude, yet, to be sure, I should have no
  • 83.
    objection to apleasant settled habitation.” “Ay, I always thought you a sensible young body. Well, and what would you say to the person then who could point out such a habitation? Ay, you little rogue, who could say they had just such a one in their eye for you.” Amanda stared at him with astonishment. She had at first believed him jesting, but now found him serious. “Ay, faith, my dear creature,” cried he, continuing his discourse with a look of the most perfect satisfaction, “I have an offer to make you, which, I believe, would make many girls jump out of their skins with joy to hear. You remember the O’Flannaghans, I am sure, where you took tea last summer. Well, the eldest of the sons (as honest a lad as ever broke bread) cast a sheep’s eye upon you then. But what with your going from the country, and some other matters, he thought there was no use then in revealing his flame; but now, when you are come plump in his way again, faith he plucked up his courage, and told his father all about it. Old Flannaghan is a good-natured sowl, and is very willing the match should take place. They have everything snug about them. The old man will give everything into your spouse’s hands. The youngest son will live in the house till he gets married, and goes off to a farm of his own. The eldest daughter is married; the second will live with her, and the youngest will be a little handy assistant to you. So you see, you will not be tormented with a large family. There is one little matter which, to be sure, they are a little uneasy about, and that is your being of different persuasions; but says I to them, when this was started, faith, says I, you need not give yourself any trouble about it, for I know the young woman to be a discreet sowl, and I am sure she will make no hesitation about going to chapel instead of church, when she knows, too, it is for her own interest. So, my dear sowl, I hope soon to give you the nuptial benediction, and to be also your spiritual director.” Amanda had listened to this speech in silent amazement. She now rose, and would have quitted the room without speaking, to evince her contempt, had not an idea darted into her mind that such conduct perhaps might not be construed by the ignorant priest in the manner she wished. She therefore stopped, and turning to him
  • 84.
    said; “He couldnot wonder at her being offended at his pretending to answer so freely for her in matters so important as religion; but to prove how presumptuous he was in everything he said about her, she must assure him his embassy to her was equally fruitless and disagreeable; and that if Mr. O’Flannaghan consulted his own happiness, he would seek to unite himself with a woman brought up in his own sphere of life.” So saying, she quitted the room with a look of dignity which quite confounded the poor priest, who snatched up his hat in a great hurry, and waddled away to the farm, to communicate the ill-success of his visit, which had quite crushed his expectations of wedding presents and pudding feasts, which he had contemplated in idea with delight. It was some time ere Amanda recovered from the discomposure into which the impertinence of the Kilcorbans and the priest had thrown her. From what she suffered in consequence of it, she was forcibly convinced how ill-qualified she was to struggle with a world where she would be continually liable to such shocks. She had yet a hope of escaping them—a hope of being guarded by the tutelary care of Lord Mortimer, and of being one of the happiest of her sex.
  • 85.
    Welcome to OurBookstore - The Ultimate Destination for Book Lovers Are you passionate about books and eager to explore new worlds of knowledge? At our website, we offer a vast collection of books that cater to every interest and age group. From classic literature to specialized publications, self-help books, and children’s stories, we have it all! Each book is a gateway to new adventures, helping you expand your knowledge and nourish your soul Experience Convenient and Enjoyable Book Shopping Our website is more than just an online bookstore—it’s a bridge connecting readers to the timeless values of culture and wisdom. With a sleek and user-friendly interface and a smart search system, you can find your favorite books quickly and easily. Enjoy special promotions, fast home delivery, and a seamless shopping experience that saves you time and enhances your love for reading. Let us accompany you on the journey of exploring knowledge and personal growth! ebookgate.com