41
Converting an existing ASP.NET application to Windows Azure Maarten Balliauw – RealDolmen Blog: http://blog.maartenballiauw.be Twitter: @maartenballiauw

MSDN - Converting an existing ASP.NET application to Windows Azure

Embed Size (px)

DESCRIPTION

Put your stuff in the cloud! Windows Azure allows you to take advantage of cloud computing infranstructure for hosting, computing, and storage of your applications. In this demo filled session we take an existing ASP.Net Application and move it to be hosted in Windows Azure, while taking advantage of Windows Azure storage.

Citation preview

Page 1: MSDN - Converting an existing ASP.NET application to Windows Azure

Converting an existing ASP.NET application to Windows Azure

Maarten Balliauw – RealDolmenBlog: http://blog.maartenballiauw.be

Twitter: @maartenballiauw

Page 2: MSDN - Converting an existing ASP.NET application to Windows Azure

Who am I?

• Maarten Balliauw• Antwerp, Belgium• www.realdolmen.com• Focus on web

– ASP.NET, ASP.NET MVC, PHP, Azure, VSTS, …– MVP ASP.NET

• http://blog.maartenballiauw.be• http://twitter.com/maartenballiauw

Page 3: MSDN - Converting an existing ASP.NET application to Windows Azure

Agenda

• Windows Azure?• An existing application…• Migration paths• Considerations• Q&A

Page 4: MSDN - Converting an existing ASP.NET application to Windows Azure

Windows AzureWhat’s in the cloud?

Page 5: MSDN - Converting an existing ASP.NET application to Windows Azure

The Windows Azure Platform

• Windows Azure• SQL Azure• Windows Azure platform AppFabric

• Developer tools• Microsoft Codename “Dallas”

Page 6: MSDN - Converting an existing ASP.NET application to Windows Azure

Windows Azure

• Flexible application hosting• Lights-out service management

– Provide code & service model, hit ENTER

• Storage at massive scale

Compute StorageManagement

Page 7: MSDN - Converting an existing ASP.NET application to Windows Azure

SQL Azure

• Relational database as a service– Highly available, automatically maintained

• Extension of the SQL Server Data Platform

Database

Business AnalyticsReporting Data Sync

Page 8: MSDN - Converting an existing ASP.NET application to Windows Azure

SQL Azure

• Relational database, provided as a service– Highly symmetrical development and tooling experience

(use TDS protocol and T-SQL)– Highly scaled out, on commodity hardware– Built on the SQL Server technology foundation

• Beyond “hosted database”– High availability, DB provisioning, and DB management

are provided by the service– Pay for what you use

Page 9: MSDN - Converting an existing ASP.NET application to Windows Azure

Windows Azure AppFabric

• Secure connections between services– Across organizational boundaries

• Claims-based access control

ServiceBus

AccessControl

Page 10: MSDN - Converting an existing ASP.NET application to Windows Azure

Windows Azure AppFabric - Service Bus

• Securely connect applications– Over the internet– Across any network topology– Across organizational boundaries

• Primary application patterns– Eventing:

• Notify applications and/or devices

– Service Remoting: • Securely project on-premises services out to the cloud

– Tunneling: • App-to-app communication with NAT/Firewall traversal

Page 11: MSDN - Converting an existing ASP.NET application to Windows Azure

Windows Azure AppFabric - Access Control

• Provides outsourcing of claims-based access control for REST web services

• Key capabilities:– Usable from any platform– Low friction way to onboard new clients– Integrates with AD FS v2– Supports WRAP / SWT– Enables simple delegation

• Used today by Service Bus and “Dallas”

Page 12: MSDN - Converting an existing ASP.NET application to Windows Azure

Microsoft Codename “Dallas”

• Content brokerage and discovery platform • Available as a CTP at commercial launch

Microsoft Codename “Dallas”Information Services

Page 13: MSDN - Converting an existing ASP.NET application to Windows Azure

Introducing “Dallas”

• Content Brokerage and Discovery platform – Discover, Explore, and Use any type of content (blobs,

structured, real-time web services)– Tap into an ecosystem of global content providers– Process & analyze data

• Empowers developers of all sizes• Built on Windows Azure and SQL Azure

Page 14: MSDN - Converting an existing ASP.NET application to Windows Azure
Page 15: MSDN - Converting an existing ASP.NET application to Windows Azure
Page 16: MSDN - Converting an existing ASP.NET application to Windows Azure

Windows Azure

Page 17: MSDN - Converting an existing ASP.NET application to Windows Azure

Blob

Entities

Messages

Windows Azure Storage Concepts

http://<account>.blob.core.windows.net/<container>

http://<account>.table.core.windows.net/<table>

http://<account>.queue.core.windows.net/<queue>

Account

Container

Table

Queue

Page 18: MSDN - Converting an existing ASP.NET application to Windows Azure

Blob Storage

• Store sets of binary data– Text files, images, …

• Highly Available– Automatically scales to multiple servers and locations

• Durable– Data is replicated at least 3 times

Page 19: MSDN - Converting an existing ASP.NET application to Windows Azure

Table Storage

• Store sets of structured data– Not bound to schema!– Billions of entities (rows) and TBs of data– Automatically scales to thousands of servers as traffic

grows

• Highly Available– Can always access your data

• Durable– Data is replicated at least 3 times

Page 20: MSDN - Converting an existing ASP.NET application to Windows Azure

Table Storage Capabilities

What tables don’t do

Not relationalNo Referential Integrity

No JoinsLimited Queries

No Group byNo Aggregations

What tables can do

Transactions (limited)Very Scalable

FlexibleDurable

If these are important to you, use SQL Azure

Store LOTS of stuff Cheap

Page 21: MSDN - Converting an existing ASP.NET application to Windows Azure

Queue Service

• Store a queue of messages– FIFO

• Can be used by multiple worker roles

Page 22: MSDN - Converting an existing ASP.NET application to Windows Azure

Windows Azure Summary

• Many is better than one– Let Microsoft worry about this

• Loose coupling– Web Role and Worker Role

• Storage choice– Azure Storage: Simple stores scale

• Table, Blob, Queue

– SQL Azure: Full RDBMS• Stored Procedures, Schema, Transactions, Views etc

Page 23: MSDN - Converting an existing ASP.NET application to Windows Azure

an existing application…

Let’s have a look at…

Page 24: MSDN - Converting an existing ASP.NET application to Windows Azure

Existing ASP.NET application

• ASP.NET Webforms• “Repository pattern”• Entity framework• Database• File storage on server• Built with no need for scale

Page 25: MSDN - Converting an existing ASP.NET application to Windows Azure

DEMOAn existing application

Page 26: MSDN - Converting an existing ASP.NET application to Windows Azure

Migration pathsThe shortest way to the cloud

Page 27: MSDN - Converting an existing ASP.NET application to Windows Azure

First things first…

• Tools:– Windows Azure SDK– Windows Azure Visual Studio Tools– www.microsoft.com/web

• New solution:– Blank “cloud service”– Add existing projects– Promote to “web role”

Page 28: MSDN - Converting an existing ASP.NET application to Windows Azure

Migration paths: hosting & file storage

• Windows Azure Web Role– Hosting the web application

• Windows Azure Blob Storage– Hosting “user uploaded content”

– Option 1: HttpHandler+ Abstraction and migration freedom- Traffic & related costs

– Option 2: public blob container + Azure CDN+ Traffic & related costs+ Pretty download URL+ Fast! Nearby!- Abstraction and migration freedom

Page 29: MSDN - Converting an existing ASP.NET application to Windows Azure

Migration paths: data

• Option 1: SQL Azure– Easiest migration path for data– More powerful RDBMS– Sync Framework Power Pack: http://bit.ly/5hTtSY – SQL Azure Migration Wizard: http

://sqlazuremw.codeplex.com/

• Option 2: Table storage– Will be cheaper in operating costs for small applications– Will probably require some rework

Page 30: MSDN - Converting an existing ASP.NET application to Windows Azure

DEMOMigrating the application

Page 31: MSDN - Converting an existing ASP.NET application to Windows Azure

ConsiderationsThink before you go cloudy…

Page 32: MSDN - Converting an existing ASP.NET application to Windows Azure

Hosting

• Migration– Will be an easy migration– Remember to use the providers from the SDK– Keep the “multiple roles” idea in mind!

• Considerations to make– Store all content in the application?

• Requires a re-deployment quite often…• Better: store more dynamic content on blob storage

– Background processing• Try moving heavy CPU tasks to worker role where appropriate

– One web role?• Will be cheaper…• But will have your application down during upgrade…• Better: always > 1 web role (at least 2)

Page 33: MSDN - Converting an existing ASP.NET application to Windows Azure

Database

• Working with EF / NHibernate / (insert ORM here)?– SQL Azure wil be easiest path, but is more expensive

• Table storage…– Will get you frustrated if your application design is bad!

(like mine in the demo)• Use simple data structures for table storage• Map these to whatever you want in your application

Page 34: MSDN - Converting an existing ASP.NET application to Windows Azure

Architecture

• Quote: “Some architectures will require rework” All of them will require rework to do it right…

• Current application architecture not suited for large scale!– I can go for multiple web roles– But not for unlimited web roles…

• Think in “multiple roles”– Web roles– Backed by worker roles where needed

• Architecture will be one of the challenges

Page 35: MSDN - Converting an existing ASP.NET application to Windows Azure

Typical Architecture

Windows Azure Storage (Blob, Table, Queue)

VIP Web Role Worker

Role

Service Unavailable

Page 36: MSDN - Converting an existing ASP.NET application to Windows Azure

Web + Worker Role Service Model

Windows Azure Storage (Blob, Table, Queue)

Worker Role

Web Role

VIP

Web Role

Worker Role

Worker Role

Worker Role

Worker RoleService Still Available

Page 37: MSDN - Converting an existing ASP.NET application to Windows Azure

Windows Azure - Coming soon…

• Programming model– Administrator privileges in the VM– Deployment of pre-configured VM images

• Still obtain the benefits of the WA service model

• Storage– User-selectable geo-locations for replicas– Secondary indices on tables

• Service management– Remote terminal server access to VMs

Page 38: MSDN - Converting an existing ASP.NET application to Windows Azure

Resources• Windows Azure

http://www.azure.com

• Steve Marxhttp://blog.smarx.com/

• Clemens Vastershttp://vasters.com/clemensv/

• Simon Guesthttp://simonguest.com/blogs/smguest

• PDChttp://microsoftpdc.com

• My bloghttp://blog.maartenballiauw.be/category/Azure.aspx

• RealDolmen blogs is running on Azure!http://www.realdolmenblogs.com

Page 39: MSDN - Converting an existing ASP.NET application to Windows Azure

AZUG.BE – Azure User Group Belgium

• Focus on the Azure Services Platform• Community-driven• Focus on architecture

– And development– And the business value of Azure

www.azug.be

Page 40: MSDN - Converting an existing ASP.NET application to Windows Azure

Questions, possibly Answers…

?Maarten Balliauw – RealDolmen

Blog: http://blog.maartenballiauw.beTwitter: @maartenballiauw

Page 41: MSDN - Converting an existing ASP.NET application to Windows Azure

© 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED

OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.