.NET Usergroup Oldenburg 26. März 2015 - von Winfried Klinker und Andre Hühn
Microsoft Azure gehört zu den Cloud-Diensten, die Microsoft anbietet. Es umfasst neben dem Hosting von virtuellen Maschinen insbesondere eine große Sammlung an Diensten (wie SQL Azure, Mobile Services, Machine Learning).
Wir geben einen ersten Überblick über die Features von Azure insbesondere für Entwickler. Dabei werden wir sowohl auf die Platform as a Service (PaaS) Angebote wie auch auf die Infrastructe as a Service (IaaS) eingehen. Außerdem geben wir einen Einblick in moderne Cloud Architektur und zeigen Best Practices bei der Cloud Entwicklung auf. Dabei werden Beispiele aus der Praxis zeigen, wie man eine Fehlertolerante und robuste Cloud Lösung erstellen kann.
Über die Sprecher:
Winfried Klinker ist als Software Architekt bei der Firma Sitrion in Oldenburg tätig. Er beschäftigt sich größtenteils mit Cloud Architekturen mit Microsoft Azure vor allem in Bezug auf Backends für mobile Anwendungen.
Andre Hühn ist Team Lead für Entwicklung mobiler Apps bei der Firma Sitrion in Oldenburg und beeinflusst damit die Richtung der Architektur für das Sitrion ONE Produkt.
2. Why the cloud?
Rapidly setup environments to drive business priorities
Scale to meet peak demands
Increase daily activities, efficiency and reduced cost.
3. On Premises
Youscale,makeresilientandmanage
Infrastructure
(as a Service)
Managedbyvendor
Youscale,make
resilient&manage
Platform
(as a Service)
Scale,resilienceand
managementbyvendor
Youmanage
Hosting models
Software
(as a Service)
Business model
Applications
Scale,resilienceand
managementbyvendor
Why the cloud?
6. Fortune 500 using Azure
>57% >300k
Active websites
More than
1,000,000
SQL Databases in Azure
>30TRILLION
storage objects >300MILLION
AAD users
>13 BILLION
authentication/wk
>3
MILLION
requests/sec
>1.65MILLION
Developers registered
with Visual Studio Online
7. .NET Support2015
Offline Sync
Mobile Services
Networking Visual Studio & .NET
Virtual Machines
Memory Optimized Disk Optimized
Resource Manager
Portal
VSO GA
XamarinPoint-to-site VPN
Web Sites
SMB File System
IBIZA
Remote Debug
VM Management
SQL Database
Puppet Chef Docker
Powershell and DSC
Capture / Deploy
Autoscale
Dynamic Routing
Subnet Routing
Static IP
Storage
Autoscale
Traffic Mgr
Web Jobs
Backup
Java Support
ASP.NET MVC 5.1
ASP.NET Web API 2.1
AD support
Powershell Automation
Node.JS project support
Remote Debugging
Kindle Support
BD’s up to 500GB
99.95% SLA
Self Service Site Recovery
Active GEO replication
HDInsight
Hadoop 2.2
YARN support
.NET 4.5
.NET Foundation
Azure Redis Cache
API Management
Site Recovery
Remote Apps
Cordova
VSO Open
Api’s
Event Hub
8. Connect every on-premises
server to the cloud
StorSimple
Backup
Hyper-V Disaster Recovery
VMWare Disaster Recovery
SQL Server Always On
Active Directory
Orchestration as a Service
ExpressRoute Networking
Azure
On-Premises Datacenter
10. Microsoft Azure Services
Clientlayer
(on-premises)
Tablet Phone
Games
consolePC
On-premises
databaseBrowserOffice Add-in
On-premises
service
AD
Multifactor
Authentication
AccessControl
Layer
Integration
layer
Service Bus CDN
BizTalk
Services
Traffic
Manager
Virtual
Networks
Express
Route
Application
layer
API Mgmt Websites
Cloud
Services VM
Mobile
Services
Media
Services
Notification
Hubs Scheduler Automation
DataLayer
Storage Blobs Tables Queues Data
Machine
Learning HD Insight
Document
DB
SQL
Database Caching StorSimple
12. Getting started
>_
REST API
Virtual Machines
Management portal
Scripting
(Windows, Linux and Mac)
Select image
and VM size
Extra Small
Small
Medium
Large
X-Large
New disk persisted
in storage
Cloud
Blob
Storage
Comprehensive
Networking
Windows Server
Linux
Boot VM from new disk
14. Microsoft Azure Site Recovery
Orchestrated disaster recovery to a second site or to Azure
Communication
and Replication
Microsoft Azure
Site Recovery
Communication Channel
Replication channel:
Hyper-V Replica
Primary
Site
Windows
Server
Recovery
Site
Windows
Server
Microsoft Azure
Site Recovery
Primary
Site
Windows
Server
Automated VM protection and replication
Remote health monitoring
Customizable recovery plans
No-impact recovery plan testing
Orchestrated recovery when needed
15. Game sessions hosted
using Azure
Hosted using >100,000
Azure Virtual Machines
16. • SQL Server database technology as a service
• Fully Managed
• Enterprise-ready with automatic support for HA
• Designed to scale out elastically with demand
• Ideal for simple and complex applications
• Full support for TDS and ODBC
• Familiar language and framework support
• Cross Datacenter failover and backups to
support disaster recovery scenarios
SQL Database
17. Big Data Insights
Microsoft Azure Machine Learning
Mashup sophisticated intelligent algorithms
Enables data scientists and developers to efficiently
embed predictive analytics into their applications
Elastic, pay as you go with low operating costs
Extend with Power BI, Hadoop and cloud hosted data
Microsoft Azure HDInsight
Microsoft instance of Hadoop distribution
running as service
Support existing ecosystem from Hive, Pig, etc
Extended to support Excel and BI tooling
Integration with diverse sources of data
18. Microsoft Azure Web Sites
Create new sites in seconds
Easily manage and scale your sites
Automatic load balancing and shared
storage across instances
Scale out or up to reserved instances
for improved performance and scale
Built-in web jobs support
Use ASP.NET, ASP, PHP, Java or
Node.js
SQL Azure or MySQL databases
Start with open source apps and
frameworks
Develop with VS and WebMatrix
Supports any Web development
tool on any platform (Windows,
OSX, Linux)
Rapid deployment for quick
iteration
Integrated source control with
Team Foundation Server (TFS) and
Git
Built-in monitoring of perf and
usage data
Quick access to request logs, failed
requests diagnostics and
diagnostics
Office Blog ASP.NET microsoft.com
19. • Full Portal Integration
• Not just for Microsoft shops
Visual Studio Online
Agile
Build Test
Deploy
InsightsCode
20. • Synchronize your corporate
and 3rd party identities
• Integration with O365
• Support modern protocols
• OAuth 2.0
• OpenID Connect
• WS-Fed
• SAML 2.0
• Identity and Access Mgmt Permissions
• Users
• Groups
• Applications
Microsoft Azure Active Directory
3rd party clouds/hostingMicrosoft
Azure AD
You
21. • On Demand Media Services
• Video-on-demand
• Ingest
• Encode
• Package
• Encrypt
• Delivery
• Live Streaming Support
• Office 365 Integration
Azure Media Services
Live video encoding and streaming
Web + Mobile
100 million viewers
2.1 million concurrent HD viewers during the
USA vs. Canada hockey match
Olympics NBC Sports
23. • Dev / Test
• Full test and dev environments in minutes
• VSO integration
• Lift and Shift
• Take existing work loads and run then in a certified instance
• Storage
• Archive key data in inexpensive cloud storage
• Big Data
• Process key data into business intelligence using Hadoop or Machine Learning
• Identity
• Synchronize all your identities through Azure AD to control access to Apps, Data and Services
• Web Apps
• Take your web apps to the cloud using inexpensive Web Sites
Key Scenarios to get started with Microsoft Azure
26. General Things to consider
• Design everything to be Stateless (if possible)
• use PaaS over IaaS
• use Async
• Automate everything
• Right tool for the job
• SQL
• TableStorage
• BlobStorage
• NoSQL (DocumentDB, MongoDB, Cassandra)
31. Dev Ops
• Continous Integration & Deployment
• Works on my machine!
• Monitoring
• Telemetry (User behavior and usage)
• VisualStudio Online is free for up to 5 users, automatic
deployment from SourceControl to Azure
32. Design for failure
• Everything can fail at any time
• Transient Faults (self healing)
• Network issues
• Timeouts
• Use Traffic Manager route traffic to differnt data centers
• Use AutoScale to handle peak times
33. Transient Fault Handling
•Entity Framework supports Retry Policy since 6.0
•Azure SDKs include Retry Policies
•Create custom HttpHandler for calling external
services
public class MyConfiguration : DbConfiguration
{
public MyConfiguration()
{
SetExecutionStrategy(
"System.Data.SqlClient",
() => new SqlAzureExecutionStrategy(1, TimeSpan.FromSeconds(30)));
}
}
IRetryPolicy linearRetryPolicy = new LinearRetry(TimeSpan.FromSeconds(2), 10);
blobClient.RetryPolicy = linearRetryPolicy;
34. HttpClient Handler
protected override async Task<HttpResponseMessage> SendAsync( HttpRequestMessage request, CancellationToken
cancellationToken) {
HttpResponseMessage response = null;
for (int i = 0; i < _maxRetries; i++)
{
response = await base.SendAsync(request, cancellationToken);
if (response.IsSuccessStatusCode)
{
return response;
}
if (response.StatusCode == HttpStatusCode.Unauthorized)
{
var token = await _connector.GetRefreshToken();
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", token.accessToken);
}
if (response.StatusCode == HttpStatusCode.NotFound)
{
return response; //No neet to retry 404
}
if (response.StatusCode == (HttpStatusCode) 429)
{
//Too many requests, back off
Thread.Sleep(2000);
}
}
return response;
}
34
VAR CLIENT = NEW HTTPCLIENT(NEW RETRYWITHAUTHHANDLER<EXACTCONNECTOR>(NEW HTTPCLIENTHANDLER(), 3, THIS));
35. Queue centric work pattern
• Decouple tiers
• Allows to scale efficiently
• Handle unexpected peak loads
• Works great with AutoScale
• Use for all non interactive scenarios
• Examples:
• Send Emails
• Create Thumbnails of uploaded pictures
• Write results to storage
36. Microservices
• Each MicroService is part of an application (no SOA)
• Autonom
• Fast development and integration
• Allows for experiments
• Best language for the job
37. SingleSignOn (SSO)
• Azure Active Directory
• Support SAML, WS-Fed and
Oauth
• Link to On Premise
Directory
• Connect with ADFS On
Premise
-Blobs: Zum speichern von Resource wie Dateien
-Tables: Zum Speichern von daten als key value pairs
-Queues: Zum abarbeiten von Daten
-SQL Database: Zur Speicherung von Daten in SQL
-Machine Learning: Ein Dienst der aus einer Menge von Daten lernt
-HD Insight: Zum speichern von unstrukturierten oder semi strukturierten Daten (100% Apache Hadoop)
-Caching: Redis-Cache oder AppFabric Memory Cache
-DocumentDB: NoSQL Datenbank wie z.B. MongoDB
-StorSimple: Backup Lösung für OnPrem Server
Viele Möglichkeiten VM´s zu erstellen, über das Portal, per Skript, per API
Es gibt alle möglichen Server welche benutzt warden können unter anderem auch eigene oder…
- .. Man kann aus einer Vielzahl von vorgefertigten Templates auswählen
Stellt die Möglichkeit zur Verfügung disaster recovery für VM´s zu
Planen
Machen
Testen ohne die Produktionsumgebung zu stören
Geht sowohl nur in Azure als auch mit Servern OnPrem
Gutes Beispiel Titanfall: Anstatt díe Spiele auf den Konsolen oder PC´s zu Hosten, hostet Respawn seine Spiele auf Azure um Rechenoperationen für die AI und andere Sachen von den Konsolen fernzuhalten um dort die Resourcen für Grafik usw nutzen zu können
Points to land:
Imagine what you could do…
360,000 concurrent cores
Have EA tell the story
Assume we don't run out of capacity
- Diagnostics durch Application Insights
- Recodierung von Inhalten, Live Streaming Support
-
Speaking Notes
Azure Mobile Services is a Backend-as-a-Service
Instead of you having to design, build, test, deploy, manage, and upgrade your whole backend, we do it for you
Features of Mobile Services
Storage – SQL DB
Authentication – built in support for social providers w/ ability to custom auth
Backend logic – data validation, logical flows, etc
Push Notifications – across all major mobile platforms
Scheduler – backend job processing