Download - Porting ASP.NET applications to Windows Azure

Transcript
Page 1: Porting ASP.NET applications to Windows Azure

Porting ASP.NET applications to Windows AzureGunnar PeipmanASP.NET/IIS MVP

Page 2: Porting ASP.NET applications to Windows Azure

About me

• Name: Gunnar Peipman • Job: Chief Everything Officer• Company: Peipman Consult • Hobbies: Coding, reading,

travelling, cooking, beers, heavy metal music

• MS: ASP.NET MVP (since 2008)

• Community: ENETA• Blog: gunnarpeipman.com • E-mail:

[email protected]

Page 3: Porting ASP.NET applications to Windows Azure

Agenda

• Windows Azure services• Problems with classic web applications• Think different• Sample solutions• Demo• Q&A

Page 4: Porting ASP.NET applications to Windows Azure

Windows Azure services

Page 5: Porting ASP.NET applications to Windows Azure

Windows Azure services

Web Sites

Virtual Machines

Mobile Services

Cloud Services SQL DB Storage

Media Services

Service Bus Cache

Page 6: Porting ASP.NET applications to Windows Azure

Application types

• In-premises: we host everything on our servers• Cloud: everything is hosted on Windows Azure• Hybrid: mix of cloud and in-premises

Page 7: Porting ASP.NET applications to Windows Azure

Problems in classic web applications

Page 8: Porting ASP.NET applications to Windows Azure

Local files

• Direct use of local directories to keep files• File system support is hardcoded to application• Not proper use of temporary files• Using folders above web application root

Page 9: Porting ASP.NET applications to Windows Azure

Local database

• Systems of developed and tested using SQL Server on development machine

• Database is located in network but not much test data is available

Page 10: Porting ASP.NET applications to Windows Azure

In-proc and local data

• Session data is kept in server memory• Cache data is kept in server memory• Some shared data is kept in static variables

Page 11: Porting ASP.NET applications to Windows Azure

Think different

Page 12: Porting ASP.NET applications to Windows Azure

Change in mindset

• Your code must work in multi-server environment• There will always be network• Instead of modules there are pluggable

components• Everything can be service

Page 13: Porting ASP.NET applications to Windows Azure

Breaking dependencies

• Most of the work you do is breaking dependencies• While breaking dependencies you make

generalizations• You move to modularized code• You make it easier to test your code

Page 14: Porting ASP.NET applications to Windows Azure

Sample solutions

Page 15: Porting ASP.NET applications to Windows Azure

Generalizing file storage

• Local file system: paths up to 248 chars• Blob Storage: account -> container -> blob• Other services:

o Amazono OneDriveo Google Driveo SharePoint

• Considering all those limits try to get things done

Page 16: Porting ASP.NET applications to Windows Azure

IFileClient interface

Page 17: Porting ASP.NET applications to Windows Azure

IFileClient interface

Page 18: Porting ASP.NET applications to Windows Azure

ILogger interface

Page 19: Porting ASP.NET applications to Windows Azure

ILogger interface

Page 20: Porting ASP.NET applications to Windows Azure

Sessions and cache

• Stop using in-proc session and cache• Use SQL Server or some distributed cache

• Test for performance and monitor traffic• If needed ask session values once per request

Page 21: Porting ASP.NET applications to Windows Azure

Demo: Hybrid applications

Page 22: Porting ASP.NET applications to Windows Azure

Upcoming eventsUXify Bulgaria,  June 7Sessions, training day and more http://uxify.org/

SQLSaturday #311 in October!http://www.sqlsaturday.com/311/

jQuery Bulgaria, November 22http://www.jquerybulgaria.com/

Page 23: Porting ASP.NET applications to Windows Azure

Thanks to our Sponsors:

Global Sponsor:

Gold Sponsors:

Swag Sponsors: Media Partners:

More Global Sponsors:

Silver Sponsors: