0% found this document useful (0 votes)
73 views35 pages

Arnon Rotem-Gal-Oz VP Product Delivery: Migrating Applications To Azure Cloud

The document provides tips and guidance for migrating applications to Microsoft Azure cloud services. It discusses porting web sites to web roles, moving configuration out of web.config files, enabling PHP applications on Azure, optimizing logging configuration, and addressing compatibility issues with SQL migrations. The document also highlights other considerations for cloud-based applications like monitoring, elasticity, session state, and data storage patterns.

Uploaded by

Subhash Ghosh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
73 views35 pages

Arnon Rotem-Gal-Oz VP Product Delivery: Migrating Applications To Azure Cloud

The document provides tips and guidance for migrating applications to Microsoft Azure cloud services. It discusses porting web sites to web roles, moving configuration out of web.config files, enabling PHP applications on Azure, optimizing logging configuration, and addressing compatibility issues with SQL migrations. The document also highlights other considerations for cloud-based applications like monitoring, elasticity, session state, and data storage patterns.

Uploaded by

Subhash Ghosh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 35

Arnon Rotem-Gal-Oz

VP Product Delivery
www.codevalue.net

Migrating
Applications to
Azure Cloud
Azure migration
is a porting project
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


Simple, less resources
activation of WCF services over non-HTTP
transports
Tip: Enable Full IIS
<Sites>
<Site name="Web">
<Bindings>
<Binding name="Endpoint1" endpointName="Endpoint1" />
</Bindings>
</Site>
</Sites>

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

Can you Azure this?


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>

…and enable native code in the .csdef


<WebRole name="WebRole" enableNativeCodeExecution="true
Stateless services

Web Role Worker Role VM Role


Run under full IIS to get scale out and
management capabilities

Service 1 Service 1

Service 2 Service 2

Service 3 Service 3

Web Role (full IIS) Web Role (full IIS)


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


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
private void SetupDiagnostics()
{
var config = DiagnosticMonitor.GetDefaultInitialConfiguration();
var eventsConfig = new WindowsEventLogsBufferConfiguration
{
BufferQuotaInMB = 256,
ScheduledTransferLogLevelFilter =
LogLevel.Warning,
ScheduledTransferPeriod =
TimeSpan.FromMinutes(1.0)
}; Application!*[System[Provider[@Name='MyApp']]]
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);
}

By the way this setup cost 5.25$ per year


(per instance and just for the transactions)
Lavaflow
Apps

http://www.antipatterns.com/lavaflow.htm
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


Db3
Archive
(Table Storage)

NT Service
IIS
Migrated SQL CLR Code
NT Service VM Role

Db1 Db2 Db3


(SQL Azure) (SQL Azure) (SQL Azure
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
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

SQL Sys.allocation_units *

Sys.internal_tables *

Sys.partitions *
X

Migration NOT FOR REPLICATION

BACKUP

XP_CMDShell
X

X
X

Wizard Global Temp objects

SysJobs

Sp_addMessage
X

X
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 • Geographical co-location
• Application Lifecycle Management (including • Idempotency
system & performance testing) • Import/export routines
• Archiving • Message security
• Authentication and authorization (between • Message size
tiers as well as of users) • Multi-tenancy
• CDNs • Network latency
• Charging model • Page weight
• Configuration • Reporting
• Data Access Layer • Session state
• Data encryption • SLAs (availability, performance, etc)
• Data partitioning • SQL features
• Data storage and transactions • Windows Services & batch jobs
• Dependencies and 3rd party components
• Deployment, continuous integration &
automation
• Diagnostics, logging & instrumentation
• Elasticity (dynamic, scheduled, or manual)

http://blogs.msdn.com/b/simonince/archive/2010/04/13/checklist-discussing-an-azure-migration.aspx
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
http://www.microsoft.com/windowsazure/ec
onomics/
• Azure Migration Wizard -
http://sqlazuremw.codeplex.com/
• http://blogs.msdn.com/b/windowsazure/archi
ve/2010/12/02/new-full-iis-capabilities-
differences-from-hosted-web-core.aspx
• Cloudoscope – http://www.cloudvalue.com
Illustrations
• All illustrations from iStockphoto except:
– Slide 3 John Nyberg
http://www.sxc.hu/photo/1329579
– Slide 18
http://www.majorlycool.com/item/beautiful-but-
deadly-lava-flow
– Slide 26 http://www.sxc.hu/photo/1212823
– Slide 28 http://www.sxc.hu/photo/1316747

You might also like