the essentials of building cloud-based web apps with azure

20
The Essentials of Building Cloud-Based Web Apps with Azure Ido Flatow Senior Architect, Sela Group Microsoft MVP & RD Level: Intermediate

Upload: ido-flatow

Post on 06-Jan-2017

43 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: The Essentials of Building Cloud-Based Web Apps with Azure

The Essentials of Building Cloud-Based Web Apps with

AzureIdo Flatow

Senior Architect, Sela GroupMicrosoft MVP & RD

Level: Intermediate

Page 2: The Essentials of Building Cloud-Based Web Apps with Azure

On-Premises Web ApplicationArchitectural Overview

Page 3: The Essentials of Building Cloud-Based Web Apps with Azure

ON-PREMISES WEB APPLICATIONDEMO

Page 4: The Essentials of Building Cloud-Based Web Apps with Azure

SQL Database• What and Why?

– Managed service, scalable, highly-available, with predictable performance– Avoid creating and maintaining SQL Server on a VM– Various performance tiers to match your needs

• How?– Create the service and the database– Fix the schema as needed and export to .bacpac – Import .bacpac (schema + users + data) to Azure– Set Firewall rules– Change connections strings in the application

• Disadvantages?– Max database size is 1TB– Performance is great, but with VMs, higher level of tuning is possible– Lacks several features of SQL Server (http://bit.ly/MSSQLvsSQLDB)

Page 5: The Essentials of Building Cloud-Based Web Apps with Azure

AZURE SQL DATABASEDEMO

Page 6: The Essentials of Building Cloud-Based Web Apps with Azure

Web App• What and Why?

– Managed IIS hosting for your web applications– Load-balanced with L7 load balancing (stickiness, SSL offload)– Reliable, scalable, with friction-free deploy– Easy-to-create environments for testing, staging, and production– Supports custom domains, SSL certificates, performance testing, etc.

• How?– Create the web app service– Deploy your web application using MSDeploy / Git / VSTS / Dropbox / …

• Disadvantages?– Closed-environment (read-only registry, limited disk space, no ETW support)– Limited instances SKUs (up to 20 instances, A-series machines)– Security hardening is not up to you

Page 7: The Essentials of Building Cloud-Based Web Apps with Azure

AZURE WEB APPSDEMO

Page 8: The Essentials of Building Cloud-Based Web Apps with Azure

Blob Storage• What and Why?

– Secured, shared storage for resources instead of a file server– Durable, highly-available, with 99.9% SLA– Accessible through HTTP(S) for browsers and back-ends– Blobs can be either public or private– Store up to 500TB (!!), per account (!!)

• How?– Move resources from file servers to blob storage– Use the client SDK to retrieve/store blobs– Make public resources available with HTTP(S)

• Disadvantages?– Requires changing your server-side [+client-side] code– No IP restriction / VNET support

Page 9: The Essentials of Building Cloud-Based Web Apps with Azure

AZURE BLOB STORAGEDEMO

Page 10: The Essentials of Building Cloud-Based Web Apps with Azure

Azure Redis Cache• What and Why?

– Cache-as-a-Service to store session state and cacheable resources– Based on the well-known Redis Cache– Master-slave replication for high-availability SLA– Scale out with cache units, up to 530GB

• How?– Create a new Redis cache service, then wait 15 minutes– Replace caching code with the Redis client SDK– Configure the session state provider to use Redis (optional)

• Disadvantages?– Few versions back from the original Redis for Linux– Small throughput latency due to it being a public, secured service– Prices soar as you require more features (compared to creating your own VMs)

Page 11: The Essentials of Building Cloud-Based Web Apps with Azure

AZURE REDIS CACHEDEMO

Page 12: The Essentials of Building Cloud-Based Web Apps with Azure

Azure Active Directory• What and Why?

– Identity as a Services (IDMaaS)– Integrates with on-premises AD/ADFS– Standard protocols support: OAuth2, OpenId Connect, WS-Federation– Supports single and multi-tenant applications– Built-in features, such as MFA, custom domains, and reporting

• How?– Create users and groups– Create an AAD application for your web application– Add OWIN Authentication middleware for AAD

• Disadvantages?– Still no descent management tools, except the portal– Cool features (self-service, branding) are costly

Page 13: The Essentials of Building Cloud-Based Web Apps with Azure

Azure Active Directory B2C• What and Why?

– All IDM functions an app needs, to handle a customer audience– Azure AD security, availability, and scalability for customer IDM– Social IdPs and “application local accounts”– Self-service sign up, password reset, profile management– Customizable sign in and sign up UI– Same protocols, libraries, and programming model as AAD

• How?– Create an AAD B2C directory– Select available Identity Providers (IdP)– Create an AAD application for your web application– Configure sign-up, sign-in, and profile pages (UI, shown claims, etc.)– Add OWIN Authentication middleware for AAD

• Disadvantages?– Still in preview, no CLI tools, some features are missing

Page 14: The Essentials of Building Cloud-Based Web Apps with Azure

AZURE ACTIVE DIRECTORYDEMO

Page 15: The Essentials of Building Cloud-Based Web Apps with Azure

Azure Functions• What and why?

– Backend as a Service (BaaS, Serverless)– Write your code in C#, Node, Python, PHP– Ideal for trigger-based and timer-based operations– Pay only for execution time (or use your App Service plan)

• How?– Create a new function by choosing a template– Define your inputs and outputs– Type/paste your code– Configure general settings, such as framework version, authentication, and CORS

• Disadvantages?– Testing and debugging is tricky (mostly using trace messages)– Functions are stateless, which doesn’t suite code that requires local state– Still in preview – lacks a lot of documentation and best practices

Page 16: The Essentials of Building Cloud-Based Web Apps with Azure

AZURE FUNCTIONSDEMO

Page 17: The Essentials of Building Cloud-Based Web Apps with Azure

Cloud-Based Web ApplicationArchitectural Overview

Web App

Azure Active Directory B2C

Blob StorageProcessed

blobs

SQL Database

Azure Redis Cache

Azure Functions

Pre-Processedblobs

Page 18: The Essentials of Building Cloud-Based Web Apps with Azure

How Much Does it Cost? (Monthly)Component Low-end High-endSQL Database $5 (Basic, 2GB) $3720 (Premium, 500GB)Web App $56 (Basic, 1 core x 1

instance)$1786 (Premium, 4 core x 2 instance)

Blob Storage (100GB) $2.4 (Local replication) $6.1 (RA Geo-replication)

Redis Cache $17 (Basic, 250MB) $413 (Premium, 6GB)AAD B2C $0 (free for first 50k users) $330 (100k users, 1 login/user/day)Functions $2.6 (1 func/sec, 2s exec.) $318 (100 func/sec, 1s exec.)Bandwidth (100GB) $8.3 $8.3Total $91.3 $6518.4

Page 19: The Essentials of Building Cloud-Based Web Apps with Azure

If We Had the Entire Week…DataSQL Server on VM, DocumentDb, NoSQL with Table storage1

Compute and HostingVirtual Machines, Cloud Services, Service Fabric, Azure Batch, Dev/Test Labs2

Networking and MessagingTraffic Manager, Virtual Network, Service Bus Queues, Event Hubs3

Developing and DevOpsNon-.NET support, Monitoring, Troubleshooting, Automation4

Page 20: The Essentials of Building Cloud-Based Web Apps with Azure

Resources• Azure landing page

– http://azure.microsoft.com• Training and videos

– https://www.microsoft.com/en-us/learning/azure-training.aspx – https://azure.microsoft.com/en-us/get-started

• Forums and blogs– http://azure.microsoft.com/blog – http://weblogs.asp.net/scottgu – http://azure.microsoft.com/support/forums

• My info– @IdoFlatow // [email protected] // http://www.idoflatow.net/downloads