Presentation is loading. Please wait.

Presentation is loading. Please wait.

Wade Wegner Windows Azure Technical Evangelist Microsoft Corporation Real World Windows Azure Development – Tips & Tricks.

Similar presentations


Presentation on theme: "Wade Wegner Windows Azure Technical Evangelist Microsoft Corporation Real World Windows Azure Development – Tips & Tricks."— Presentation transcript:

1 Wade Wegner Windows Azure Technical Evangelist Microsoft Corporation Real World Windows Azure Development – Tips & Tricks

2 Role Enhancements Using RDP with Windows Azure Startup Tasks Externalizing State Full IIS Support Dynamic Deployment Virtual Machine Role Windows Azure Toolkit for WP7 … Demos, demos, demos! Agenda

3 I will post all code and details here: http://www.wadewegner.com/ Additional Information

4 Additional control and flexibility on the Windows Azure environment and simplified migration of existing Windows applications to Windows Azure. Windows Server 2008 R2 & IIS 7.5 Admin Access: Full administrative access to your role instances Reboot/Re-image support: Ability to easily reboot or re-image your instances Remote Desktop: Ability to use Remote Desktop with any Role type (Web, worker, VM) Network Modeling Well Known Ports: Easier to bring your existing applications to Windows Azure Port Ranges: for “inbound traffic” (as opposed to 5 in the past) Network Filters: Enable traffic filtering between roles within a service Improved Automation Startup Tasks: Includes scripts that automate the preparation and configuration of roles Role Plugins: Ability to easily include “plug-ins” in the service definition (e.g., built-in: remote desktop, virtual network, diagnostics. More samples to come) Role Enhancements

5 Portal integrated Remote Desktop access to instances within your deployment Use standard Remote Desktop client Support for all three role types – Web, worker, and VM Dynamic configuration of Remote Desktop settings Credentials Enable/Disable Expiration of credentials Ability to take instances on/off the load balancer for debugging RDP with Windows Azure

6 DEMO Configuring and Using RDP

7 Simple way to run code during your Windows Azure role’s initialization Update the ServiceDefinition.csdef file: Add the command to the package Startup Tasks

8 Simple (Default): (Synchronous) In this case the task is launched and forward progress in the instance is blocked until the task is complete. Background: (Asynchronous Fire and Forget) In this case the task is launched and role starts up continues. Foreground: (Asynchronous) Similar to Background, but role shutdown can only happen when all the foreground tasks exit. Startup Task Types

9 Create batch files to execute your commands Be sure to save as “Unicode (UTF8 without signature) codepage 65001” in Visual Studio (or use NotePad) Tip #1: Batch files

10 If you put start /w cmd in a batch file, it will pop up a new command window and wait for it to exit start /w "%~dp0\YourCommand.cmd" Useful for testing startup tasks locally Tip #2: Debug locally

11 “Simple” startup tasks (the default type) run to completion before putting the VM in the ready state If your startup tasks fails, you can’t RDP to connect and debug For development, set the startup type to “background” Then you can RDP in and see what’s happening Tip #3: Background tasks

12 Try to log to a file whenever possible, because sometimes you can’t RDP in fast enough to watch command1 >> log.txt 2>> err.txt command2 >> log.txt 2>> err.txt... Tip #4: Log to a file

13 You need to configure PowerShell to execute unsigned PowerShell scripts PowerShell 2.0 powershell -ExecutionPolicy Unrestricted./myscript.ps1 PowerShell 1.0 reg add HKLM\Software\Microsoft\PowerShell\1\ShellIds\Microsoft. PowerShell /v ExecutionPolicy /d Unrestricted /f Tip #5: PowerShell scripts

14 When installing 32-bit applications in a 64-bit environment, as an elevated startup tasks, the system can get confused The installer will use the wrong “Local AppData” folder md "%~dp0appdata“ reg add "hku\.default\software\microsoft\windows\currentversion\explorer\user shell folders" /v "Local AppData" /t REG_EXPAND_SZ /d "%~dp0appdata" /f … reg add "hku\.default\software\microsoft\windows\currentversion\explorer\user shell folders" /v "Local AppData" /t REG_EXPAND_SZ /d %USERPROFILE%\AppData\Local /f Tip #6: 32-bit Installers

15 PsExec makes it easy to launch your scripts as the system user when RDP’d into the VM psexec –s -i cmd Tip #7: PsExec & sys user

16 DEMO Windows Azure Encoder

17 Windows Azure storage? SQL Azure? … Windows Azure AppFabric Caching Externalizing State

18 DEMO Externalizing Session State with Windows Azure AppFabric Caching

19 Easy to setup and no management Simply API that’s symmetric to Windows Service AppFabric Caching Useful scenarios: Session State Page Output Caching Explicit Caching (e.g. reference, activity, resource data) Takeaways

20 Leverage the ecosystem of IIS applications, programming languages tools, and components with the revamped Web role Multiple Web sites and applications Improved iterative local development with the Development Fabric Iterative cloud development with Web Deploy and IIS Manager Host level configuration, including native modules Enhanced by Windows Azure automated service management Full IIS Support

21 Extend the Service Model

22 DEMO Multiple Applications in IIS

23 With the Windows Azure SDK 1.3 (or higher) you now have Full IIS support Multiple sites Virtual applications Virtual directories Extend the Service Model Takeaways

24 DEMO Dynamic Deployment

25 VM Role provides additional control and flexibility on the Windows Azure environment, and makes it easy to run existing Windows applications on Windows Azure. Developers / IT Pros have full control over the OS image Ability to upload your own customized WS08R2 Enterprise images Operators can reboot, reimage and Remote Desktop Virtual Machine Role

26 “… let me restate that the only reason to use them instead of worker roles is … for the migration of Windows Server applications that have long, non-scriptable or fragile installation steps.” “… While the VM role offers additional control and flexibility, the Windows Azure Web and Worker roles offer additional benefits over the VM role.” Mark Russinovich: VM Role

27 DEMO VM Role

28 Designed to make it easier for WP7 developers to use Windows Azure Includes Project templates Class libraries Services (e.g. push notification, membership, & storage) Samples Documentation Get it: http://watoolkitwp7.codeplex.com WAZ Toolkit for WP7

29 Understand the Cloud fundamentals Know what makes up the Windows Azure Platform Go build some applications! Session Takeaways

30

31 © 2011 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.


Download ppt "Wade Wegner Windows Azure Technical Evangelist Microsoft Corporation Real World Windows Azure Development – Tips & Tricks."

Similar presentations


Ads by Google