40
10 Ways to Guarantee Your Microsoft Azure Project Will Fail!

10 Ways to Gaurantee Your Azure Project will Fail

Embed Size (px)

DESCRIPTION

Most conference presentations will share “best practices”. That’s not this presentation. In this session we'll discuss what NOT to do. These surefire fail activities are inspired from real customer engagements (names changed to protect the innocent). Looking at the unsuccessful architecture and development patterns of others can help us not repeat the same mistakes in future cloud projects. -- This was originally presented at StirTrek 2014. --

Citation preview

Page 1: 10 Ways to Gaurantee Your Azure Project will Fail

10 Ways to Guarantee Your Microsoft Azure Project Will Fail!

Page 2: 10 Ways to Gaurantee Your Azure Project will Fail

Michael S. CollierPrincipal Cloud Architect

[email protected]@MichaelCollierwww.MichaelSCollier.com

Page 3: 10 Ways to Gaurantee Your Azure Project will Fail

15

Page 4: 10 Ways to Gaurantee Your Azure Project will Fail

Central Ohio Cloud Computing User GroupWhat• Local user group for the sharing of ideas and

learning about all things cloud computing. The group will not focus on any one vendor. Over the year there will be meetings to discuss Windows Azure, Amazon AWS, Google App Engine, and several others.

When• Second Monday of each month• 6pm – 8pmWhere• Improving EnterprisesMore Information• www.coccug.org• @coccug

April 14th

Jared Faris

Page 5: 10 Ways to Gaurantee Your Azure Project will Fail

DisclaimerThis is a talk on what NOT to do.

Inspired by real projects . . . . Real people did this stuff!

Names withheld to protect the“innocent”.

Do and you will #FAILand you’re paying me a lot of money to fix your $^!+ . . . . Justice is

ServedImage courtesy of http://cheezburger.com/8106642432

Page 6: 10 Ways to Gaurantee Your Azure Project will Fail

http://3.bp.blogspot.com/-3d9Cp2RCaH8/TalXvZKqqDI/AAAAAAAAFUc/0j4E-2rJ6qw/s1600/angry-baby-6.jpg

More PowerPoint?!?

Page 7: 10 Ways to Gaurantee Your Azure Project will Fail

#10 – Lack of AutomationManual deployments . . . #1 technique

Page 8: 10 Ways to Gaurantee Your Azure Project will Fail

#10 – Lack of AutomationUse PowerShell to script the process

New-AzureService -ServiceName $MyServiceName -Location $MyServiceLocation

New-AzureStorageAccount -StorageAccountName $MyStorageAccountName `-Location $MyStorageLocation -Verbose

New-AzureSqlDatabaseServer –AdministratorLogin $credential.UserName `-AdministratorLoginPassword ` $credential.GetNetworkCredential().Password `-Location $Location

New-AzureDeployment -ServiceName $MyServiceName -Slot Production `-Configuration $MyConfigurationFilePath -Package $MyPackageFilePath

New-AzureQuickVM -Windows -ServiceName $svcName -Name $vmName `-ImageName $image.ImageName -Location $location -AdminUsername $user -Password $pass

Page 9: 10 Ways to Gaurantee Your Azure Project will Fail

#9 – Poor Subscription SegregationSingle sub for Development, QA, and

Production

“Did I do that?”

Quotas

Page 10: 10 Ways to Gaurantee Your Azure Project will Fail

#8 – Failure to Understand Core Features

Endpoint Protection for Windows Azure is ooooold.

You want it, you install & manage it.

FALSEMicrosoft Azure provides anti-virus protection

Page 11: 10 Ways to Gaurantee Your Azure Project will Fail

#8 – Failure to Understand Core FeaturesMicrosoft Azure automatically protects against

DDOSFALSEAzure will protect itself from attacks

What is “busy”?Being successful looks a lot like a DDOS

Be Ready!

Page 12: 10 Ways to Gaurantee Your Azure Project will Fail

#8 – Failure to Understand Core FeaturesSQL Database supports encryption (TDE)

FALSE

Understand the differences

SQL Server on an Azure VM?

!=

Page 13: 10 Ways to Gaurantee Your Azure Project will Fail

#7 – Everything has a Limit

Web Role Worker RoleStorage Queue SQL Database (Microsoft Azure)

100k’s devices1KB every 2 seconds

Page 14: 10 Ways to Gaurantee Your Azure Project will Fail

#7 – Everything has a Limit

Web Role Worker RoleStorage Queue SQL Database (Microsoft Azure)

IIS limitations

20,000 tx per account*

2,000 msgs/sec

150 GB per DB

Transient Faults / Throttling

100k’s devices1KB every 2 seconds

Page 15: 10 Ways to Gaurantee Your Azure Project will Fail

#7 – Everything has a Limit

Worker RoleOWIN/Katana

ASP.NET Web API

Worker Role

Storage Account

SQL Database (Microsoft Azure)

Batch messagesRetry

Table Storage

N

Page 16: 10 Ways to Gaurantee Your Azure Project will Fail

#6 – Infrastructure PlanningManaging infrastructure in cloud is like on-

premises

Virtual Network

CIDR /27 = 32 hosts

X10.0.0.4 10.0.0.1

210.0.0.2

010.0.0.2

810.0.0.3

6

Page 17: 10 Ways to Gaurantee Your Azure Project will Fail

#6 – Infrastructure PlanningManaging infrastructure in cloud is like on-

premises

Virtual Network

10.0.0.4 10.0.0.5 10.0.0.6 10.0.0.7 10.0.0.8

AppSubnet

Page 18: 10 Ways to Gaurantee Your Azure Project will Fail

#6 – Infrastructure PlanningManaging infrastructure in cloud is like on-

premises

Virtual Network

10.0.0.4 10.0.0.5 10.0.0.6 10.0.0.7 10.0.0.8

1. Delete logical VM.2. Create proper

network. 3. Create VMs.

AppSubnet

Page 19: 10 Ways to Gaurantee Your Azure Project will Fail

#5 – Failure to Embrace FailureConnecting to a Microsoft Azure SQL Database

public class OrderRepository{             public OrderRepository()          {                    }

      public void Add(Order order)       {          using (var ctx = new OrderDbContext())          {              ctx.Orders.Add(order);              ctx.SaveChanges();          }       }}

Page 20: 10 Ways to Gaurantee Your Azure Project will Fail

#5 – Failure to Embrace Failurepublic class OrderRepository{          private readonly RetryPolicy policy = new RetryPolicy<SqlDatabaseTransientErrorDetectionStrategy>(RetryStrategy.DefaultExponential);      public OrderRepository()          {              policy.Retrying += (sender, args) =>             {                 // Write log statement             };        }

        public void Add(Order order)         {             policy.ExecuteAction(() =>             {                 using (var ctx = new OrderDbContext())                 {                     ctx.Orders.Add(order);                     ctx.SaveChanges();                 }             });         }}

Retry FrameworksTransient Fault Handling Application Block / “TOPAZ”EF6Windows Azure Storage Client Library

Page 21: 10 Ways to Gaurantee Your Azure Project will Fail

#5 – Failure to Embrace FailureServices will fail

ScenarioSingle email providerUnknown SLARetry strategy – retry until success (infinite)

What could possibly go wrong?Didn’t have a max stop countDidn’t have an alternative providerDidn’t have a way to measure or enforce an SLA . . . . If the provider offered one.

Page 22: 10 Ways to Gaurantee Your Azure Project will Fail

#5 – Failure to Embrace FailureConstrain the RetryInvolve a humanImplement a circuit breaker pattern

More on Circuit Breaker pattern from Pattern’s & Practices - http://mcollier.net/1eCyTDu

Page 23: 10 Ways to Gaurantee Your Azure Project will Fail

#5 – Failure to Embrace Failure“Our site can’t go down. 100% uptime is the

requirement.”

NO CLOUD

FOR YOU!

. . . This is hard, and expensive.

Cost vs. Impact

Page 24: 10 Ways to Gaurantee Your Azure Project will Fail

#4 – Poor or No Scale StrategyWhat is wrong here?

web role web role

WASABi Auto-Scaler worker role

crazy.cloudapp.net

Page 25: 10 Ways to Gaurantee Your Azure Project will Fail

#4 – Poor or No Scale StrategyInclude scaler in a separate cloud service

web role web role

WASABi Auto-Scaler worker role

crazy.cloudapp.net

crazy-scale.cloudapp.net

Page 26: 10 Ways to Gaurantee Your Azure Project will Fail

#4 – Poor or No Scale StrategyInclude scaler in a separate cloud service

Page 27: 10 Ways to Gaurantee Your Azure Project will Fail

#4 – Poor or No Scale Strategy“Azure will auto-scale when we’re busy”

FALSE

InstrumentationLogs

Page 28: 10 Ways to Gaurantee Your Azure Project will Fail

#4 – Poor or No Scale Strategy“Azure will auto-scale when we’re busy”

FALSE

33% hit

25% hitX

X

Page 29: 10 Ways to Gaurantee Your Azure Project will Fail

#3 – No Load or Performance TestingScenario• 1 week before date of production launch. “Am I ready?”• Running of 4 instances of a Medium web role• Anticipated day one user load – 1 million users

web role instances

load balancer

Page 30: 10 Ways to Gaurantee Your Azure Project will Fail

#3 – No Load or Performance TestingScenario• 1 week before date of production launch. “Am I ready?”• Running of 4 instances of a Medium web role• Anticipated day one user load – 1 million users

web role instances

load balancer

Page 31: 10 Ways to Gaurantee Your Azure Project will Fail

#3 – No Load or Performance TestingThe TestReach 40 concurrent users before receiving errors and timeouts10 users PER SERVER!

The CauseNo cachingNo retryUnnecessary hits to storage layerInefficient codeNo tests

These are not “Azure” problems!

Page 32: 10 Ways to Gaurantee Your Azure Project will Fail

#2 – Throwing it Over the WallScenarioSiloed development – Ops team not involved

Ops/Security tasked with ensuring app is supportable

Didn’t follow company standards for security, DR, support process, etc.

Security Guys . . . Cloud? EW EWJimmy Fallon

Page 33: 10 Ways to Gaurantee Your Azure Project will Fail

#1 – Non-existent Instrumentation or TelemetryScenario1 week before date of production launch. “Am I ready?”

Well, we eventually log

any fatal errors, but that’s all.

OH . . .

Logs? Yeah . . .we really don’t have logs.

Let’s run some tests and look at your logs

I guess that’s better than

nothing.

We looked at Azure diagnostic logging but

didn’t see much value in it

Page 34: 10 Ways to Gaurantee Your Azure Project will Fail

#1 – Non-existent Instrumentation or Telemetry

You’re kidding? Right?

Page 35: 10 Ways to Gaurantee Your Azure Project will Fail

#1 – Non-existent Instrumentation or TelemetryInstrumentationGeneration of custom monitoring and debugging information

Page 36: 10 Ways to Gaurantee Your Azure Project will Fail

#1 – Non-existent Instrumentation or TelemetryInstrumentationGeneration of custom monitoring and debugging information

TelemetryProcess of gathering the information collected by instrumentation.

Page 37: 10 Ways to Gaurantee Your Azure Project will Fail

#1 – Non-existent Instrumentation or Telemetry

We Don’t Know What We Don’t Know

Preemptive vs. Reactionary

Recovery &Root Cause Analysis

Page 38: 10 Ways to Gaurantee Your Azure Project will Fail

What Have We Learned?3 Truths of Cloud Computing

HardwareFails

SoftwareHas Bugs

PeopleMake

Mistakes

Microsoft blog post on RCA of leap day bug in 2012

Page 39: 10 Ways to Gaurantee Your Azure Project will Fail

What Have We Learned?

Automation Subscription Management

Understand the Limits

Understand the Platform

Plan the Infrastructure

Scale StrategyLoad &

Performance Testing

Embrace Failure

Work Together

Instrumentation & Telemetry

Page 40: 10 Ways to Gaurantee Your Azure Project will Fail

Thank You!Michael S. CollierPrincipal Cloud Architect

[email protected]@MichaelCollierwww.MichaelSCollier.com