azure migration

35
Migrating Applications to Azure Cloud Arnon Rotem-Gal-Oz VP Product Delivery www.codevalue.net

Upload: arnon-rotem-gal-oz

Post on 10-May-2015

2.229 views

Category:

Technology


3 download

TRANSCRIPT

Page 1: Azure migration

Migrating Applications to

Azure Cloud

Arnon Rotem-Gal-OzVP Product Deliverywww.codevalue.net

Page 2: Azure migration

Azure migration is a porting project

Gap

Analysis

Migration Cost

Analysis

Risk

Reduction

Page 3: Azure migration

Choosing a porting model

Page 4: Azure migration

Web sites migrate into web roles

Web Role Worker Role VM Role

Page 5: Azure migration

Moving web sites to Azure is not very different then moving them to a web-farm

Page 6: Azure migration

Can’t use Web-sites

…Must use web applications (VS will port for you)

Page 7: Azure migration

Full IIS vs. Hosted Web Core

Multiple sites or virtual applications activation of WCF services over non-HTTP transports

Simple, less resources

Page 8: Azure migration

Tip: Enable Full IIS

<Sites> <Site name="Web"> <Bindings> <Binding name="Endpoint1" endpointName="Endpoint1" /> </Bindings> </Site> </Sites>

Add Sites to the csdef file….

Page 9: Azure migration

Tip: Shy away from session state

• ASP.NET cache is not shared between instances as well

• Move session to SQL azure

• Velocity for Azure is coming later in the year– You can use memcached meanwhile

Page 10: Azure migration

Tip: Move configuration from app.config/web.config

• Changes in web.config – mean redeployment• Move

Page 11: Azure migration

Tip: native code ISAPI filters are tricky to import

…Consider rewriting

Page 12: Azure migration

Can you Azure this?

<html> <head><title>Hello World PHP</title></head> <body> <?php echo 'Today is '. date('Y-m-d') ."\n"; ?> </body> </html>

Page 13: Azure migration

Add a Webrole.config…<?xml version="1.0" encoding="utf-8" ?><configuration> <system.webServer> <fastCgi> <application fullPath="%RoleRoot%\approot\php\php-cgi.exe"/> </fastCgi> </system.webServer></configuration>

<WebRole name="WebRole" enableNativeCodeExecution="true

…and enable native code in the .csdef

Page 14: Azure migration

Stateless services

Web Role Worker Role VM Role

Page 15: Azure migration

Run under full IIS to get scale out and management capabilities

Service 1

Service 2

Service 3

Web Role (full IIS)

Service 1

Service 2

Service 3

Web Role (full IIS)

Page 16: Azure migration

Tip: Make your WCF accessible to silverlight clients

<?xml version="1.0" encoding="utf-8" ?><!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd"><cross-domain-policy> <allow-http-request-headers-from domain="*" headers="*"/></cross-domain-policy

Drop crossdomain.xml in the root directory of the WebRole

Page 17: Azure migration

Stateful services/ “semi-stateful” services

Web Role Worker Role VM Role

Page 18: Azure migration

VM Role vs. Worker Role – another look

• VM role you can do anything but things are not persisted

• VM role needs manual maintenance (e.g. upgrades to OS)

Page 19: Azure migration

Worker Role includes facilities to make migration simpler

• CloudDrive

• Mapping logs to table storage

Page 20: Azure migration

Tip: pay attention to how you configure your logging

By the way this setup cost 5.25$ per year (per instance and just for the transactions)

private void SetupDiagnostics() { var config = DiagnosticMonitor.GetDefaultInitialConfiguration(); var eventsConfig = new WindowsEventLogsBufferConfiguration { BufferQuotaInMB = 256, ScheduledTransferLogLevelFilter = LogLevel.Warning, ScheduledTransferPeriod = TimeSpan.FromMinutes(1.0) }; eventsConfig.DataSources.Add("Application!*"); config.Logs.ScheduledTransferPeriod = TimeSpan.FromMinutes(1); config.Logs.ScheduledTransferLogLevelFilter = LogLevel.Verbose; config.WindowsEventLog = eventsConfig; DiagnosticMonitor.Start("Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString", config); }

Application!*[System[Provider[@Name='MyApp']]]

Page 21: Azure migration

Lavaflow Apps

http://www.antipatterns.com/lavaflow.htm

Page 22: Azure migration

The lavaflow apps migrate into VM role

Web Role Worker Role VM Role

Page 23: Azure migration

Don’t COM around here no more

• (can’t update the registry)

• Use COM+ and manifest / Native C++

• Wrap with WCF host

Page 24: Azure migration

Db1(SQL Azure)

Db2(SQL Azure)

Db3(SQL Azure

Db3Archive

(Table Storage)

VM Role

IIS

Migrated SQL CLR Code

NT Service

NT Service

Page 25: Azure migration

Getting Azure’s SLA means at least 2 instances

• Must make sure app can “scale” to two computers – even for VM role

Page 26: Azure migration

Tip: Why not host your own SQL?

• Disks partitioning is unknown and does not come with an SLA• Not guaranteed to be persistent • Need to build availability on top

Page 27: Azure migration

SQL Migration

Wizard

Compatibility Issue DB 1 DB2 DB3 DB4

Add Cluster Index to table X X X X

Dbcc reindex X X X

Table hint without WITH X X

CREATE UDX X

DB_NAME X X

IndexKey_Property X

Checkpoint X

SELECT INTO X X

Sp_helpfile * X

Sys.allocation_units * X

Sys.internal_tables * X

Sys.partitions * X

NOT FOR REPLICATION X X

BACKUP X X

XP_CMDShell X X

Global Temp objects X X

SysJobs X X

Sp_addMessage X

File_Name – false positive flag! X

Sp_spaceused X

Sp_Xml_RemoveDocument X

OpenXml X

kill X

RESTORE FILELISTONLY X

DBCC InputBuffer X

sp_OA X

sysschedules X

Page 28: Azure migration

Tip: SQL Retry • SQL Connections: Retry on failure– Connections can drop for variety of reasons

• Idleness• Transient (network) errors

• Intentional throttling– First step: reconnect immediately

• Handles idleness- and transient-disconnects

– Gateway handles connection retry for app• Connections attempted for ~30s before failure

– What to do on connection failure?• Wait (10 seconds), then retry • Change your workload if throttled

Page 30: Azure migration

Existing apps were developed in an age of abundance in resources

Cloud apps should be more cost aware

Page 31: Azure migration

What else?• Monitoring• Application Lifecycle Management (including

system & performance testing)• Archiving• Authentication and authorization (between tiers

as well as of users)• CDNs• Charging model• Configuration• Data Access Layer• Data encryption• Data partitioning• Data storage and transactions• Dependencies and 3rd party components• Deployment, continuous integration & automation• Diagnostics, logging & instrumentation• Elasticity (dynamic, scheduled, or manual)

• Geographical co-location• Idempotency• Import/export routines• Message security• Message size• Multi-tenancy• Network latency• Page weight• Reporting• Session state• SLAs (availability, performance,

etc)• SQL features• Windows Services & batch jobs

http://blogs.msdn.com/b/simonince/archive/2010/04/13/checklist-discussing-an-azure-migration.aspx

Page 32: Azure migration

E.g. Can’t host SMTP server in the cloud

• Can open TCP connection from Azure to the outside world … (and find a SMTP server)

Page 33: Azure migration

e.g. remember Authentication with ACS

Slide by Alik Levin