270 likes | 723 Views
Windows® Azure™ Deep Dive. Leverage Azure Services & Platform with Existing Application. Emmanuel Mesas Microsoft Western Europe emesas@microsoft.com. Agenda. Prepare – Azure Infrastructure SDK Azure Role Explained RoleEnvironment API Migrate – Transfer to Azure WebRole SQL Azure
E N D
Windows® Azure™ Deep Dive Leverage Azure Services & Platform with Existing Application Emmanuel Mesas Microsoft Western Europe emesas@microsoft.com
Agenda • Prepare – Azure Infrastructure SDK • Azure Role Explained • RoleEnvironment API • Migrate – Transfer to Azure • WebRole • SQL Azure • ServiceBus • Monitor – Azure Diagnostic SDK • Instrumenting Azure Application • Azure Developer and Administrator Tools
Cloud Service Anatomy Web Role Worker Role 1 Web Role Web Role 1 (IIS) Port 80 LB Web Role 2 (IIS) Port 8080 Worker Role 2 Worker Role 2 Windows Azure Storage (Table, Blob, Queue) SQL Azure Internet Services
Azure Solutions have a VS Cloud Project – Describes the platform Additional Entry Points in the Execution Pipeline SDK expose a RoleEnvironment Class for Infrastructure knowledge Always Copy referenced Assemblies not part of the .NET Framework 3.5 SP1 Differences
Worker Role Call Order: WaWorkerHost process is started. Worker Role assembly is loaded and surfed for a class that derives from RoleEntryPoint. This class is instantiated. RoleEntryPoint.OnStart() is called. RoleEntryPoint.Run() is called. If the RoleEntryPoint.Run() method exits, the RoleEntryPoint.OnStop() method is called . WaWorkerHost process is stopped. The role will recycle and startup again. WorkerRole Call Order
Web Role Call Order: WaWebHost process is started. Hostable Web Core is activated. Web role assembly is loaded and RoleEntryPoint.OnStart() is called. Global.Application_Start() is called. The web application runs… Global.Application_End() is called. RoleEntryPoint.OnStop() is called. Hostable Web Core is deactivated. WaWebHost process is stopped. WebRole Call Order
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
DEMO: A Cloud Project and the Infrastructure SDK Accessing Configuration & Connection Strings AccessingRole IP Addresses
MigratingNerdDinner to Windows Azure Web Application -> WebRole SQL Server Data -> SQL Azure Profile & Membership Data -> SQL Azure Intranet Web Service -> AppFabric ServiceBus
SQL Databases • aspnetdb • NerdDinner NerdDinner Web Application WCF Service Intranet Offices Location
SQL Databases • aspnetdb • NerdDinner NerdDinner Azure Application ServiceBus Service Intranet Offices Location
Add a Cloud Project to the exiting solution Create a WebRoleEntryPoint Add Trace Information in Config file AddDiagnosticConfigString in the Role Config file Copy Referencedassemblies Migrating Web Application to WebRole
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
Change Service and Client implementation Add a ServiceBus Reference Create a Service Bus namepsace Generate a new EndpointAddress Use a RelayBindingfrom Azure AppFabric SDK Add a TransportClientEndpointBehavior for registering the Service to the Service Bus Migrating Intranet Service to App Fabric SB
DEMO: Connecting Intranet Service with Azure AppFabric ServiceBus
Instrument Azure Applications With Windows Azure Diagnostics SDK
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
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
DEMO: Windows Azure Diagnostics How-to activate Traces Transfer to Azure Storage Visualize Data
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
Use Blob Storage – savings by deleting the App For compatibility and external resources, use the Windows Azure Drive – App can Mount and Unmount drive on demand. Enable Azure Diagnostic API and use .NET Framework Diagnostic classes (Trace.Write) Deployment Best Practices
PowershellCmdLetsscripts http://code.msdn.microsoft.com/azurecmdlets Azure Management Console http://code.msdn.microsoft.com/AzureManagementTools Cloud Storage Studio http://www.cerebrata.com/Products/CloudStorageStudio/Default.aspx Azure Diagnostic Manager http://www.cerebrata.com/Products/AzureDiagnosticsManager/Default.aspx Azure Developer Tool bench
NextStep 1 Sign up at the Windows Azure platform developers’ portal: http://www.windowsazure.com Windows Azure access Developer tools White papers Sample applications Plan pilot applications Learn more at Microsoft’s channelnine.com 2 3