26
Emmanuel Mesas Microsoft Western Europe [email protected] Windows® Azure™ Deep Dive Leverage Azure Services & Platform with Existing Application

Emmanuel Mesas Microsoft Western Europe [email protected] Leverage Azure Services & Platform with Existing Application

Embed Size (px)

Citation preview

Page 1: Emmanuel Mesas Microsoft Western Europe emesas@microsoft.com Leverage Azure Services & Platform with Existing Application

Emmanuel MesasMicrosoft Western [email protected]

Windows® Azure™ Deep Dive

Leverage Azure Services & Platform with Existing Application

Page 2: Emmanuel Mesas Microsoft Western Europe emesas@microsoft.com Leverage Azure Services & Platform with Existing Application

AgendaAzure Role ExplainedRoleEnvironment APIMigrating Real ApplicationInstrumenting Azure ApplicationAzure Developer and Administrator Tools

Page 3: Emmanuel Mesas Microsoft Western Europe emesas@microsoft.com Leverage Azure Services & Platform with Existing Application

Cloud Service Anatomy

Windows Azure Storage (Table, Blob, Queue)

Web RoleLB

SQL Azure Internet Services

Web Role 2 (IIS)Port 8080

Worker Role 2

Worker Role 1Web RoleWeb Role 1 (IIS)Port 80

Worker Role 2

Page 4: Emmanuel Mesas Microsoft Western Europe emesas@microsoft.com Leverage Azure Services & Platform with Existing Application

On-premises vs. Windows Azure Visual Studio Projects

Page 5: Emmanuel Mesas Microsoft Western Europe emesas@microsoft.com Leverage Azure Services & Platform with Existing Application

• Azure Solutions have a Cloud Project – Describes the platform

• Additional Entry Points in the Execution Pipeline

• Use RoleEnvironment Class for Infrastructure knowledge

• Always Copy referenced Assemblies

Differences

Page 6: Emmanuel Mesas Microsoft Western Europe emesas@microsoft.com Leverage Azure Services & Platform with Existing Application

Worker Role Call Order:1. WaWorkerHost process is started.2. Worker Role assembly is loaded and surfed for a

class that derives from RoleEntryPoint. This class is instantiated.

3. RoleEntryPoint.OnStart() is called. 4. RoleEntryPoint.Run() is called. 5. If the RoleEntryPoint.Run() method exits, the

RoleEntryPoint.OnStop() method is called . 6. WaWorkerHost process is stopped. The role will

recycle and startup again.

WorkerRole Call Order

Page 7: Emmanuel Mesas Microsoft Western Europe emesas@microsoft.com Leverage Azure Services & Platform with Existing Application

Web Role Call Order:1. WaWebHost process is started. 2. Hostable Web Core is activated. 3. Web role assembly is loaded and

RoleEntryPoint.OnStart() is called. 4. Global.Application_Start() is called. 5. The web application runs… 6. Global.Application_End() is called. 7. RoleEntryPoint.OnStop() is called. 8. Hostable Web Core is deactivated. 9. WaWebHost process is stopped.

WebRole Call Order

Page 8: Emmanuel Mesas Microsoft Western Europe emesas@microsoft.com Leverage Azure Services & Platform with Existing Application

• Infrastructure API to use from RoleEntryPoint classes

• Discover Infrastructure Resources• Local Storages• Network Endpoints (max 5)• Connection Strings• Application Roles & Other Role Instances (max 5)• Detect Infrastructure changes

RoleEnvironment API

Page 9: Emmanuel Mesas Microsoft Western Europe emesas@microsoft.com Leverage Azure Services & Platform with Existing Application

DEMO: RoleEnvironment API

Accessing Configuration & Connection StringsAccessing Role IP Addresses

Page 10: Emmanuel Mesas Microsoft Western Europe emesas@microsoft.com Leverage Azure Services & Platform with Existing Application

Migrating NerdDinner to Windows AzureWeb Application -> WebRoleSQL Server Data -> SQL AzureProfile & Membership Data -> SQL AzureIntranet Web Service -> AppFabric ServiceBus

Page 11: Emmanuel Mesas Microsoft Western Europe emesas@microsoft.com Leverage Azure Services & Platform with Existing Application

NerdDinner Web Application

SQL Databases• aspnetdb• NerdDinner

WCF ServiceIntranet Offices Location

Page 12: Emmanuel Mesas Microsoft Western Europe emesas@microsoft.com Leverage Azure Services & Platform with Existing Application

NerdDinnerAzure Application

SQL Databases• aspnetdb• NerdDinner

ServiceBus ServiceIntranet Offices Location

Page 13: Emmanuel Mesas Microsoft Western Europe emesas@microsoft.com Leverage Azure Services & Platform with Existing Application

• Add a Cloud Project to the exiting solution• Create a WebRole EntryPoint• Add Trace Information in Config file• Add DiagnosticConfigString in the Role Config

file• Copy Referenced assemblies

Migrating Web Application to WebRole

Page 14: Emmanuel Mesas Microsoft Western Europe emesas@microsoft.com Leverage Azure Services & Platform with Existing Application

DEMO: Moving NerdDinner Web Application to an Azure WebRole

Page 15: Emmanuel Mesas Microsoft Western Europe emesas@microsoft.com Leverage Azure Services & Platform with Existing Application

• Use the Azure Portal for initial creation• Use SQL Server Management Studio 2008 R2

for managing SQL Azure databases• Use SQL Azure Migration Wizard v3.2 for

analyzing and generating migration db scripts http://sqlazuremw.codeplex.com/

Migrating SQL Server Data to SQL Azure

Page 16: Emmanuel Mesas Microsoft Western Europe emesas@microsoft.com Leverage Azure Services & Platform with Existing Application

DEMO: Populate SQL Azure

Page 17: Emmanuel Mesas Microsoft Western Europe emesas@microsoft.com Leverage Azure Services & Platform with Existing Application

• Change Service and Client implementation• Add a ServiceBus Reference• Create a Service Bus namepsace• Generate a new Endpoint Address• Use a RelayBinding from Azure AppFabric SDK • Add a TransportClientEndpointBehavior for

registering the Service to the Service Bus

Migrating Intranet Service to App Fabric SB

Page 18: Emmanuel Mesas Microsoft Western Europe emesas@microsoft.com Leverage Azure Services & Platform with Existing Application

DEMO: Connecting Intranet Service with Azure AppFabric ServiceBus

Page 19: Emmanuel Mesas Microsoft Western Europe emesas@microsoft.com Leverage Azure Services & Platform with Existing Application

Instrument Azure ApplicationsWith Windows Azure Diagnostics SDK

Page 20: Emmanuel Mesas Microsoft Western Europe emesas@microsoft.com Leverage Azure Services & Platform with Existing Application

• SDK component providing distributed monitoring & data collection for cloud apps

• Support Standard Diagnostics APIs• Cloud-Friendly – Manage multiple role

instances centrally• Scalable – Built on Windows Azure Storage &

used by scale-out Windows Azure platform components

• Developer In Control – What to collect & when to collect it

Windows Azure Diagnostics

Page 21: Emmanuel Mesas Microsoft Western Europe emesas@microsoft.com Leverage Azure Services & Platform with Existing Application

• Standard WA Storage costs apply for transactions, storage & bandwidth

• Data Retention• Local buffers are aged out by the Diagnostic Monitor

according to configurable quotas• You control data retention for data in table/blob

storage• Query Performance on Tabular Data• Partitioned by high-order bits of the tick count• Query by time is efficient• Filter by verbosity level at transfer time

WA Diagnostics – Storage Consideration

Page 22: Emmanuel Mesas Microsoft Western Europe emesas@microsoft.com Leverage Azure Services & Platform with Existing Application

DEMO: Windows Azure DiagnosticsHow-to activate TracesTransfer to Azure StorageVisualize Data

Page 23: Emmanuel Mesas Microsoft Western Europe emesas@microsoft.com Leverage Azure Services & Platform with Existing Application

• Always develop in the Azure DevFabric first• Make sure you copy local assemblies not in the

Framework• Use the _CSPACK_FORCE_NOENCRYPT_ to check if

your package is valid• Check application using Cloud Resources

(Storage, Service and SQL Azure)• Remove the use of Development Storage (in

case some code uses it)

Development Best Practices

Page 25: Emmanuel Mesas Microsoft Western Europe emesas@microsoft.com Leverage Azure Services & Platform with Existing Application

Sign up at the Windows Azure platform developers’ portal:

http://www.windowsazure.com

Windows Azure accessDeveloper tools White papersSample applications

Plan pilot applications

Learn more at Microsoft’s channelnine.com

23

1

Next Step

Page 26: Emmanuel Mesas Microsoft Western Europe emesas@microsoft.com Leverage Azure Services & Platform with Existing Application