Subhasish Ghosh | Vice President, 8K Miles Software Services, Inc.
Developing Applications Better [email protected] +91-9916043731
Architecting Microsoft Azure Solutions
Developing Applications Better [email protected] +91-9916043731
Microsoft Azure Fundamentals
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
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.).
Developing Applications Better [email protected] +91-9916043731
Microsoft Open Technologies
http://katanaproject.codeplex.com/
Microsoft via Katana is building a set of components around hosting abstraction
for your applications. That hosting abstraction is 'OWIN'.
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
Why OWIN?
2 Key Motivations:
- Node.js Envy
Developing Applications Better [email protected] +91-9916043731
http://msopentech.com/
Developing Applications Better [email protected] +91-9916043731
Quick Demo
PM> Install-Package Microsoft.Owin.Host.
SystemWeb
PM> Install-Package Microsoft.Owin.
Diagnostics
Developing Applications Better [email protected] +91-9916043731
Project Katana
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.
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.
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.
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
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.
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
Developing Applications Better [email protected] +91-9916043731
Microsoft Azure Service Model
Mixing Virtual Machines & Stateless Roles
RoleEntryPoint
Developing Applications Better [email protected] +91-9916043731
CloudConfigurationManager
Developing Applications Better [email protected] +91-9916043731
•
<
WebRole
/>
•
<
Sites
/>
•
<
WorkerRole
/>
•
<
InputEndpoints
/>
•
<
InstanceInputEndpoints
/>
•
<
InternalEndpoints
/>
•
<
ConfigurationSettings
/>
•
<
Certificates
/>
•
<
LocalResources
/>
•
<
Imports
/>
•
<
Startup
/>
•
<
Instances
/>
•
<
ConfigurationSettings
/>
Developing Applications Better [email protected] +91-9916043731
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
Developing Applications Better [email protected] +91-9916043731
Connecting Cloud Services via VNET
AccessTheWebAsync
GetStringAsync
DoIndependentWork
Developing Applications Better [email protected] +91-9916043731
Developing Applications Better [email protected] +91-9916043731
Developing Applications Better [email protected] +91-9916043731
Developing Applications Better [email protected] +91-9916043731
Developing Applications Better [email protected] +91-9916043731
- Do not expose asynchronous wrappers around
synchronous methods
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
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.
AD user
ASP.NET MVC application
set permissions
Connecting
Developing Applications Better [email protected] +91-9916043731
Case Study:
Developing Applications Better [email protected] +91-9916043731
What we already know about Azure Tables
•
How Azure Storage Tables are structured
•
Even though Azure Storage Tables are represented
in a tabular format, they are not to be confused with
RDBMS tables
Developing Applications Better [email protected] +91-9916043731
http://bit.do/cqrs-pattern
Audit Events for
Bob Tabor
Richard Boughton
Audit Events for
Audit Events for
Dan Star
http://bit.do/querying-tables-entities
Best Practices
1
2
Developing Applications Better [email protected] +91-9916043731
Developing Applications Better [email protected] +91-9916043731
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/
Developing Applications Better [email protected] +91-9916043731 Average Usage Com pu te Time Com pu te Time Average Usage
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
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.
Developing Applications Better [email protected] +91-9916043731
https://msdn.microsoft.com/en-us/library/azure/hh767287.aspx
Developing Applications Better [email protected] +91-9916043731
Developing Applications Better [email protected] +91-9916043731
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