Migrating Applications to Azure Cloud
Azure migration is a porting project Gap Analysis Migration Cost Analysis Risk Reduction
Choosing a porting model
Web sites migrate into web roles Web Role Worker Role VM Role
Moving web sites to Azure is not very different then moving them to a web-farm
Can’t use Web-sites …Must use web applications (VS will port for you)
Full IIS vs. Hosted Web Core Multiple sites or virtual applications activation of WCF services over non-HTTP transports Simple, less resources
Tip: Enable Full IIS Add Sites to the csdef file….
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
Tip: Move configuration from app.config/web.config Changes in web.config – mean redeployment Move
Tip: native code ISAPI filters are tricky to import …Consider rewriting
Can you Azure this? Hello World PHP echodate
Add a Webrole.config… <application fullPath="%RoleRoot%\approot\php\php-cgi.exe"/> <WebRole name="WebRole" enableNativeCodeExecution="true …and enable native code in the.csdef
Stateless services Web Role Worker Role VM Role
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)
Tip: Make your WCF accessible to silverlight clients <!DOCTYPE cross-domain-policy SYSTEM " </cross-domain-policy Drop crossdomain.xml in the root directory of the WebRole
Stateful services/ “semi-stateful” services Web Role Worker Role VM Role
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)
Worker Role includes facilities to make migration simpler CloudDrive Mapping logs to table storage
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)
Lavaflow Apps
The lavaflow apps migrate into VM role Web Role Worker Role VM Role
Don’t COM around here no more (can’t update the registry) Use COM+ and manifest / Native C++ Wrap with WCF host
Db1 (SQL Azure) Db1 (SQL Azure) Db2 (SQL Azure) Db2 (SQL Azure) Db3 (SQL Azure Db3 (SQL Azure Db3 Archive (Table Storage) Db3 Archive (Table Storage) VM Role IIS … … Migrated SQL CLR Code NT Service
Getting Azure’s SLA means at least 2 instances Must make sure app can “scale” to two computers – even for VM role
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
SQL Migration Wizard Compatibility IssueDB 1DB2DB3DB4 Add Cluster Index to tableXXXX Dbcc reindex XXX Table hint without WITH XX CREATE UDX X DB_NAME XX IndexKey_Property X Checkpoint X SELECT INTO XX Sp_helpfile * X Sys.allocation_units * X Sys.internal_tables * X Sys.partitions * X NOT FOR REPLICATION XX BACKUP XX XP_CMDShell XX Global Temp objects XX SysJobs XX 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
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
Backup & Restore
Existing apps were developed in an age of abundance in resources Cloud apps should be more cost aware
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
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)
e.g. remember Authentication with ACS Slide by Alik Levin
Links TCO calculator onomics/ onomics/ Azure Migration Wizard ve/2010/12/02/new-full-iis-capabilities- differences-from-hosted-web-core.aspx ve/2010/12/02/new-full-iis-capabilities- differences-from-hosted-web-core.aspx Cloudoscope –
Illustrations All illustrations from Stockphoto except: – Slide 3 John Nyberg – Slide 18 deadly-lava-flow deadly-lava-flow – Slide 26 – Slide 28