6/9/2015
Xamarin:
The New Azure – More Productivity
with Less Pain
Cleveland .NET SIG – May 12th, 2015
http://aka.ms/fundamentalsofazure
1.
a)
b)
c)
2.
3.
4.
5.
//BUILD and Ignite
2015
7
Azure SQL Database
8
Enhancements
• Elastic Pools (Preview)
• Ideal for SaaS providers
• Collection of available resources (DTUs and storage)
• Elastic Jobs
• Split/Merge tool
• V12 only
• http://azure.microsoft.com/en-us/documentation/articles/sqldatabase-elastic-pool/
9
Enhancements
• Transparent Data Encryption (TDE)
• Same technology as SQL Server
• Does not yet leverage Key Vault
• V12 only
• http://aka.ms/AzureSQLTDE
• Full-Text Search
• Subset of SQL Server
• V12 only
10
Big Data Workloads
• Azure SQL Data Warehouse
• Elastic petabyte-scale data warehouse-as-a-service
• Compute and storage billed separately
• Azure Data Lake
• HDFS for the cloud
• No limits
• HDInsight, Hortonworks, Cloudera, Rev-R, etc.
11
Cloud Services &
Storage
12
Cloud Services
• Azure SDK 2.6
• Azure Resource Manager Tools
• Diagnostic Improvements
• Azure Diagnostics with ELK - http://aka.ms/AzureDiagnosticsElk
• App Service tools
• HDInsight tools
13
Azure Storage
• C++ Library
• Client-Side Encryption (Preview)
• Xamarin Storage Client Library
• New blob type – Append Blob
• Limited preview
• Summer 2015
• Storage Account SAS – control access to an entire account
• Protocol SAS – restrict access to HTTPS only
• IP Restricted SAS – specify a single IP or range
14
Azure CDN
15
Infrastructure
16
Cloud Services (Virtual Machines)
• Multi VIPs
• Up to 5 additional IPS ($0.004/hr/IP ($3/month))
17
Networking
• Standard VPN Gateway
• Enable ExpressRoute and
site-to-site together
• Higher throughput for
ExpressRoute
• ExpressRoute Premium
• Increase public & private
peering from 4,000 to
10,000 routes
• Global connectivity
18
Networking
• User defined routes
19
Networking
• Azure DNS
• Preview – need to register
provider
• Move Reserved IPs from one
service to another
• DNS for Instance Level Public
IP
20
Azure Resource
Manager
21
Azure Resource Manager
WHAT IS AZURE RESOURCE MANAGER?
Resource == Azure entity
• Azure Website
• Azure Redis Cache
• etc.
Azure web
Virtual machine
Unit of Management
• Provision and deprovision
• Permissions
• Grouping - one or many
Storage (Azure)
Azure SQL database
Resource
OneGroup
Resource
-> One Resource Group
Contoso-Web.json
Azure Resource
Manager
1. Create SQL DB
Depends on SQL
Consistency & Repeatability
Idempotent
Resource Configuration – Desired State
Orchestration
Source Control
Parameterized Input & Output
2. Create Website
Azure SQL database
Azure web
3. Connection Info to
website configuration
23
JSON
Templates
Resource Manager - IaaSv2
• VM, Virtual Network, and Storage
• Microsoft.Compute | Storage | Network
• Opt-in model . . . Little more work
• IP Address
• NICs
• DNS
• Fault Domains
• Etc.
• More than 80 templates at
https://github.com/Azure/azure-quickstart-templates
25
Resource Manager
• Visual Studio / Azure SDK 2.6 – Enhanced Tooling
Support
26
Demo
Create a Basic Virtual Machine with Azure Resource Manager
27
Azure App Service
28
 Unique integrated offering
 Build intelligent web and mobile apps
Azure
Websites
 Scale as your business grows
Mobile
Services
Biz Talk
Services
Designed for secure mission-critical applications
Optimized for Availability and Automatic scale
Agility through Continuous Deployment
Hybrid Connections / VPN Support
Scheduled Backup
Azure Active Directory Integration
Site Resiliency, HA, and DR
Web Jobs
Role Base Access Control
Audit / Compliance
Enterprise Migration
Client Certs
Cache
IP Restrictions/ SSL
Web Sockets
SQL, MySQL, DocDB, & Mongo
Sticky Sessions
Authorization/ Authentication
Automated Deployment
AutoScale
Built-in Load Balancing
WW Datacenter Coverage
End Point Monitoring & Alerts
App Gallery
DR Site Support
WildCard Support
Dedicated IP address
HTTP Compression
CDN Support for Websites
Premium WordPress
App Services Environments
Remote Debugging w/ Visual Studio
Site Staging Slots
Testing in Production
Continuous Integration/Deployment
Git, Visual Studio Online and GitHub
App & Site Diagnostics
OS & Framework Patching
Site Extensions Gallery
NET, PHP, Python, Node, Java
Framework Installer
Browser-based editing
Auto-Healing
Logging and Auditing
Admin-Site
Support Site Extension
Build your API
Web Apps++: Bring
you API as is in your
language of choice
Simple access control
SSO
Metadata contract
Microservice style
Expose enterprise
APIs
API discovery
Gallery – public &
organization
Consume APIs
Authentication,
built-in to mobile
and web SDKs
SSO,
handled by server
SDK generation
Connectors
•
•
•
•
•
•
•
•
•
•
•
•
Box
Chatter
Delay
Dropbox
Azure HD Insight
Marketo
Azure Media Services
OneDrive
SharePoint
SQL Server
Office 365
Oracle
Protocols
•
•
•
•
•
•
•
HTTP, HTTPS
File
Flat File
FTP, SFTP
POP3/IMAP
SMTP
SOAP + WCF
•
•
•
•
•
•
•
•
•
•
•
•
QuickBooks
SalesForce
Sugar CRM
SAP
Azure Service Bus
Azure Storage
Timer / Recurrence
Twilio
Twitter
IBM DB2
Informix
Websphere MQ
Azure Web Jobs
Yammer
Dynamics CRM
Dynamics AX
Hybrid Connectivity
•
•
•
•
•
BizTalk Services
•
•
•
•
•
•
Batching / Debatching
Validate
Extract (XPath)
Transform (+Mapper)
Convert (XML-JSON)
Convert (XML-FF)
•
•
•
•
•
X12
EDIFACT
AS2
TPMOM
Rules Engine
New capabilities for Mobile apps:
• Webjobs for long running tasks
• CI with GitHub, BitBucket, VSO
MOBILE APPS
Mobile services plus
a whole lot more
• Auto-load balance, Autoscale, Geo DR
• Virtual networking and hybrid connections
• Site slots for staged deployments
Demo
Logic App with SQL Database and Twilio
API App
46
App Service Environment
• Premium feature
• Dedicated environment
• Regional Virtual Network
• Network Security Groups
• Site-to-Site and ExpressRoute
• Up to 50 compute resources (vs. 20)
• Up to 500GB of storage
• http://aka.ms/AzureAppSvcEnv
47
Azure Service Fabric
48
Azure Service Fabric
• Enable “hyperscale” microservices
• Powers several Microsoft properties:
• Azure SQL Database
• DocumentDB
• Azure Event Hubs
• Cortana
• Intune
• Internal Azure services
• Etc.
• Enables a “Data center on your machine”
49
50
Azure Service Fabric
• Stateless Services
• Similar to Azure Cloud Service worker roles, gateways,
proxies, etc.
• Stateful Services
• Databases, shopping cart, user accounts, etc.
51
Application with Stateless Services
52
Application with Stateful Services
53
Programming Model
Reliable Actors API
Reliable Services API
Your problem space involves many small
independent units of state and logic
You need to maintain logic across multiple
components
You want to work with single-threaded objects while
still being able to scale and maintain consistency
You want to use reliable collections (like .NET
Dictionary and Queue) to store and manage your
state
You want the framework to manage the concurrency
and granularity of state
You want to control the granularity and concurrency
of your state
You want the platform to manage communication for You want to manage the communication and control
you
the partitioning scheme for your service
54
Getting Started
1. Install runtime, SDK, and tools – Web PI
2. Enable PowerShell script execution
> Set-ExecutionPolicy –ExecutionPolicy Unrestricted –Force –Scope
CurrentUser
3. Install & start a local cluster
C:\Program Files\Microsoft SDKs\Service Fabric\ClusterSetup\DevClusterSetup.ps1
4. Validate cluster
C:\Program Files\Microsoft SDKs\Service
Fabric\Tools\ServiceFabricExplorer\ServiceFabricExplorer.exe
55
Service Fabric Explorer
56
Demo
Stateful and Stateless Services Tour
57
Service Fabric Testability
Action
PowerShell Cmdlet
Graceful / Ungraceful Fault
Move Primary
Move-ServiceFabricPrimaryReplica
Graceful
RestartNode
Restart-ServiceFabricNode
Ungraceful
StopNode
Stop-ServiceFabricNode
Ungraceful
Etc. . . .
More options at
http://azure.microsoft.com/en-us/documentation/articles/service-fabric-testability-actions/
Monitoring & Diagnostic Data
• Use ETW (Event Tracing for Windows)
59
Service Fabric Samples
• https://github.com/Azure/servicefabric-samples
60
Azure DocumentDB
61
DocumentDB
query over schemafree JSON
WHAT?
It is a fully managed,
highly scalable,
queryable, truly
schema-free JSON
document databases,
delivered as a service
for modern
applications.
multi-document
transactions
tunable, high
performance
designed cloud first
cloud
62
Resource Model
JavaScript
• Database
• Logical container
• Collection
• Container of JSON
documents
• Scale out – add more
collections (not a CU)
• SSD backed
More Info: http://azure.microsoft.com/enus/documentation/articles/documentdb-interactions-withresources/
63
Resource Addresses
• Every resources has a unique ID
• Base Address
• https://{database_account}.documents.azure.com
• Specific Document
• /dbs/{database_id}/colls/{collection_id}/docs/{docum
ent_id}
• https://collier.documents.azure.com/dbs/5gVRAA==/colls
/5gVRALGZgQA=/docs/5gVRALGZgQABAAAAAAAAAA==/
64
Programming Model
• REST API
• Official SDKs: .NET, Python, Node.js, Java &
JavaScript
65
Data Types
Primitive
String
Number
Boolean
Structure
Null
Object
Array
• DateTime
• Represent as number to enable range based queries
• http://mcollier.net/DocDBDates
• Uses JSON.NET for serialization
• No special base class - POCO
66
Stored Procedures, Triggers, & UDFs
• Supported via server-side JavaScript
• Multi-document Transactions
• Registered per Collection
private static async Task CreateStoredProcedures(string colSelfLink)
{
var validateAddressSproc = new StoredProcedure
{
protected async Task<bool> ValidateAddress(string address)
Id = "ValidateAddress",
{
Body = @“
StoredProcedure sproc =
function(address) {
Client.CreateStoredProcedureQuery(Collection.StoredProceduresLink,
var response = getContext().getResponse();
"select * from root r where r.id = 'ValidateAddress'").ToList().FirstOrDefault();
response.setBody('true');
}“
bool isValidAddress = false;
};
if (sproc != null)
{
StoredProcedure createStoredProcedure var
=
result = await Client.ExecuteStoredProcedureAsync<string>(sproc.SelfLink, address);
await _client.CreateStoredProcedureAsync(colSelfLink,
validateAddressSproc);
var x = bool.TryParse(result.Response,
out isValidAddress);
}
}
return isValidAddress;
}
67
Demo
Basic ASP.NET Site + DocumentDB
68
Get the code!
Get the code and a full hands-on lab at
https://github.com/mikewo/MyJunkYourStuff
Mike Wood & Michael Collier – CodeMash 2015
69
DocumentDB Resources
Topic
URL
Azure DocumentDB
http://azure.microsoft.com/en-us/documentation/services/documentdb/
Azure DocumentDB .NET Code Samples
https://code.msdn.microsoft.com/windowsazure/Azure-DocumentDB-NETCode-6b3da8af/
https://github.com/Azure/azure-documentdb-net
Query Using DocumentDB SQL
http://www.documentdb.com/sql/tutorial
DocumentDB SQL Query Language
http://msdn.microsoft.com/en-us/library/azure/dn782250.aspx
Query DocumentDB
http://azure.microsoft.com/en-us/documentation/articles/documentdb-sqlquery
Intro to Azure DocumentDB
http://blogs.msdn.com/b/cloud_solution_architect/archive/2014/12/07/intr
o-to-azure-documentdb.aspx
DocumentDB Studio
https://studiodocumentdb.codeplex.com/
DocumentDB Performance Tips
http://azure.microsoft.com/blog/2015/01/14/announcing-sqlparameterization-in-documentdb/
http://azure.microsoft.com/blog/2015/01/27/performance-tips-for-azure70
documentdb-part-2
Thank You!
Michael S. Collier
@MichaelCollier | www.michaelscollier.com
[email protected] | [email protected]
71
http://aka.ms/fundamentalsofazure
Descargar

Automating Your Microsoft Azure Environment