Download presentation
Presentation is loading. Please wait.
1
Switching on the cloud for Silverlight MSDN Live Meeting 27-06-2011 Gill Cleeren Microsoft Regional Director – Silverlight MVP Ordina Belgium
2
About myself... Gill Cleeren Microsoft Regional Director MVP ASP.NET.NET Architect @Ordina (www.ordina.be)www.ordina.be Speaker (TechDays, DevDays, NDC Norway, Spring Conference UK, SQL Server Saturday Switzerland, TechEd Berlin, SDC...) Visug user group lead (www.visug.be)www.visug.be Author (Silverlight 4 Data and services cookbook) Blog: www.snowball.bewww.snowball.be Email: gill@snowball.begill@snowball.be Twitter: @gillcleeren
3
Agenda What is Windows Azure? – Parts of Windows Azure – Why does a Silverlight developer need to care? – Developing for Windows Azure Required tools Emulators (“local cloud”) Azure Portal Moving Silverlight applications to the cloud – Database only – WCF What with REST – Entire Silverlight applications – RIA Services – Azure as intermediate layer for Twitter
4
Agenda (2) Using blob storage – Accessing files in blob storage – XAP hosted in blob storage (optional) Windows Phone 7 and Azure – Accessing services in the cloud
5
WHAT IS WINDOWS AZURE?
6
What is a Cloud Platform ? Jonathan Weber (The Times Online)
7
So, Windows Azure then? An operating system for the cloud Internet Scale Microsoft data centers Based on internet standards (Interopability) Features – Service Management / Scalability – Compute power – Storage Familiar tools for development
8
Windows Azure Cloud Operating System: More value than what you think of with the term “OS” however!
9
Software-as-a-Service “SaaS” Platform-as-a-Service “PaaS” Infrastructure-as-a-Service “IaaS”
10
Cloud Services Packaged Software Storage Servers Networking O/S Middleware Virtualization Data Applications Runtime You manage Infrastructure (as a Service) Storage Servers Networking O/S Middleware Virtualization Data Applications Runtime Managed by vendor You manage Platform (as a Service) Managed by vendor You manage Storage Servers Networking O/S Middleware Virtualization Applications Runtime Data Software (as a Service) Managed by vendor Storage Servers Networking O/S Middleware Virtualization Applications Runtime Data
11
Parts of Windows Azure Hosted services – Web role IIS in the cloud For running ASP.NET applications – Worker role Run any executable in the cloud (own database, server...)
12
Parts of Windows Azure (2) Azure storage – Scalable storage in the cloud – 100TB per storage account – Auto-scale to meet massive volume and throughput – Accessible via RESTful Web Service API Access from Windows Azure Compute Access from anywhere via internet Supporting.NET Client Library
13
Parts of Windows Azure (3) Azure storage – Blob storage – Table storage – Queue storage
14
Parts of Windows Azure (4) SQL Azure – Familiar SQL Server relational database model delivered as a service Highly available – Contains: Database Reporting Data sync
15
Parts of Windows Azure (5) AppFabric – Access control – Service bus – Caching
16
Why does a Silverlight developer need to care? Azure targets web applications Highly available Easy scaling – May not be important for XAP – Important for services and database
17
Developing for Windows Azure Required tools – Visual Studio (duh) – Azure SDK – Azure Tools Installs Compute emulator Storage emulator Account on Windows Azure
18
Management portal
19
MOVING SILVERLIGHT APPLICATIONS TO THE CLOUD
20
Let’s move! Silverlight applications can be “moved” to Azure on different levels – Database only – WCF/ASMX/REST services – All-in: Move the hosting site XAP in webrole XAP in blob storage – RIA Services
21
Hosting site Scenario Silverlight application Service layer (WCF, REST...) Database
22
CASE 1: DATABASE ONLY
23
Hosting site Scenario Silverlight application Service layer (WCF, REST...) Database
24
Database only Case: – A Silverlight business app – WCF services to expose the data – Data in a SQL Server 2008 database Task: move database only to the cloud
25
Database only Steps: – Create database on SQL Azure – Use Migration wizard to export database to Azure – Change connection strings in service configuration
26
DEMO Database only
27
CASE 2: WCF SERVICE
28
Hosting site Scenario Silverlight application Service layer (WCF, REST...) Database
29
WCF service Case: – Silverlight business application communicates with WCF service, service exposes data – Data is migrated to SQL Azure Task: move WCF service to Azure
30
Side information Silverlight can communicate with – ASMX – WCF (using BasicHttpBinding) Both expose a WSDL file – Used by Visual Studio to generate proxy class – Generates config containing service location in Silverlight application Possible to move existing service “use” cloud services inside VS Silverlight project
31
Silverlight and WCF service Steps: – Create Cloud project – Add webrole to contain service hosting site (ASP or WCF) – Test in compute emulator – Update Silverlight configuration to use new service address – Deploy service package to the cloud – Re-deploy new Silverlight application
32
DEMO Silverlight and WCF service
33
REST service Case: – Silverlight business application communicates with REST service, service exposes data A WCF service can be configured to work as a REST service – Data is migrated to SQL Azure Task: move REST service to Azure
34
Side information REST (REpresentational State Transfer) – Protocol based on web standards (GET, PUT...) – All information is a resource – Information exchanged over XML or JSON Using WCF, we can create REST services – Silverlight sends request to URL – Service responds with XML – Silverlight can parse the XML Possible to move the REST service to Azure
35
Silverlight and REST service Steps: – Create Cloud solution – Move service hosting site to webrole (ASP or WCF) – Test in compute emulator – Update Silverlight configuration to use new service address – Deploy service package to the cloud – Re-deploy new Silverlight application (Yes, this is identical!)
36
DEMO REST service
37
CASE 3: MOVE SILVERLIGHT TO THE CLOUD
38
Hosting site Scenario Silverlight application Service layer (WCF, REST...) Database
39
Move Silverlight to the cloud Case: – Database hosted in SQL Azure – WCF Service hosted in Windows Azure (web role) – Silverlight application and hosting website need to move to the cloud Task: – Move Silverlight hosting site to (other) web role
40
Side information Silverlight is just a XAP file, hosted inside an HTML, ASPX, PHP... page XAP file is downloaded from – Azure Hosted service – Azure Storage Site can be a web role
41
Move Silverlight to the cloud Steps: – Add second web role to cloud project OR second cloud project (accessible via port number) – (optional) Create a new hosted service for this role
42
DEMO Move Silverlight to the cloud
43
CASE 4: RIA SERVICES IN THE CLOUD
44
RIA Services in the cloud Case – Silverlight application that uses RIA Services – Server-side use of Entity Framework – Database is moved to SQL Azure Task: – All-in approach: move everything to the cloud
45
Side information RIA Services create a link between server- side and client-side project Hosting site requires configuration changes and assembly references – RIA Services is not installed on your Azure VM! Specific template exists if starting from scratch
46
RIA Services in the cloud Steps: – Add new web role to cloud project – Move service hosting site to webrole – Change configuration – Set Copy local to true for RIA Services assemblies – Deploy Silverlight XAP along with services Services can be in a different assembly, will be hosted alongside
47
DEMO RIA Services in the cloud
48
CASE 5: USE AZURE AS TWITTER INTERMEDIATE
49
Scenario Silverlight Twitter SERVICESERVICE SERVICESERVICE
50
Use Azure as Twitter intermediate Case – We want to use Twitter API in in-browser Silverlight apps Need to build intermediate service layer Task: – Use Windows Azure for this purpose
51
Side information Twitter doesn’t expose a policy file In-browser Silverlight apps need this file to access the service Intermediate service layer is required
52
DEMO Use Azure as Twitter intermediate
53
USING BLOB STORAGE
54
Blob storage Blobs can be used to – Store images and videos used in Silverlight application Possible to generate build a service that allows access for a limited time to a resource (Shared Access Signatures)
55
Blob storage Blobs can be used to Store XAP of Silverlight application Why? – Azure does not support updating just the XAP file (you can work around it using the VM Role) – Easy versioning of just the Silverlight application Things to keep in mind – The MIME type needs to be set to application/x-silverlight- app – Cross-domain issues in 2 ways! » XAP hosted in blob storage, service on your domain » “Regular” cross-domain issues
56
DEMO Using Blog Storage
57
DEMO The XAP in blob storage
58
WINDOWS PHONE AND AZURE
59
Hello? Windows Phone Windows Phone == Silverlight API Most things we looked at work for WP7 as well Different models meet – Phone = not always connected – Cloud = there when you need it 2 options – Phone “calls” cloud – Cloud “calls” phone Push notifications
60
Phone “calls” cloud These things just work – WCF/ASMX/REST service hosted in Azure HTTP-based communication – Database behind service in SQL Azure – WCF Data Services (oData) – XML/JSON/SOAP Remember: the smaller the data, the better! Note: No cross-domain policy file required!
61
Phone “calls” cloud WP7 can not work with – RIA Services – Sockets – Duplex bindings
62
DEMO WP7 and WCF Data Services in the cloud
63
Summary Silverlight apps work in harmony with Azure – Database – Service layer – Silverlight app Blob storage is useful – For resources – For XAP hosting
64
Q&A
65
THANK YOU
66
Stay up to date with MSDN Belux Register for our newsletters and stay up to date: http://www.msdn-newsletters.be – Technical updates – Event announcements and registration – Top downloads Follow our blog http://blogs.msdn.com/belux Join us on Facebook http://www.facebook.com/msdnbe http://www.facebook.com/msdnbelux LinkedIn: http://linkd.in/msdnbelux/ Twitter: @msdnbelux Download MSDN/TechNet Desktop Gadget http://bit.ly/msdntngadget
67
Switching on the cloud for Silverlight MSDN Live Meeting 27-06-2011 Gill Cleeren Microsoft Regional Director – Silverlight MVP Ordina Belgium
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.