Download presentation
Presentation is loading. Please wait.
Published byViolet Armstrong Modified over 8 years ago
1
Windows Azure and Silverlight: A Match Made For the Web Matthew Kerner Program Manager Windows Azure Fabric Controller matthew.kerner@microsoft.com 1
2
Silverlight & Azure Silverlight: rich & functional UI Azure: deployment/upgrade, monitoring, throughput, scalability, geo-replication What if we connect the dots? – A little bit of Azure will go a long way for Silverlight developers Today’s talk – A Little Bit of Azure – Silverlight & Azure Design Patterns – Tips and Tricks 2
3
A LITTLE BIT OF AZURE Demo: http://powerzoom.blob.core.windows.net/supersecretslides/SuperSecret Slides.html http://powerzoom.blob.core.windows.net/supersecretslides/SuperSecret Slides.html 3
4
So What? Stop worrying about racking & stacking, OS & service deployment & servicing, monitoring No up-front capex, just pay as you grow Geo-distribution & massive scale – Energy efficiency and cost savings Developers can focus on business and customers, not operations & administration 4
5
Windows Azure Components 5 Windows Azure SDK Dev Fabric Dev Storage Application Package
6
Diversion: Service Model 6 LB Front End Roles & Interfaces ConnectionString=fabrikam.com:80 MaxTimeout=20 … ConnectionString=fabrikam.com:80 MaxTimeout=20 … Configuration Settings Update 20% of the service at any one time Policies Service Model Front End Biz Logic
7
Windows Azure Components 7 Browser Silverlight Service Management API Windows Azure SDK Dev Fabric Dev Storage Application Package Geo-Distributed Datacenters Production Fabric & Storage CDN
8
DESIGN PATTERNS Silverlight hosted on Windows Azure Silverlight accessing Windows Azure Storage Storage-Only 8
9
Pattern: Silverlight Hosted on Azure Pattern – ASP.NET website hosted in Windows Azure – XAP file hosted on the website, used in the browser – Like an on-premises website, but has the flexibility of the cloud (geo, scale, easy deployment & upgrade) Demo – Converting an existing Silverlight project to a cloud project – Running in the dev fabric – Deploying to the cloud 9 Browser Silverlight Hosted App ASP.NET XAP
10
Windows Azure Storage – Durable, highly available, highly scalable – Tables, Blobs, and Queues – REST API &.Net Storage Client Library – Pay per GB stored, transferred, and per transaction Proxy via a {ASP.NET, WCF} hosted compute service You might think to access tables directly from the browser with REST, but… – Key leakage – No authentication headers or storage client library in Silverlight – Cross-domain issues 10 Browser Silverlight Hosted App ASP.NET XAP Table Storage
11
Blob Storage Access Offload blob access directly to blob storage – Avoid load & latency for images, video, music Public anonymous access with global CDN Can serve XAP from blob storage too For some scenarios, add cross-domain policy file to the root blob container 11 Browser Silverlight Hosted App ASP.NET XAP Blob Storage XAP Media
12
Authenticated Blob Storage Access Scenarios – Paid content – Prevent deep linking (e.g. context, ad revenue) Shared access signatures (aka pre-authorized URLs) – Grant specific rights for a specific time window – Extend & revoke on demand 12
13
Pattern: Shared Access Signatures Account key is stored securely in the cloud Proxy service generates shared access signatures on client demand using that key Browser accesses blob storage directly to avoid latency & load on hosted app 13 Browser Silverlight Hosted App ASP.NET 1. Generate Shared Access Signature 2. Return the URL to the client3. Client accesses blob storage directly XAP Blob Storage Media Key
14
Sample: Shared Access Signatures 14 using Microsoft.WindowsAzure; using Microsoft.WindowsAzure.StorageClient; var csa = CloudStorageAccount.FromConfigurationSetting("StorageAccount"); var cbc = csa.CreateCloudBlobClient(); var blobRef = cbc.GetBlobReference(@"paidcontent\mysong.wma"); var sap = new SharedAccessPolicy() { SharedAccessExpiryTime = DateTime.UtcNow+TimeSpan.FromMinutes(30.0), Permissions = SharedAccessPermissions.Read }; var sas = blobRef.GetSharedAccessSignature(sap); // Keep SAS private w/SSL (distribution & in the URL itself) Response.Redirect(blobRef.Attributes.Uri + sas);
15
Compute-to-Browser Static sites may not need hosted compute Push all compute to the browser Serve XAP & media from public root container Use the CDN to serve blobs from the edge 15 Browser Silverlight Hosted App ASP.NET XAP Blob Storage Media HTML
16
TIPS, TRICKS & GOTCHAS Cloud Tips Visual Studio & Azure Silverlight WCF 16
17
Cloud Tips Crawl: dev fabric & dev storage Walk: dev fabric & prod storage Run: prod fabric & prod storage Windows Azure Diagnostics gives you visibility into the cloud from your desktop Various storage clients available (myazurestorage.com, Cerebrata, Clumsy Leaf, etc.) csmanage sample allows you to script deployment, config changes, etc 17
18
Visual Studio & Azure Use.Net Framework 3.5 in the cloud (for now) – Remove broken reference to Microsoft.CSharp Recommend built-in MVC web role – Sets Copy Local = True for System.Web.MVC Use web app (not web site) for cloud projects Adding existing roles to a cloud project – Remember to add them to the role list Adding a cloud project to an existing project – Remember to set the cloud project as the startup project 18
19
Silverlight Either Silverlight or JS debugging, but not both Add Silverlight MIME type to support Silverlight in dev fabric – Open IIS Configuration Manager – Double click MIME Types on the right hand side – Map from.xap to application/x-silverlight-app Remember to allow public access to the root blob container – Add a cross-domain policy file as necessary Smooth streaming not yet supported in Azure but progressive HTTP works 19
20
WCF WCF considerations for load-balanced endpoints – Load-balanced endpoint flags – Consider connection timeouts (1 minute) Asynchronous patterns work well – PollingDuplexHttpBinding expects affinity Store client state centrally across frontend role instances Different port mappings in the cloud – Quick: Patch port mappings in auto-generated service reference – Fancy: Generate your own metadata http://code.msdn.microsoft.com/wcfazure/Wiki/View. aspx?title=KnownIssues http://code.msdn.microsoft.com/wcfazure/Wiki/View. aspx?title=KnownIssues 20
21
Other Azure Services SQL Azure – SQL database in the cloud – Provisioned on-demand with high availability – No physical administration required Windows Azure Platform AppFabric – Service bus Connect securely between on-premise services and cloud services – Firewall traversal with message rendezvous in the cloud – Access Control Single sign-on to your service for your customers using their existing identity system – Federated identity, claims-based authentication 21
22
Summary Azure makes running services easy – Automated deployment & management – Scale – Geo-distribution Azure & Silverlight are a great match Getting Started – Install the Azure Tools for VS – Run a Silverlight app in the Dev Fabric – Run a Silverlight app in the cloud 22
23
Further Information Getting Started: http://dev.windowsazure.com/http://dev.windowsazure.com/ – VS Tools: http://go.microsoft.com/fwlink/?LinkID=128752http://go.microsoft.com/fwlink/?LinkID=128752 – Dev Portal: http://windows.azure.com/http://windows.azure.com/ – Forum: http://social.msdn.microsoft.com/forums/en-us/windowsazurehttp://social.msdn.microsoft.com/forums/en-us/windowsazure – Docs: http://msdn.microsoft.com/en-us/library/dd179442.aspxhttp://msdn.microsoft.com/en-us/library/dd179442.aspx – Blog: http://blogs.msdn.com/windowsazure/http://blogs.msdn.com/windowsazure/ Tips – Jim Nakashima’s blog (lots of tips): http://blogs.msdn.com/jnak/http://blogs.msdn.com/jnak/ – WCF on Azure Sample: http://code.msdn.microsoft.com/wcfazurehttp://code.msdn.microsoft.com/wcfazure – WCF on Azure Tips: http://code.msdn.microsoft.com/wcfazure/Wiki/View.aspx?title=KnownIssues http://code.msdn.microsoft.com/wcfazure/Wiki/View.aspx?title=KnownIssues – Additional samples: http://code.msdn.microsoft.com/windowsazuresampleshttp://code.msdn.microsoft.com/windowsazuresamples Useful PDC 2009 talks: – My First Azure App: http://microsoftpdc.com/Sessions/SVC37http://microsoftpdc.com/Sessions/SVC37 – Diagnostics on Azure: http://microsoftpdc.com/Sessions/SVC15http://microsoftpdc.com/Sessions/SVC15 – Service Management: http://microsoftpdc.com/Sessions/SVC25http://microsoftpdc.com/Sessions/SVC25 23
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.