Windows Server 2008 for Developers - Part 1

1,477 views

Published on

Windows Server 2008 will be launched in Q1 2008. Come and learn what’s new in this release for developers.
Agenda:
Whether you are building Web applications or writing core server-based system services, Windows Server 2008 provides many new features that you can leverage to build more secure, flexible, and innovative applications. In this 2-session event we will go through the “Top 7 Ways to Light Up Your Apps on Windows Server 2008”. Demos will include IIS7, PowerShell, Transactional File System (TxF), restart/recovery APIs plus more.
For more details and the original slidedeck visit http://www.microsoft.com/uk/msdn/events/new/Detail.aspx?id=136

  • Be the first to comment

  • Be the first to like this

Windows Server 2008 for Developers - Part 1

  1. 1. for Developers Martin Parry Developer and Platform Group Microsoft [email_address] http://martinparry.com
  2. 2. Agenda <ul><li>Top 7 Ways To “Light Up” Your Apps on Windows Server 2008 </li></ul><ul><li>Part 1 emphasis on </li></ul><ul><ul><li>IIS7, PowerShell </li></ul></ul><ul><li>Part 2 emphasis on </li></ul><ul><ul><li>WER, Restart and Recovery APIs, TxF </li></ul></ul>
  3. 3. The Top 7 Ways… Part 1 <ul><li>Build More Flexible Web Applications </li></ul><ul><li>Design Highly-Manageable Applications </li></ul><ul><li>Develop Federation-Aware Applications </li></ul><ul><li>Build Connected Systems </li></ul><ul><li>Build For Scalability </li></ul><ul><li>Virtualize </li></ul><ul><li>Develop More Reliable Applications </li></ul>
  4. 4. 1. Build More Flexible Web Apps
  5. 5. IIS 7.0 Introduction <ul><li>Client version shipped with Windows Vista </li></ul><ul><ul><li>Limited throughput </li></ul></ul><ul><li>Server version will ship with WS2008 </li></ul><ul><ul><li>Currently available in RC form </li></ul></ul><ul><ul><li>More features than client </li></ul></ul>
  6. 6. IIS 6.0 Architecture
  7. 7. IIS 7.0 Architecture
  8. 8. Windows Process Activation Service <ul><li>Manages configuration </li></ul><ul><ul><li>What used to be the metabase </li></ul></ul><ul><li>Responsible for starting worker processes... </li></ul><ul><ul><li>w3wp.exe </li></ul></ul><ul><li>...and routing incoming requests to the appropriate worker process </li></ul><ul><li>Also hosts the new listener adapter interface </li></ul><ul><ul><li>You can build your own listeners for WAS </li></ul></ul>
  9. 9. IIS 6.0 Request Pipeline
  10. 10. IIS 6.0 Request Pipeline <ul><li>IIS pipeline extensible using ISAPI </li></ul><ul><ul><li>Native code </li></ul></ul><ul><ul><li>Can apply to all requests </li></ul></ul><ul><li>ASP.NET pipeline extensible using IHttpModule </li></ul><ul><ul><li>Managed code </li></ul></ul><ul><ul><li>Can only apply to requests routed via ASP.NET </li></ul></ul><ul><li>Certain pipeline elements are “always there” </li></ul><ul><ul><li>IIS authentication </li></ul></ul><ul><ul><li>Logging </li></ul></ul>
  11. 11. IIS 7.0 Request Pipeline
  12. 12. IIS 7.0 Request Pipeline <ul><li>Linear sequence of modules </li></ul><ul><li>Any module can be enabled/disabled </li></ul><ul><ul><li>Including “built-in” ones </li></ul></ul><ul><li>Modules can be managed or native code </li></ul><ul><li>Any type of module applies to any request </li></ul>
  13. 13. IIS7 Modules
  14. 14. IIS 6.0 Configuration <ul><li>IIS 6.0 (and earlier) use the metabase </li></ul><ul><ul><li>Stores all configuration information </li></ul></ul><ul><ul><li>Originally in binary form, then in XML </li></ul></ul><ul><ul><li>Hard to allow management of separate apps by different groups of people </li></ul></ul>
  15. 15. IIS 7.0 Configuration machine.config “ root” web.config web.config web.config web.config applicationHost.config
  16. 16. IIS7 Configuration
  17. 17. Building Native Modules <ul><li>Export a RegisterModule function from DLL </li></ul><ul><li>Define one or more other functions </li></ul><ul><ul><li>To process request or response </li></ul></ul><ul><li>Inside RegisterModule ... </li></ul><ul><ul><li>Hook up your other functions(s) at specific points in the pipeline </li></ul></ul><ul><ul><li>E.g. Begin, AuthN, AuthZ, ExecuteHandler, End </li></ul></ul>
  18. 18. Building Managed Modules <ul><li>Implement IHttpModule </li></ul><ul><li>Implement Init function </li></ul><ul><ul><li>Attach event handlers for specific points in the pipeline </li></ul></ul><ul><ul><li>E.g. Begin, AuthN, AuthZ, ExecuteHandler, End </li></ul></ul><ul><li>Same as existing ASP.NET HttpModules </li></ul>
  19. 19. IIS7 Managed Module
  20. 20. IIS7 Diagnostics - RSCA <ul><li>Runtime Status and Control API </li></ul><ul><li>Shows currently executing: - </li></ul><ul><ul><li>Application Pools </li></ul></ul><ul><ul><li>Requests </li></ul></ul><ul><li>Exposed via </li></ul><ul><ul><li>IIS admin tool </li></ul></ul><ul><ul><li>Programmatically via WMI and Managed OM </li></ul></ul>
  21. 21. IIS7 Diagnostics – Failed Requests <ul><li>IIS7 allows you to log trace information just for requests that fail </li></ul><ul><ul><li>For some definition of failure </li></ul></ul><ul><li>Buffers all trace output </li></ul><ul><li>Only flushes to disk if the request fails </li></ul><ul><li>Log output is XML, with a stylesheet </li></ul><ul><ul><li>Breaks down processing by module </li></ul></ul><ul><ul><li>Includes timing details for each module </li></ul></ul>
  22. 22. IIS7 – Failed Request Tracing <ul><li>Enable FREB at the Web Site level </li></ul><ul><li>Configure FREB rules at the application level </li></ul><ul><li>Each rule: - </li></ul><ul><ul><li>Specifies the type of web content it applies to </li></ul></ul><ul><ul><li>Can specify a specific failure code </li></ul></ul><ul><ul><li>Can specify a duration in seconds </li></ul></ul><ul><ul><li>Can specify a trace event severity </li></ul></ul>
  23. 23. IIS7 Failed Request Tracing
  24. 24. 2. Design Highly-Manageable Apps
  25. 25. Management in Windows Server 2008 <ul><li>MMC v3.0 </li></ul><ul><ul><li>Managed framework for building snap-ins </li></ul></ul><ul><ul><li>Microsoft.ManagementConsole namespace </li></ul></ul><ul><ul><ul><li>Ships with .NET Framework v3.0 </li></ul></ul></ul><ul><ul><li>Already seen it in use – IIS Admin Console </li></ul></ul><ul><li>Windows PowerShell </li></ul>
  26. 26. Windows PowerShell <ul><li>It’s a command-line interface! </li></ul><ul><li>Scriptable </li></ul><ul><li>Commands may be composed </li></ul><ul><li>Not based on text, based on .NET objects </li></ul><ul><li>Available for... </li></ul><ul><ul><li>Windows XP </li></ul></ul><ul><ul><li>Windows Server 2003 </li></ul></ul><ul><ul><li>Windows Vista </li></ul></ul><ul><li>Ships inside... </li></ul><ul><ul><li>Windows Server 2008 </li></ul></ul>
  27. 27. Windows PowerShell and Scripting
  28. 28. PowerShell and Developers <ul><li>Developers can create new commands </li></ul><ul><li>...and can create PowerShell “drives” </li></ul><ul><li>Excellent way to provide admin experience for your applications. </li></ul><ul><ul><li>Exchange 2007 and SQL Server 2008, for example </li></ul></ul>
  29. 29. PowerShell Cmdlets and Providers
  30. 30. 3. Develop Federation-Aware Apps
  31. 31. Developing Federated Identity Apps <ul><li>With AD FS </li></ul><ul><ul><li>Active Directory Federation Services </li></ul></ul><ul><li>Why? </li></ul><ul><ul><li>Enables cross-domain, cross-platform access to your Web applications </li></ul></ul><ul><ul><li>Provides Web SSO experience </li></ul></ul><ul><ul><li>Promotes a claims-based programming model </li></ul></ul><ul><ul><li>Achieve reach for your application </li></ul></ul><ul><ul><ul><li>Think “outside of the firewall” </li></ul></ul></ul>
  32. 32. B2B Federation Scenario Federation Trust https https https
  33. 33. Application Authorization Using Claims <ul><li>Claims </li></ul><ul><ul><li>Statements made by an authority about a user </li></ul></ul><ul><ul><li>Used for authorization purposes </li></ul></ul><ul><li>Three types of ADFS claims </li></ul><ul><ul><li>Identity </li></ul></ul><ul><ul><ul><li>Email </li></ul></ul></ul><ul><ul><ul><li>User Principal Name (UPN) </li></ul></ul></ul><ul><ul><ul><li>Common Name </li></ul></ul></ul><ul><ul><li>Group </li></ul></ul><ul><ul><li>Custom </li></ul></ul>Identity UPN: [email_address] Group Purchaser Administrator Adatum Custom DisplayName: Eric Parkinson Position: Purchasing Staff
  34. 34. Coding a Federation-Aware app <ul><li>System.Web.Security.SingleSignOn </li></ul><ul><li>System.Web.Security.SingleSignOn.Authorization </li></ul><ul><li>In code: - </li></ul><ul><ul><li>SsoId = User.Identity as SingleSignOnIdentity </li></ul></ul><ul><ul><li>SsoId.IsAuthenticated – have we a good security token? </li></ul></ul><ul><ul><li>SsoId.SecurityPropertyCollection – each item could be... </li></ul></ul><ul><ul><ul><li>Group claim, UPN claim, custom claim </li></ul></ul></ul><ul><ul><li>Application can get any/all claim details </li></ul></ul>
  35. 35. 4. Build Connected Systems
  36. 36. Windows Communication Foundation Interop with other platforms ASMX Attribute- Based Programming Enterprise Services WS-* Protocol Support WSE Message- Oriented Programming System.Messaging Extensibility Location transparency .NET Remoting
  37. 37. Sub-queues Poison Message Handling App-Specific Dead Letter Queues Transactional Remote Receive MSMQ 4.0
  38. 38. Sub-queues <ul><li>Never created explicitly </li></ul><ul><li>Accessed via DIRECT FormatName... </li></ul><ul><ul><li>DIRECT=OS:serverprivate$myqueue;mysubq </li></ul></ul><ul><li>Created at time of first Open </li></ul><ul><li>Can receive in the normal fashion </li></ul><ul><li>Can only insert with MQMoveMessage </li></ul><ul><ul><li>No managed code equivalent  </li></ul></ul>
  39. 39. Poison Message Handling <ul><li>WCF binding configuration... </li></ul><ul><ul><li><netMsmqBinding> </li></ul></ul><ul><ul><li><binding name=&quot;PoisonBinding&quot; receiveRetryCount=&quot;0“ maxRetryCycles=&quot;1“ retryCycleDelay=&quot;00:00:05“ receiveErrorHandling=&quot;Move&quot;> </binding> </li></ul></ul><ul><ul><li></netMsmqBinding> </li></ul></ul>
  40. 40. End of Part One <ul><li>Build More Flexible Web Applications </li></ul><ul><ul><li>IIS7 </li></ul></ul><ul><li>Design Highly-Manageable Applications </li></ul><ul><ul><li>Windows PowerShell, MMC3 </li></ul></ul><ul><li>Develop Federation-Aware Applications </li></ul><ul><ul><li>AD FS </li></ul></ul><ul><li>Build Connected Systems </li></ul><ul><ul><li>WCF, MSMQ 4 </li></ul></ul>
  41. 41. MSDN in the UK <ul><li>Visit http://msdn.co.uk </li></ul><ul><ul><li>Newsletter </li></ul></ul><ul><ul><li>Events </li></ul></ul><ul><ul><li>Screencasts </li></ul></ul><ul><ul><li>Blogs </li></ul></ul>

×