Upload
domenic-dorsey
View
218
Download
2
Tags:
Embed Size (px)
Citation preview
Emmanuel MesasMicrosoft Western [email protected]
Windows® Azure™ Deep Dive
Leverage Azure Services & Platform with Existing Application
AgendaAzure Role ExplainedRoleEnvironment APIMigrating Real ApplicationInstrumenting Azure ApplicationAzure Developer and Administrator Tools
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
On-premises vs. Windows Azure Visual Studio Projects
• 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
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
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
• 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: RoleEnvironment API
Accessing Configuration & Connection StringsAccessing Role IP Addresses
Migrating NerdDinner to Windows AzureWeb Application -> WebRoleSQL Server Data -> SQL AzureProfile & Membership Data -> SQL AzureIntranet Web Service -> AppFabric ServiceBus
NerdDinner Web Application
SQL Databases• aspnetdb• NerdDinner
WCF ServiceIntranet Offices Location
NerdDinnerAzure Application
SQL Databases• aspnetdb• NerdDinner
ServiceBus ServiceIntranet Offices Location
• 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
DEMO: Moving NerdDinner Web Application to an Azure 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
DEMO: Populate SQL Azure
• 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
DEMO: Connecting Intranet Service with Azure AppFabric ServiceBus
Instrument Azure ApplicationsWith 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 DiagnosticsHow-to activate TracesTransfer to Azure StorageVisualize 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
• Powershell CmdLets scripts 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
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