4. 1. Choosing a compute model
2. Scale out design and DNS
3. Sending email
4. Which queue should you use?
5. Content and blob storage
6. A few points about data
7. Logs – your best friend
8. Monitoring and alerts – your other best friend
9. Backup, everything
Essential Tips
9. • 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?
11. 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?
12. Core Feature Comparison
Cloud Services Web Sites
WIF 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 ✔
13. 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
14. Cloud Service Drivers
Cloud Services Web Sites
Control over IIS Settings ?
Dynamic DNS ?
Internal Endpoints
Asynchronous Workers
Network
RDP ?
Non-HTTP Protocols
Control over OS Updates
Certificate store access ?
15. Some Personal Preferences
Cloud Services Web Sites
Staging, 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
17. What’s Your Application Architecture?
Storage
Queue
SB
Queue
Blob
Storage
SQL
Azure
SQL
Azure
OR
18. • 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
19. Subscription B
Region East Asia
Subscription A
Region East Asia
Web Sites VM Allocation
Web Site
Project
Standard
Web 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 $$$
20. Cloud Services VM Allocation
Cloud
Project
Service Definition
Service Config
Role
Site
EntryPoint
Endpoint
VM
VDir
App
$$$
27. • Most applications require some form of
email communication
– Email confirmations
– User notifications
– Administrator alerts
– Content delivery
Sending Email
28. • 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
29. • Make it configurable
– Interface-based, provider swap
– Disable sending to real customers in test
– Gmail tip: youraccount+suffix@gmail.com
• 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
31. Queue Comparison
Service 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 storage
Duplicate detection
Order guarantees
Dead letter queue
Storage metrics
Purge capability
Long polling Manual back-off polling
33. • Blob Storage is the standard now
– Scales across instances
– Replicated
– Map domain to storage account
– CDN benefits
– Security and shared links
Storing Content
34. Blob Storage Security
Service
Public Blob
Access
create
update
delete
read
Service
Public
Container
Access
create
update
deleteread
list
Service
Private
Container
create
update
deleteread
list
list
Service
Private
Container
read
access
for
limited
time
with
shared
access
key
shared
access
policy
BrowserBrowser Client
Shared Access
Signature (SAS)
>1 hour
requires
authentication
header in request
(no browser)
35. • 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
37. • Entity Framework 4 and earlier, issues
with timeouts with SQL DB
– http://blogs.msdn.com/b/appfabriccat/archive/2010
• Entity Framework 5+ has better reliency
– Should still look at this framework
SQL DB / Entity Framework Tip
38. Don’t Drink the Koolaid
noSQLnoSQL
HadoopHadoop
Big DataBig Data
39. • 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
41. • 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
44. • Monitor from outside
– Ping
– Scripted web tests
• Monitor health from inside (agent install)
– CPU usage
– Memory usage
– Disk IO and space
Monitoring Recommendations
47. • 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
48. • 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