28
Windows Azure Advanced Scenarios Name Title Microsoft Corporation

Windows Azure Advanced Scenarios

  • Upload
    hea

  • View
    58

  • Download
    0

Embed Size (px)

DESCRIPTION

Windows Azure Advanced Scenarios. Name Title Microsoft Corporation. Agenda. Startup tasks Elevated privileges Remote Desktop Network traffic rules VM role. Startup Tasks. What Are Startup Tasks?. Introduced with SDK 1.3 (PDC ‘10). Commands executed before your role is started. - PowerPoint PPT Presentation

Citation preview

Page 1: Windows Azure Advanced Scenarios
Page 2: Windows Azure Advanced Scenarios

Agenda

Startup tasksElevated privilegesRemote DesktopNetwork traffic rulesVM role

Page 3: Windows Azure Advanced Scenarios

Startup Tasks

Page 4: Windows Azure Advanced Scenarios

What Are Startup Tasks?

Page 5: Windows Azure Advanced Scenarios

Why Do We Have Startup Tasks?Sometimes setup is required before execution“At the top of the code” isn’t good enoughElevated startup task, non-elevated roleScripting often easier than C#Reusable startup tasks

“Upload a VHD” is overkillOften just need to run an MSI, unzip filesWant full PaaS experience, including patchingVM images aren’t very reusable

Page 6: Windows Azure Advanced Scenarios

Startup Task OptionsDefined in ServiceDefinition.csdefCan run elevated or notThree execution modes:

synchronous asynchronous, block shutdown

asynchronous, don’t block shutdown

Page 7: Windows Azure Advanced Scenarios

Startup Task TipsLog everything:command >> %~dp0log.txt 2>> %~dp0err.txt

/y everything:copy /y foo barecho y| cacls … [Note no space after “y”]

Use local storage (guaranteed space)Reboots are fine, but don’t enter an infinite loopUse “psexec -s” to test (“local system” is a weird user)Consider “exit /b 0”

Page 8: Windows Azure Advanced Scenarios

When Not To Use Startup TasksLong, manual, or fragile installationsUse VM Role

Things that require the IIS pool to exist alreadyUse OnStart() in an elevated web role

Processes that need to be monitored (for the most part)Easier to write proc.Start();proc.WaitForExit();

Page 9: Windows Azure Advanced Scenarios

Elevated Privileges for the RoleEntire role can run elevated<Runtime executionContext="elevated" />

For web roles, doesn’t affect web app (IIS)

Page 10: Windows Azure Advanced Scenarios

Remote Desktop

Page 11: Windows Azure Advanced Scenarios

Remote Desktop

Page 12: Windows Azure Advanced Scenarios

ROLE 1 ROLE 2IN_0

IN_1

IN_2

IN_0

IN_1

Page 13: Windows Azure Advanced Scenarios

Network Traffic Rules

Page 14: Windows Azure Advanced Scenarios

ServiceDefinition.csdef:<NetworkTrafficRules>

<OnlyAllowTrafficTo><Destinations>

<RoleEndpoint endpointName="ServiceEndpoint"roleName="WorkerRole1" />

</Destinations><WhenSource matches="AnyRule">

<FromRole roleName="WebRole1" /></WhenSource>…

Page 15: Windows Azure Advanced Scenarios

VM Role

Page 16: Windows Azure Advanced Scenarios

Only Two Differences

Who handles OS servicing

How you package/deploy your application

Page 17: Windows Azure Advanced Scenarios

Punchline: When to Use VM Role

Error-prone application installations

Long running application installations

Application installations requiring manual interaction

Page 18: Windows Azure Advanced Scenarios

VM Roles are fully integrated in the Windows Azure Platform-as-a-Service model

Page 19: Windows Azure Advanced Scenarios

1

2 A Windows Azure application runs multiple instances of each role

3 A Windows Azure application behaves correctly when any role instance fails

WA Programming Model: Three Rules

Page 20: Windows Azure Advanced Scenarios

Benefits of This Model

Page 21: Windows Azure Advanced Scenarios

Windows Azure Application Platform

Automated, Consistent Application Updates

Automated, Consistent Configuration Changes

Multi-Instance Management Scale-out

High Availability Automated, Consistent OS Servicing

Page 22: Windows Azure Advanced Scenarios

Platform Capabilities and App ContractStateless ImagesConsistent updatesConsistent configurationMulti-instance management

Multiple InstanceScale-outHigh Availability

Not all applications can be migrated!

Automated, Consistent Application Updates

Automated, Consistent Configuration Changes

Multi-Instance Management

Scale-out

High Availability

Page 23: Windows Azure Advanced Scenarios

VM Role Doesn’t Mean Single-InstanceRule #2: A Windows Azure application runs multiple instances of each roleNo high-availability without multiple instances

Page 24: Windows Azure Advanced Scenarios

VM Role Doesn’t Mean “Stateful”Rule #3: A Windows Azure application behaves correctly when any role instance failsRunning a database? Think about how the data is replicated

Page 25: Windows Azure Advanced Scenarios

The TradeoffVM roles and web/worker roles can do the same thingsWe’re back to the two differences:Who handles OS servicingHow you package/deploy your application

To choose, consider:Development cost/effortOperating cost (OS maintenance)VM startup timeSkills/resources available

Page 26: Windows Azure Advanced Scenarios

Startup tasks + elevated privileges = EVERYTHING

VM Role available for more control

Summary

Page 27: Windows Azure Advanced Scenarios

Thank You

Page 28: Windows Azure Advanced Scenarios

© 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.