SlideShare a Scribd company logo
1 of 35
#comdaybe




            Windows Azure Applications
                   Made API
                         AZUG
                    Kristof Rennen
Who Am I?
• Kristof Rennen

• Architect at Capgemini Belgium
• Microsoft Extended Experts Team Member
• Crew member of the Windows Azure User Group Azug

• http://www.kristofrennen.be
• @kristofrennen
Agenda
•   What is an API?
•   Do we need one?
•   ASP.NET Web API
•   It’s all about HTTP
•   API considerations
     –   Security
     –   Versioning
     –   Data formatting
     –   Design Guidelines
     –   Best practices
• Q&A
API’s
What is an API?
• Application Programming Interface
• Software-to-Software interface
• Contract between software and developers, a specification
   –   Offered functionalities
   –   Technical constraints (limits, ...)
   –   Constraints (legal, branding, ...)
   –   Use as offered by the vendor
• Programming instructions and standards
• Open services to other software developers (public or
  private)
Do we need one?
• Reach to scale
• Smartphone generation
• BYOD with 3 screens: phone, tablet and
  computer
• Self service
• Flexibility in providing content
• You have data to share
• Integration
Direct access
                Concerns
                • Caching
                • Less flexible & more error
                  prone
                • Tight coupling
                • Less transparent
                • Security (credentials and
                  connection string client
                  side)
Service based access
                  Answers
                  • Loose coupling, easy to
                    change
                  • Caching is easy
                  • Transparent
                  • Easily scalable
                  • Error handling
                  • Reusable
Build Richer Apps
Reach More Clients
API Growth




          + 100%   + 50% + 3400%   + 235% + 71%   + 86%   + 46%   + 63%


    Source: www.programmableweb.com – current APIs: 4535
ASP.NET Web API
• Part of ASP.NET MVC 4
• Framework to build HTTP Services (REST)
• Solid features
   –   Modern HTTP programming model
   –   Content negotiation (e.g. Xml, json, ...)
   –   Query composition (OData query support)
   –   Model binding and validation (conversion to .NET objects)
   –   Routes
   –   Filters (e.g. Validation, exception handling, ...)
   –   Testable
   –   IoC (service locator pattern)
   –   Flexible hosting (IIS, self hosting, ...)
It’s all about HTTP
It’s all about HTTP
•   HTTP = Web
•   Client / Server
•   Atomic
•   Cacheable
•   Uniform interface
•   Idempotence
•   Resources
HTTP Methods
•   GET: retrieval from server to client
•   HEAD: = GET but only headers
•   POST: append, annotate
•   PUT: storage from client to server
•   DELETE: remove identified resource
HTTP Codes
• Informational (1xx) (e.g. 100 - Continue)
• Successfull (2xx) (e.g. 200 - OK)
• Redirection (3xx) (e.g. 302 – Found)
• Client Error (4xx) (e.g. 401 –
  Unauthorized)
• Server Error (5xx) (e.g. 500 – Internal
  Server Error)
REST
• Representational State Transfer
• 6 constraints:
  –   Client / Server
  –   Stateless
  –   Cacheable
  –   Layered
  –   Code on demand
  –   Uniform interface
API Considerations
Security
•   Access protected resources
•   Identity, authentication and authorization
•   Content security
•   Use HTTPS if possible
•   Don’t transmit important content in plain text
•   Sanitize user inputs
Identity
• Who is making the API request?
• Usually a combination of a client id and a
  client secret
• Limit number of requests, data volume,
  ...
• Which application is making the request
• Stored within the app
Authentication
• OpenID
• Authentication
• Standard
• Identity providers and
  relying parties
• SAML, Certificates,
  Username / Password
Authorization
                • OAuth 2.0
                • Open Authorization
                • Standard
                • Share private
                  resources
                • Use of tokens:
                  specific resource,
                  specific right, specific
                  duration
Windows Azure?
                 Access Control Service
                 • Claim based
                 • Windows Identity
                   Foundation
                 • Identity providers:
                   facebook, google, yahoo,
                   live, adfs, openid
                 • OAuth 2.0 (draft)
Windows Azure?
Versioning
• Clients depent on a specific “version”
• Once public = never change
   – Don’t change resource URIs
   – Attribute / parameter position doesn’t matter
   – Accept and ignore unknown attributes / parameters
• Design the URL scheme properly
   – http://example.com/api/widgets.json (points to last version)
   – http://example.com/api/v1/widgets.json
   – http://example.com/api/v2/widgets.json
• Wait as long as possible to increase the version number
• Do your best to never, ever, break compatibility!
Windows Azure?
• Multi tenancy
• Web Api Routing
• Different version = different instance
Data Formatting
• Converts data between HTTP and Controller
  world
• Knows about media types (as value of the
  content-type header)
• Type of data sent in the body of the request and
  response
• Accept header to allow content negotiation
• Using MediaTypeFormatter implementations
  (custom implementation easy to add)
MediaTypeFormatter
• Knows about media types
• Tells API which content types are supported
• Can read and/or write
• Understands encoding and charset
• Has a stream to read (request) and to write
  (response)
• Uses serialization and deserialization
Windows Azure?
• Proper data formatting directly influences
  – Performance
  – Scalability
  – Throughput
  – Bandwidth
  – Cost
Design Guidelines
• Design your API for specific audiences
  (e.g. Developers, application users, ...)
• Differentiate your API (why would people
  use it)
• Easy to try, use and understand
• Less is more (start small)
• Documented
Best Practices
• API Health / Status page
  (https://dev.twitter.com/status)
• Monitoring and Metrics
• Documentation
  (https://dev.twitter.com/docs)
• Tryout console
  (https://dev.twitter.com/console)
• Throttling & Quotas
  (https://dev.twitter.com/docs/rate-limiting)
Takeaways
Keep in mind…
•   Make it secure (OpenID, OAuth, ACS, …)
•   Scale it separately
•   Document properly (methods, errors, codes, types, versions, …)
•   Grow piece by piece (start small)
•   Build a community (more developers = more apps)
•   Provision correct domains from the beginning
    – api.something.com
    – developer.something.com
    – something.com
• Version from the beginning (or don’t)
• Think about localization and globalization
Resources
• Books
   – API’s: A Strategy Guide
   – REST API Design Rulebook
   – Getting Started With OAuth 2.0
• Sites
   –   http://www.asp.net/web-api
   –   https://dev.twitter.com/
   –   https://developers.facebook.com/
   –   https://www.windowsazure.com/en-
       us/home/features/identity/
Q&A
Windows Azure Applications Made API

Thanks!                     @kristofrenne

More Related Content

Recently uploaded

Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontologyjohnbeverley2021
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 

Recently uploaded (20)

Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 

Featured

PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...DevGAMM Conference
 

Featured (20)

Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 

Windows Azure Applications Made API

  • 1. #comdaybe Windows Azure Applications Made API AZUG Kristof Rennen
  • 2. Who Am I? • Kristof Rennen • Architect at Capgemini Belgium • Microsoft Extended Experts Team Member • Crew member of the Windows Azure User Group Azug • http://www.kristofrennen.be • @kristofrennen
  • 3. Agenda • What is an API? • Do we need one? • ASP.NET Web API • It’s all about HTTP • API considerations – Security – Versioning – Data formatting – Design Guidelines – Best practices • Q&A
  • 5. What is an API? • Application Programming Interface • Software-to-Software interface • Contract between software and developers, a specification – Offered functionalities – Technical constraints (limits, ...) – Constraints (legal, branding, ...) – Use as offered by the vendor • Programming instructions and standards • Open services to other software developers (public or private)
  • 6. Do we need one? • Reach to scale • Smartphone generation • BYOD with 3 screens: phone, tablet and computer • Self service • Flexibility in providing content • You have data to share • Integration
  • 7. Direct access Concerns • Caching • Less flexible & more error prone • Tight coupling • Less transparent • Security (credentials and connection string client side)
  • 8. Service based access Answers • Loose coupling, easy to change • Caching is easy • Transparent • Easily scalable • Error handling • Reusable
  • 9. Build Richer Apps Reach More Clients
  • 10. API Growth + 100% + 50% + 3400% + 235% + 71% + 86% + 46% + 63% Source: www.programmableweb.com – current APIs: 4535
  • 11. ASP.NET Web API • Part of ASP.NET MVC 4 • Framework to build HTTP Services (REST) • Solid features – Modern HTTP programming model – Content negotiation (e.g. Xml, json, ...) – Query composition (OData query support) – Model binding and validation (conversion to .NET objects) – Routes – Filters (e.g. Validation, exception handling, ...) – Testable – IoC (service locator pattern) – Flexible hosting (IIS, self hosting, ...)
  • 13. It’s all about HTTP • HTTP = Web • Client / Server • Atomic • Cacheable • Uniform interface • Idempotence • Resources
  • 14. HTTP Methods • GET: retrieval from server to client • HEAD: = GET but only headers • POST: append, annotate • PUT: storage from client to server • DELETE: remove identified resource
  • 15. HTTP Codes • Informational (1xx) (e.g. 100 - Continue) • Successfull (2xx) (e.g. 200 - OK) • Redirection (3xx) (e.g. 302 – Found) • Client Error (4xx) (e.g. 401 – Unauthorized) • Server Error (5xx) (e.g. 500 – Internal Server Error)
  • 16. REST • Representational State Transfer • 6 constraints: – Client / Server – Stateless – Cacheable – Layered – Code on demand – Uniform interface
  • 18. Security • Access protected resources • Identity, authentication and authorization • Content security • Use HTTPS if possible • Don’t transmit important content in plain text • Sanitize user inputs
  • 19. Identity • Who is making the API request? • Usually a combination of a client id and a client secret • Limit number of requests, data volume, ... • Which application is making the request • Stored within the app
  • 20. Authentication • OpenID • Authentication • Standard • Identity providers and relying parties • SAML, Certificates, Username / Password
  • 21. Authorization • OAuth 2.0 • Open Authorization • Standard • Share private resources • Use of tokens: specific resource, specific right, specific duration
  • 22. Windows Azure? Access Control Service • Claim based • Windows Identity Foundation • Identity providers: facebook, google, yahoo, live, adfs, openid • OAuth 2.0 (draft)
  • 24. Versioning • Clients depent on a specific “version” • Once public = never change – Don’t change resource URIs – Attribute / parameter position doesn’t matter – Accept and ignore unknown attributes / parameters • Design the URL scheme properly – http://example.com/api/widgets.json (points to last version) – http://example.com/api/v1/widgets.json – http://example.com/api/v2/widgets.json • Wait as long as possible to increase the version number • Do your best to never, ever, break compatibility!
  • 25. Windows Azure? • Multi tenancy • Web Api Routing • Different version = different instance
  • 26. Data Formatting • Converts data between HTTP and Controller world • Knows about media types (as value of the content-type header) • Type of data sent in the body of the request and response • Accept header to allow content negotiation • Using MediaTypeFormatter implementations (custom implementation easy to add)
  • 27. MediaTypeFormatter • Knows about media types • Tells API which content types are supported • Can read and/or write • Understands encoding and charset • Has a stream to read (request) and to write (response) • Uses serialization and deserialization
  • 28. Windows Azure? • Proper data formatting directly influences – Performance – Scalability – Throughput – Bandwidth – Cost
  • 29. Design Guidelines • Design your API for specific audiences (e.g. Developers, application users, ...) • Differentiate your API (why would people use it) • Easy to try, use and understand • Less is more (start small) • Documented
  • 30. Best Practices • API Health / Status page (https://dev.twitter.com/status) • Monitoring and Metrics • Documentation (https://dev.twitter.com/docs) • Tryout console (https://dev.twitter.com/console) • Throttling & Quotas (https://dev.twitter.com/docs/rate-limiting)
  • 32. Keep in mind… • Make it secure (OpenID, OAuth, ACS, …) • Scale it separately • Document properly (methods, errors, codes, types, versions, …) • Grow piece by piece (start small) • Build a community (more developers = more apps) • Provision correct domains from the beginning – api.something.com – developer.something.com – something.com • Version from the beginning (or don’t) • Think about localization and globalization
  • 33. Resources • Books – API’s: A Strategy Guide – REST API Design Rulebook – Getting Started With OAuth 2.0 • Sites – http://www.asp.net/web-api – https://dev.twitter.com/ – https://developers.facebook.com/ – https://www.windowsazure.com/en- us/home/features/identity/
  • 34. Q&A
  • 35. Windows Azure Applications Made API Thanks! @kristofrenne

Editor's Notes

  1. Maarten