Top Banner
Windows Azure Essentials Michele Leroux Bustamante
50

Windows Azure Essentials V3

Sep 08, 2014

Download

Technology

An updated version of my Windows Azure Essential session created for DevReach in Sofia Bulgaria, October 2013.
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Windows Azure Essentials V3

Windows Azure Essentials

Michele Leroux Bustamante

Page 2: Windows Azure Essentials V3

Michele Leroux Bustamante

Managing Partner, CofounderSolliance (solliance.net)

CofounderSnapboard (snapboard.com)

Microsoft Regional Director Microsoft MVP

Author, SpeakerPluralsight courses on the way!Blog: michelebusta.com

[email protected]

@michelebusta

Page 3: Windows Azure Essentials V3

Windows Azure FeaturesCompute

VirtualNetwork

TrafficManager

CDN

Storage

Queues

Storage

Tables

Storage

Blobs

SQL Database

SQL Data Sync

SQL Reporting

HDInsight (Hadoop)

Caching Recovery Services

Windows Azure Active Directory

Access Control

Media Services

Service Bus

Notification Topic

Notification Hub

Store

Web Site Cloud Service

Virtual Machine

ApplicationServices

Marketplace

DataServices

Networking

Page 4: Windows Azure Essentials V3

1. Choosing a compute model2. Scale out design and DNS3. Sending email4. Which queue should you use?5. Content and blob storage6. A few points about data7. Logs – your best friend8. Monitoring and alerts – your other best friend9. Backup, everything

Essential Tips

Page 5: Windows Azure Essentials V3

Choosing a compute model

Tip #1

Page 6: Windows Azure Essentials V3
Page 7: Windows Azure Essentials V3

IaaSVirtual Machines

Page 8: Windows Azure Essentials V3

Virtual Machine Provisioning

Choose a VMChoose a VM

Generate

Provision

Select your VHDSelect your VHD

Upload

Provision

Page 9: Windows Azure Essentials V3

• Migrate existing apps without changes

• Complex software deployment, easier with full control over VM

• Prefer IaaS and have staff for IT operations support

• SQL Server over SQL DB– VERY common choice

Why choose a VM?

Page 10: Windows Azure Essentials V3

PaaSCloud Services & Web Sites

Page 11: Windows Azure Essentials V3

Once upon a time…

There were only cloud services

…and life was simple.

Then along came web sites

…but it was just for blogs and cute little web sites, right?

Page 12: Windows Azure Essentials V3

Core Feature Comparison

Cloud Services Web SitesWIF 3.5 Required ✔ .NET 4.5

SSL ✔

Dedicated IP ✔

Performance Counters ✔ WHO CARES?

Auto-scale ✔

Global Assembly Cache ✔ WHO CARES?

Distributed Cache ✔

Custom Software ✔ Nuget (LIMITED)

VM Scale Out Control ✔

Page 13: Windows Azure Essentials V3

Web Site Drivers

• Some web site specialties:– Sites based on built-in Azure templates such

as blogs, wikis, and CMS sites

– MySQL database alternative

• In reality, many will default to web sites first unless there is a cloud service driver

Page 14: Windows Azure Essentials V3

Cloud Service Drivers

Cloud Services Web SitesControl over IIS Settings

?

Dynamic DNS ?

Internal Endpoints

Asynchronous Workers

Network

RDP ?

Non-HTTP Protocols

Control over OS UpdatesCertificate store access ?

Page 15: Windows Azure Essentials V3

Some Personal Preferences

Cloud Services Web SitesStaging, SWAP Rollback

Headless Deployment Single File Updates

Proprietary deployment Familiar deployment

Resource path changes Standard paths

If cloud services needed, deploy all cloud services

Hybrid web sites and cloud services

Built in diagnostics, tracing

Mix of logs, tracing tools

Darned Customers

Page 16: Windows Azure Essentials V3

Scale out design and DNS

Tip #2

Page 17: Windows Azure Essentials V3

What’s Your Application Architecture?

Storage Queue

SB Queue

BlobStorage

SQL AzureSQL Azure

OR

Page 18: Windows Azure Essentials V3

• VM allocations are– Security and isolation boundary– Domain or subdomain boundary– Scale-out boundary

• Save costs early on– Start with a single VM– Small instance

• Scale up and out as needed– Distribute load to separate VM as needed– Increase VM size as needed

VM Allocation Goals

Page 19: Windows Azure Essentials V3

Subscription BRegion East Asia

Subscription ARegion East Asia

Web Sites VM AllocationWeb Site Project

StandardWeb Site

Web Site Project

Standard Web

Site

Web Site Project

Standard Web

Site

Web Site Project

Standard Web

Site

VM $$$Subscription A

Region US West

VM $$$

VM $$$

Page 20: Windows Azure Essentials V3

Cloud Services VM AllocationCloud

Project

Service Definition

Service Config

Role

Site

EntryPoint

Endpoint

VM

VDir

App

$$$

Page 21: Windows Azure Essentials V3

Single Role / Site

bustacloud.com

Page 22: Windows Azure Essentials V3

Single Role / Multiple Site

bustacloud.com api.bustacloud.com

Page 23: Windows Azure Essentials V3

Single Role/ Multiple Site/ Worker

bustacloud.com api.bustacloud.com

Page 24: Windows Azure Essentials V3

Scaling Out to Multiple Roles

bustacloud.com api.bustacloud.com

Page 25: Windows Azure Essentials V3

Equivalent on Web Sites?

bustacloud.com api.bustacloud.com

Page 26: Windows Azure Essentials V3

Sending email

Tip #3

Page 27: Windows Azure Essentials V3

• Most applications require some form of email communication– Email confirmations– User notifications– Administrator alerts– Content delivery

Sending Email

Page 28: Windows Azure Essentials V3

• Local testing– Use System.Net.Mail.SmtpClient– Use Smtp4Dev to work offline

• Live testing and production– Always use a third party relay service– SendGrid gives 25,000 FREE tx/month– Sendy, AuthSmtp, Jango are alternatives

Implementation

Page 29: Windows Azure Essentials V3

• Make it configurable– Interface-based, provider swap– Disable sending to real customers in test– Gmail tip:

[email protected]

• Queue all email– Though mail is async, it can fail to send,

users don’t need to know it failed– Never lose an email

Design Recommendations

Page 30: Windows Azure Essentials V3

Which queue should you use?

Tip #4

Page 31: Windows Azure Essentials V3

Queue ComparisonService Bus Queues Storage Queues

Unlimited message lifetime

7 days expiry

Max 64K message size Max 256K message size

Max 5GB total storage Max 100TB total storageDuplicate detection

Order guarantees

Dead letter queue

Storage metrics

Purge capability

Long polling Manual back-off polling

Page 32: Windows Azure Essentials V3

Content and blob storage

Tip #5

Page 33: Windows Azure Essentials V3

• Blob Storage is the standard now– Scales across instances– Replicated – Map domain to storage account– CDN benefits– Security and shared links

Storing Content

Page 34: Windows Azure Essentials V3

Blob Storage Security

Service

Public Blob Access

createupdatedelete

read

Service

Public Container

Access

createupdatedeleteread

list

Service

Private Container

createupdatedeleteread

list

list

Service

Private Container

readaccessfor limited timewithsharedaccesskey

sharedaccesspolicy

BrowserBrowser Client

Shared AccessSignature (SAS)

>1 hour requiresauthenticationheader in request(no browser)

Page 35: Windows Azure Essentials V3

• Store content in blobs in lieu of drives• Set metadata explicitly for best results• Secure access accordingly

– From JavaScript can lease a shared key– No need to embed keys in the JS file

• Always chunk blobs for best performance

Blob Storage Recommendations

Page 36: Windows Azure Essentials V3

A few points about data

Tip #6

Page 37: Windows Azure Essentials V3

• Entity Framework 4 and earlier, issues with timeouts with SQL DB– http://blogs.msdn.com/b/appfabriccat/ar

chive/2010/12/11/sql-azure-and-entity-framework-connection-fault-handling.aspx

• Entity Framework 5+ has better reliency– Should still look at this framework

SQL DB / Entity Framework Tip

Page 38: Windows Azure Essentials V3

Don’t Drink the KoolaidnoSQLnoSQL

HadoopHadoop

Big DataBig

Data

Page 39: Windows Azure Essentials V3

• noSQL is great, but requires planning– Start relational and figure your model out

first– Get an expert involved if you need noSQL

• BigData is not for everyone– In many cases it is not needed

• Get an expert, like: Lynn Langit– www.contagiouscuriosity.com

Don’t Drink the Koolaid

Page 40: Windows Azure Essentials V3

Logs – your best friend

Tip #7

Page 41: Windows Azure Essentials V3

• Have configurable logging levels• Provide a way to quickly adjust levels• Make it dead easy for developers to

log• Provide an interface-based model for

changing environments / tools• KNOW where to get your logs!

Logging Recommendations

Page 42: Windows Azure Essentials V3

Logging Tools

Cloud Services Web SitesAzure Diagnostics / ETW✔ Log4NET

✔ ELMAH

✔ Glimpse

✔ SLAB / ETW

Page 43: Windows Azure Essentials V3

Monitoring and alerts – your other best friend

Tip #8

Page 44: Windows Azure Essentials V3

• Monitor from outside– Ping– Scripted web tests

• Monitor health from inside (agent install)– CPU usage– Memory usage– Disk IO and space

Monitoring Recommendations

Page 45: Windows Azure Essentials V3

• Azure Ping, Azure Watch• Stackify• NewRelic• App Dynamics ($$$)

Monitoring Tools

Page 46: Windows Azure Essentials V3

Backup, everything

Tip #9

Page 47: Windows Azure Essentials V3

• Daily or before features updates• Asynchronous backup to blob storage• BACPAC export/import from portal• Can use RedGate tools to schedule

and manage, or write some code to do it

Database Backups

Page 48: Windows Azure Essentials V3

• Tools make it too easy to delete items and blow away important customer data

• Backup daily or before feature updates

• Use asynchronous backup to another storage account

• Automate with power shell

Blob Storage Backups

Page 49: Windows Azure Essentials V3

Clean up or pay $$$

ONE LAST TIP

Page 50: Windows Azure Essentials V3

Thank you!

@michelebusta

michelebusta.com

linkedin.com/in/michelebusta

Michele Leroux Bustamante

http://snapboardalpha.cloudapp.net/michelebusta* MOVING TO snapboard.com/michelebusta NOV13