Transcript
Page 1: Migrating Apps To Windows Azure - Ntk 2012

Nivo 300

Migrating Applications

to Windows Azure

Blaž Lipušček,

Diventic d.o.o.

Page 2: Migrating Apps To Windows Azure - Ntk 2012

Nivo 300

Cloud Computing

• Software as a Service

• Platform as a Service

• Infrastructure as a Service

Computing capability delivered as a utility through

Internet standards and protocols.

Page 3: Migrating Apps To Windows Azure - Ntk 2012

Nivo 300

Windows Azure Fabric

• Fabric Controller is the brain of the entire ecosystem

• Highly redundant hardware and software environment

• It can‘t ever fail!

Page 4: Migrating Apps To Windows Azure - Ntk 2012

Nivo 300

The Components of Windows Azure

Page 5: Migrating Apps To Windows Azure - Ntk 2012

Nivo 300

Windows Azure Application Model

• High availability

• Scalability

• Manageability

When you deploy your application as a hosted service, Azure creates one or more virtual machines (VMs) that contain your application’s code.

Page 6: Migrating Apps To Windows Azure - Ntk 2012

Nivo 300

The Application Scenario

• Web and Worker Role

• Business logics and queues

• Backend storage (SQL, Blobs & Tables)

• On-premises resources, reporting and monitoring

Page 7: Migrating Apps To Windows Azure - Ntk 2012

Nivo 300

ASP.NET application On-premise

• ASP.NET application running on IIS

• Deployed in local data center

• Accessible via VPN (or Internet)

• Dependencies:

• SQL 2008 database

• Active Directory

• Event logs

Page 8: Migrating Apps To Windows Azure - Ntk 2012

Nivo 300

ASP.NET application in the Cloud

• ASP.NET application running on IIS ► WebRole IIS

• Deployed in local data center ► Windows Azure

• Accessible via VPN (or Internet) ► Internet

• Dependencies:

• SQL 2008 database ► SQL Azure

• Active Directory ► AD Federation Services

• Event logs ► Azure Diagnostics

Page 9: Migrating Apps To Windows Azure - Ntk 2012

Nivo 300

Deploy to Windows Azure

• Packaging and configuration

• Windows Azure Services are described as:

• Service Definition (*.csdef)

• Service Configuration (*.cscfg)

• Code is zipped and packaged with definition (*.cspkg)

• Deploy using Visual Studio

• Deploy using Windows Azure Portal

• Production and Staging deployment environments

Page 10: Migrating Apps To Windows Azure - Ntk 2012

Nivo 300

Deploy to Windows Azure

Page 11: Migrating Apps To Windows Azure - Ntk 2012

Nivo 300

Deploy to Windows Azure

Page 12: Migrating Apps To Windows Azure - Ntk 2012

Nivo 300

Running Startup Tasks

• RoleEntryPoint: OnStart, Run and OnStop,

• IISConfigurator.exe (Applications, Ports ...)

• Command line scripts

Limited or Elevated • Simple • Background • Foreground

Page 13: Migrating Apps To Windows Azure - Ntk 2012

Nivo 300

Deploy to Windows Azure

May overwrite Startup Task modifications to IIS!

Might fail or never complete!

Use in WorkerRole

Mind time restriction

Page 14: Migrating Apps To Windows Azure - Ntk 2012

Nivo 300

Deploy to Windows Azure

• Deploy multiple instances to scale

• 2 instances to cover 99.95% uptime SLA

• Upgrade domains

<ServiceDefinition name="ServiceName" upgradeDomainCount="5" ..>

Page 15: Migrating Apps To Windows Azure - Ntk 2012

Nivo 300

Manage deployments

• Delete / create

• Downtime between deployments (15 min)

• New VIP

• VIP Swap

• Easier to undo and test in production

• Identical external endpoints and two instances

• Web Deploy

• Instant update

• Should be used for development

Page 16: Migrating Apps To Windows Azure - Ntk 2012

Nivo 300

Manage deployments

• Multiple IIS Sites and Applications

• Web Roles now use full IIS not Hosted Web Core

• You can run multiple application on single instance

<WebRole name="WebRole1">

<Sites>

<Site name="Web">

<VirtualApplication name="mail" physicalDirectory="C:\Projects\WebSite"/>

<Bindings>

<Binding name="HttpIn" endpointName="HttpIn" />

</Bindings>

</Site>

<Site name="PDC" physicalDirectory="C:\Projects\SecondWebSite">

<Bindings>

<Binding name="HttpIn" endpointName="HttpIn" hostHeader=“test" />

</Bindings>

</Site>

</Sites>

Page 17: Migrating Apps To Windows Azure - Ntk 2012

Nivo 300

DEMO: Develop and deploy to

Windows Azure

• Using Visual Studio IDE and Azure SDK:

• Run Windows Azure Emulator

• Deploy to Windows Azure

• Enable Remote Desktop Connection

• Windows Azure Management Portal

https://windows.azure.com

Page 18: Migrating Apps To Windows Azure - Ntk 2012

Nivo 300

Connecting to SQL Azure

• Connecting to SQL Azure only requires change in configuration

• No support for Windows Authentication

• Encrypt credentials

Page 19: Migrating Apps To Windows Azure - Ntk 2012

Nivo 300

Connecting to SQL Azure

• A logged-in session that has been idle for 30 minutes will be

terminated automatically.

Open connections late and close early.

Page 20: Migrating Apps To Windows Azure - Ntk 2012

Nivo 300

SQL Azure Feature Limitations

• Common Language Runtime (CLR) and CLR User-Defined Types

• Integrated Full-Text Search

• SQL Server 2008 R2 Features (SQL Server Utility,

PowerShell Provider, Master Data Services)

• SQL Server Replications, Backup and Restore

CREATE DATABASE destination_database_name

AS COPY OF

[source_server_name.]source_database_name

Page 21: Migrating Apps To Windows Azure - Ntk 2012

Nivo 300

Migrate Data to SQL Azure

• SQL Azure Migration Wizard

• http://sqlazuremw.codeplex.com/

• SQL Server Integration Services (SSIS)

• Import and Export Data Wizard (SQL Server 2008 R2)

• Bulk copy utility (bcp.exe)

• Copy large data in user-specified format

• Microsoft Sync Framework 2.1

• Custom Transact-SQL script

• Brake into multiple transactions to avoid conn-losses

Page 22: Migrating Apps To Windows Azure - Ntk 2012

Nivo 300

Troubleshooting SQL Azure

• Service Unavailable or Does Not Exist

• Check if you are unable to resolve the name

• Firewall blocking port 1433 used by SQL Azure

• Using proxy server not configured properly

• General Network Errors

• Connection is idle for an extended period of time.

• Connection consumes an excessive amount of resources

• Connection holds onto a transaction for an extended period of time

• If the server is too busy

https://www.windowsazure.com/en-us/support/service-dashboard/

Page 23: Migrating Apps To Windows Azure - Ntk 2012

Nivo 300

DEMO: Connect to SQL Azure

• Create a SQL Azure Server

• Configure Access to the SQL Azure Server

• Management Portal for SQL Azure

• SQL Azure Management Using SSMS

Page 24: Migrating Apps To Windows Azure - Ntk 2012

Nivo 300

Store Files to Blob service

• WindowsAzure.StorageClient (REST API)

Page 25: Migrating Apps To Windows Azure - Ntk 2012

Nivo 300

Grant Access to Files

• Shared Access Signatures

• Read

• Write

• Delete

• List

https://mycontainer.blob.core.windows.net/files/image.jpg?se=2011-05-

18T12%3A50%3A38Z&sr=b&sp=r&sig=EUtAbKQ%2F%2FYY7k1fJtzE6hWt%2FjadF

AqxDYh5tAPK%2FeIw%3D

Page 26: Migrating Apps To Windows Azure - Ntk 2012

Nivo 300

Grant Access to Files:

Shared Access Signatures

• Remember to use UTC on DateTime

• Azure hides resources with invalid Shared Access Signatures

• DeleteIfExists will never fail

• Make sure URL is properly encoded

Page 27: Migrating Apps To Windows Azure - Ntk 2012

Nivo 300

Security considerations

Security of the datacenter, infrastructure and the operating system are taken care of by Microsoft, application security is still the responsibility of the application owners.

• Similar to its on-premises counterpart

• Basic identity model

• Federated identity model

Page 28: Migrating Apps To Windows Azure - Ntk 2012

Nivo 300

Basic identity model

• Self-contained identity architecture

• ASP.NET identity providers

• Membership, Role, Profile, Session

• Implemented on Windows Azure Storage

Page 29: Migrating Apps To Windows Azure - Ntk 2012

Nivo 300

Basic identity model: Asp.net

Membership Provider

Page 30: Migrating Apps To Windows Azure - Ntk 2012

Nivo 300

• WS-Trust and WS-Federation specification

• Windows Identity Foundation (WIF) with ASP.NET

• Security Token Service (STS) – ADFS, Facebook ...

Federated identity model

Page 31: Migrating Apps To Windows Azure - Ntk 2012

Nivo 300

Access Control Service - ACS

Page 32: Migrating Apps To Windows Azure - Ntk 2012

Nivo 300

Hybrid Application: Service Bus Relay

The Service Bus relay is designed for the use-case of taking existing WCF web services and making those services securely accessible to solutions that reside outside the corporate perimeter.

Page 33: Migrating Apps To Windows Azure - Ntk 2012

Nivo 300

Hybrid Application: Service Bus Relay

Page 34: Migrating Apps To Windows Azure - Ntk 2012

Nivo 300

DEMO: Hybrid Application

• Configure Service Bus

• Create an On-premise Server

• Create an ASP.NET MVC 3 Azure application

• Put the pieces together

Page 35: Migrating Apps To Windows Azure - Ntk 2012

Nivo 300

Windows Azure Diagnostics

• Microsoft.WindowsAzure.Diagnostics

• Diagnostic data is held in memory buffer

• Transfer it to table storage

WebRole : RoleEntryPoint

bool OnStart()

Page 36: Migrating Apps To Windows Azure - Ntk 2012

Nivo 300

Windows Azure Diagnostics

Page 37: Migrating Apps To Windows Azure - Ntk 2012

Nivo 300

WADLogsTable,

WADPerformanceCountersTable

Page 38: Migrating Apps To Windows Azure - Ntk 2012

Nivo 300

Cost-Oriented Architecture

Architecture decisions can have profound impacts on the economics of operations for small and large enterprises.

• Availability

• Reliability

• Scalability

• Performance

Optimized Operational

Expenses

Page 39: Migrating Apps To Windows Azure - Ntk 2012

Nivo 300

Windows Azure Cost structure

In the context of the cost-oriented architecture, various decisions will impact monthly operational expenses.

• Compute charges

• Storage charges

• Charges for Data Transfer

• Add-on service charges

Compute

Storage

Transfer

Services

Page 40: Migrating Apps To Windows Azure - Ntk 2012

Nivo 300

Windows Azure Pricing Windows Azure Capability Charge

Server Usage Small: $0.12 /service-hour

Medium: $0.24/service-hour

Large: $0.48/service-hour

XLarge: $0.96/service-hour

Windows Azure Blobs and

Tables

$0.15/GB

Transactions $0.01/10K transactions

SQL Azure: Web Edition $9.99/month (1GB RDBMS)

SQL Azure: Business Edition $99.99/month (10GB RDBMS)

Windows Azure $0.15/100K message operations

Page 41: Migrating Apps To Windows Azure - Ntk 2012

Nivo 300

VPRAŠANJA?

Po zaključku predavanja, prosimo, izpolnite vprašalnik.

Vprašalniki bodo poslani na vaš e-naslov, dostopni pa

bodo tudi preko profila na spletnem portalu konference

www.ntk.si.

Najlepša hvala!

Blaž Lipušček, Diventic d.o.o.

[email protected]


Recommended