• No results found

Programming Microsoft Azure

N/A
N/A
Protected

Academic year: 2021

Share "Programming Microsoft Azure"

Copied!
275
0
0

Loading.... (view fulltext now)

Full text

(1)

Subhasish Ghosh | Vice President, 8K Miles Software Services, Inc.

(2)

Developing Applications Better [email protected] +91-9916043731

(3)

Architecting Microsoft Azure Solutions

(4)

Developing Applications Better [email protected] +91-9916043731

Microsoft Azure Fundamentals

(5)
(6)

Developing Applications Better [email protected] +91-9916043731

Day1

Day2

Day3

Introduction

Cloud Dev

Best Practices

Azure AD & SSO

In-depth Blog

Storage & Code

Examples

Queuing on

Microsoft Azure

Using DCS

WPI & WebMatrix3

- Demo

VM, Cloud Services

& Web Sites

-Analysis

Lab 2

Lab 4

Use Cases & Demo

Lab 7

One ASP.NET

Philosophy

Web Sites –

Deployment, Configuration & Monitoring

Data Storage

Options

Azure Service Bus

Queues

Understanding

Failures on Cloud

PowerShell Cmdlets

Microsoft Open

Technologies

Web Sites &

AutoScale – Demo

Blobs, Disks, Tables

& Queues

Azure Queues &

Service Bus Queues

– Compared

Types & Scope

Lab 8

VM Depot - Demo

Cloud Services –

Developing, Deploying &

Monitoring

Serialized Object

Graphs in JSON

(DocumentDB)

Caching on Azure:

Understanding

Redis - Tutorial

Building Telemetry

Staged Deployment

& GitHub

Integration

OWIN Katana

Project – Examples

& Demo

async in .NET 4.5

Lab 3

Microsoft Azure

Redis

Lab 6

Lab 9

(7)

Laboratories 1,2,3,4,5,6,7,8,9

1. SETUP

: Install Microsoft Azure SDK for .NET (vs2013) - 2.5, Install Visual Studio Express 2013 for Web with Microsoft Azure SDK – 2.5, Microsoft Azure

PowerShell, Open Microsoft Azure Subscription TRIAL 30-day account. Create a VM, stop & stop-deallocate using Azure PowerShell.

2. SECURITY

: Creating an ASP.NET MVC application and then adding Single Sign-On (SSO) to your application using Azure Active Directory (AAD).

3. DOCUMENTDB

: Creating a DocumentDB account; leveraging DocumentDB in a VS2013 application.

4. CLOUD SERVICES

: Creating a Cloud Services (Web & Worker Roles) application. Publishing to Microsoft Azure associated with a Microsoft Azure

Storage Account; Configure Auto-scaling.

5. AZURE REDIS CACHE

: Creating and configuring Azure Redis Cache, configuring cache clients, adding and removing objects from the cache, and storing

ASP.NET session state in the cache.

6. MONITORING CODE

: Creating a New Relic account, integrating it with an Azure Web Sites application and then publishing to Azure; and checking out

the tool.

7. SOURCE CONTROL

: Using Git in VS2013, Exploring features (branches, merging, comments etc.).

(8)
(9)
(10)
(11)
(12)
(13)
(14)
(15)
(16)
(17)
(18)
(19)
(20)
(21)
(22)

Developing Applications Better [email protected] +91-9916043731

Microsoft Open Technologies

(23)
(24)
(25)

http://katanaproject.codeplex.com/

Microsoft via Katana is building a set of components around hosting abstraction

for your applications. That hosting abstraction is 'OWIN'.

(26)

Developing Applications Better [email protected] +91-9916043731

Why OWIN?

2 Key Motivations:

- System.Web.dll (ASP.NET runtime) 12+ years old web framework

- Was built with WebForms in mind

- Not flexible enough to support modern frameworks: Web API, SignalR,

NancyFX

(27)

Why OWIN?

2 Key Motivations:

- Node.js Envy

(28)

Developing Applications Better [email protected] +91-9916043731

http://msopentech.com/

(29)
(30)

Developing Applications Better [email protected] +91-9916043731

Quick Demo

PM> Install-Package Microsoft.Owin.Host.

SystemWeb

PM> Install-Package Microsoft.Owin.

Diagnostics

(31)
(32)

Developing Applications Better [email protected] +91-9916043731

(33)

Project Katana

(34)
(35)
(36)
(37)
(38)
(39)
(40)

Developing Applications Better [email protected] +91-9916043731

Cloud Services - Azure’s original PaaS solution

You create the code, define the

configuration, and deploy it to Azure.

Azure sets up the compute environment,

runs your code then monitors and

maintains it for you.

No need to get your hands dirty with the

Virtual Machine configurations unless you

need to.

(41)
(42)
(43)
(44)

Developing Applications Better [email protected] +91-9916043731

Role

(“Template”)

Configuration

OS Family (Server 2008,

2012)

VM Size

Role Type (Web, Worker)

Endpoints

Settings

Etc…

Code

Instance

Running VM, configured,

with code deployed,

endpoints opened, etc.

Keep at least two instances

running for improved fault

tolerance and SLA.

Load balanced Endpoints

are automatically

maintained.

(45)

Role

(“Template”)

Configuration

OS Family (Server 2008,

2012)

VM Size

Role Type (Web, Worker)

Endpoints

Settings

Etc…

Code

Instance

Running VM, configured,

with code deployed,

endpoints opened, etc.

Keep at least two instances

running for improved fault

tolerance and SLA.

Load balanced Endpoints

are automatically

maintained.

*

Scale Up

Add more instances for

load balancing and

improved fault tolerance

when demand is high.

(46)

Developing Applications Better [email protected] +91-9916043731

Role

(“Template”)

Configuration

OS Family (Server 2008,

2012)

VM Size

Role Type (Web, Worker)

Endpoints

Settings

Etc…

Code

Instance

Running VM, configured,

with code deployed,

endpoints opened, etc.

Keep at least two instances

running for improved fault

tolerance and SLA.

Load balanced Endpoints

are automatically

maintained.

*

Scale Down

Remove un-needed

instances to save money

when demand is low

(47)

Workloads for Cloud Services

VM is explicitly IaaS, Cloud Services is explicitly PaaS, Web Sites is explicitly

hosting.

Cloud Services gives you administrative access to your application's VMs. Web

Sites do not provide this. This lets you install arbitrary software that your

application needs, something that's not possible with Web Sites.

N-tier stateless applications is perfect for Cloud Services. Offers both web roles

and worker roles (requirement for separate VMs for their business logic).

Cloud Services provides separate staging and production environments, making

application updates somewhat smoother than Web Sites.

Cloud Services lets you use networking technologies such as Azure Virtual

Network and Azure Connect to hook on-premises computers to Cloud Services

applications. No such thing on Web Sites.

(48)

Developing Applications Better [email protected] +91-9916043731 0 1 2 3 4 5 6 7 8 9 10

Web Sites Cloud Services Virtual Machines

Co

nt

rol

Co

nt

rol

Co

nt

rol

Leg

acy

App S

uppor

t

Leg

acy

App S

uppor

t

Leg

acy

App S

uppor

t

Ease

o

f Ma

nagem

en

t

Ease

o

f Mgm

t

Ease

Agil

ity

Agil

ity

Agil

ity

(49)
(50)

Developing Applications Better [email protected] +91-9916043731

Microsoft Azure Service Model

(51)

Mixing Virtual Machines & Stateless Roles

(52)
(53)

RoleEntryPoint

(54)

Developing Applications Better [email protected] +91-9916043731

CloudConfigurationManager

(55)
(56)

Developing Applications Better [email protected] +91-9916043731

<

WebRole

/>

<

Sites

/>

<

WorkerRole

/>

<

InputEndpoints

/>

<

InstanceInputEndpoints

/>

<

InternalEndpoints

/>

<

ConfigurationSettings

/>

<

Certificates

/>

<

LocalResources

/>

<

Imports

/>

<

Startup

/>

(57)

<

Instances

/>

<

ConfigurationSettings

/>

(58)

Developing Applications Better [email protected] +91-9916043731

(59)
(60)

Developing Applications Better [email protected] +91-9916043731

VIPs in Cloud Services

- Public IP address pointing

to Azure Cloud Service

where VM is deployed.

- Every Cloud Service has a

VIP and every Cloud

Service can have several

VMs.

- A VIP assigned to Cloud

Service won’t be released

until last VM on that Cloud

Service is Stopped

(De-allocated) or Deleted

(61)
(62)

Developing Applications Better [email protected] +91-9916043731

Connecting Cloud Services via VNET

(63)
(64)
(65)
(66)
(67)
(68)
(69)
(70)
(71)
(72)
(73)

AccessTheWebAsync

GetStringAsync

DoIndependentWork

(74)
(75)
(76)
(77)
(78)
(79)
(80)

Developing Applications Better [email protected] +91-9916043731

(81)
(82)
(83)
(84)
(85)
(86)

Developing Applications Better [email protected] +91-9916043731

(87)
(88)

Developing Applications Better [email protected] +91-9916043731

(89)
(90)
(91)
(92)
(93)
(94)
(95)
(96)
(97)
(98)

Developing Applications Better [email protected] +91-9916043731

(99)
(100)
(101)
(102)

Developing Applications Better [email protected] +91-9916043731

- Do not expose asynchronous wrappers around

synchronous methods

(103)
(104)

Developing Applications Better [email protected] +91-9916043731

(105)
(106)
(107)

Day1

Day2

Day3

Introduction

Cloud Dev

Best Practices

Azure AD & SSO

In-depth Blog

Storage & Code

Examples

Queuing on

Microsoft Azure

Using DCS

WPI & WebMatrix3

- Demo

VM, Cloud Services

& Web Sites

-Analysis

Lab 2

Lab 4

Use Cases & Demo

Lab 7

One ASP.NET

Philosophy

Web Sites –

Deployment, Configuration & Monitoring

Data Storage

Options

Azure Service Bus

Queues

Understanding

Failures on Cloud

PowerShell Cmdlets

Microsoft Open

Technologies

Web Sites &

AutoScale – Demo

Blobs, Disks, Tables

& Queues

Azure Queues &

Service Bus Queues

– Compared

Types & Scope

Lab 8

VM Depot - Demo

Cloud Services –

Developing, Deploying &

Monitoring

Serialized Object

Graphs in JSON

(DocumentDB)

Caching on Azure:

Understanding

Redis - Tutorial

Building Telemetry

Staged Deployment

& GitHub

Integration

OWIN Katana

Project – Examples

& Demo

async in .NET 4.5

Lab 3

Microsoft Azure

(108)
(109)
(110)
(111)
(112)

Developing Applications Better [email protected] +91-9916043731

There are two apps on the web and the user has a plain-old browser.

Since the two apps never talk to each other directly, a mechanism would need to be

devices where the user logs onto App A, receives and access token into their

browser and passes it through to App B with then calls back to App A via some API

to make sure the access token is valid.

If we passed the access token into the user’s browser so it’s possible it could be

snatched (perhaps by some malicious javascript). This is why most developers stick

to the standard SSO protocols like SAML, OpenID and WS-Federation for the classic

web-app to web-app single sign-on.

(113)
(114)
(115)

AD user

ASP.NET MVC application

set permissions

Connecting

(116)
(117)
(118)
(119)
(120)
(121)
(122)

Developing Applications Better [email protected] +91-9916043731

(123)
(124)
(125)

Case Study:

(126)
(127)
(128)
(129)
(130)
(131)
(132)

Developing Applications Better [email protected] +91-9916043731

What we already know about Azure Tables

How Azure Storage Tables are structured

(133)

Even though Azure Storage Tables are represented

in a tabular format, they are not to be confused with

RDBMS tables

(134)

Developing Applications Better [email protected] +91-9916043731

(135)

http://bit.do/cqrs-pattern

(136)
(137)

Audit Events for

Bob Tabor

Richard Boughton

Audit Events for

Audit Events for

Dan Star

(138)
(139)

http://bit.do/querying-tables-entities

(140)
(141)
(142)
(143)
(144)
(145)

Best Practices

1

2

(146)
(147)
(148)
(149)
(150)
(151)
(152)

Developing Applications Better [email protected] +91-9916043731

(153)
(154)

Developing Applications Better [email protected] +91-9916043731

(155)
(156)
(157)

http://weblogs.asp.net/scottgu/azure-new-

documentdb-nosql-service-new-search-service-new-sql-alwayson-vm-template-and-more

http://azure.microsoft.com/en-us/services/documentdb/

(158)
(159)
(160)
(161)
(162)

Developing Applications Better [email protected] +91-9916043731 Average Usage Com pu te Time Com pu te Time Average Usage

(163)
(164)
(165)
(166)

Developing Applications Better [email protected] +91-9916043731

The FixItContext class derives from

Entity Framework, DbContext class,

identifies the database and specifies

the tables in the database.

The connection string in the

Web.config file is called “appdb”.

Here, points to the local

(167)
(168)

Developing Applications Better [email protected] +91-9916043731

The Entity Framework creates a

FixItTasks table based on the

properties included in the FixItTask

entity class.

This is POCO (Plain Old CLR Object)

class. EF creates a table and

executes a CRUD

(create-read-update-delete) ops.

(169)
(170)
(171)
(172)
(173)
(174)
(175)
(176)
(177)
(178)
(179)
(180)

Developing Applications Better [email protected] +91-9916043731

https://msdn.microsoft.com/en-us/library/azure/hh767287.aspx

(181)
(182)
(183)
(184)
(185)
(186)
(187)
(188)
(189)
(190)
(191)
(192)

Developing Applications Better [email protected] +91-9916043731

(193)
(194)

Developing Applications Better [email protected] +91-9916043731

(195)
(196)
(197)
(198)

Developing Applications Better [email protected] +91-9916043731

Day1

Day2

Day3

Introduction

Cloud Dev

Best Practices

Azure AD & SSO

In-depth Blog

Storage & Code

Examples

Queuing on

Microsoft Azure

Using DCS

WPI & WebMatrix3

- Demo

VM, Cloud Services

& Web Sites

-Analysis

Lab 2

Lab 4

Use Cases & Demo

Lab 7

One ASP.NET

Philosophy

Web Sites –

Deployment, Configuration & Monitoring

Data Storage

Options

Azure Service Bus

Queues

Understanding

Failures on Cloud

PowerShell Cmdlets

Microsoft Open

Technologies

Web Sites &

AutoScale – Demo

Blobs, Disks, Tables

& Queues

Azure Queues &

Service Bus Queues

– Compared

Types & Scope

Lab 8

VM Depot - Demo

Cloud Services –

Developing, Deploying &

Monitoring

Serialized Object

Graphs in JSON

(DocumentDB)

Caching on Azure:

Understanding

Redis - Tutorial

Building Telemetry

Staged Deployment

& GitHub

Integration

OWIN Katana

Project – Examples

& Demo

async in .NET 4.5

Lab 3

Microsoft Azure

Redis

Lab 6

Lab 9

(199)
(200)

References

Related documents

7.1 Admitted for registered and insured items (If admitted according to question 4): Yes 7.2 Admitted only if registered and insured items are received with an advice of delivery :

To master these moments, use the IDEA cycle: identify the mobile moments and context; design the mobile interaction; engineer your platforms, processes, and people for

The employee or applicant, when requested, did not provide sufficient medical documentation to establish a covered disability or a need for reasonable accommodation.

This is the CGr program that accepts the user input from the html file, and checks the data file YearVal.dat on the server for the relevant data; if the data is found, the

Federal Form 1040 individual tax return for each year as required  Has not previously reported accrued but undistributed income from the plan on

This section of the book details many of the rules needed for using an army of the Adeptus Custodes in your games of Warhammer 40,000, including their unique Warlord Traits,

There is, of course, more to designing the optimum facility, but having a firm foundation for the energy and cooling systems will go a long way in the overall success of the design

Additionally, families speculated that having a child with developmental delay was associated with stigma, embarrassment, rejection, and family burden, making it difficult for