Building production-ready APIs with ASP.NET Core 2.2

Slides:



Advertisements
Similar presentations
1Proprietary and Confidential AirVantage API – Getting started David SCIAMMA – June 13th 2014.
Advertisements

T Sponsors Sameer Chabungbam Principal Program Manager, Microsoft Connector API Apps BizTalk Summit 2015 – London ExCeL London | April 13th & 14th.
RESTful Services with ASP.NET Web API Vladimir Georgiev Technical Trainer & Software Developer
Peoplesoft: Building and Consuming Web Services
06 | Implementing Web APIs Jon Galloway | Tech Evangelist Christopher Harrison | Head Geek.
Windows.Net Programming Series Preview. Course Schedule CourseDate Microsoft.Net Fundamentals 01/13/2014 Microsoft Windows/Web Fundamentals 01/20/2014.
T Sponsors Kent Weare Integration MVP, Author API Management Part 1 – An Introduction to Azure API Management BizTalk Summit 2015 – London ExCeL London.
OAuth-as-a-service using ASP.NET Web API and Windows Azure Access Control Maarten
Building Data Driven Applications Using WinRT and XAML Sergey Barskiy, Magenic Microsoft MVP – Data Platform Principal Consultant Level: Intermediate.
ASP. Net is a rich web framework that leverages well known patterns and JavaScript frameworks to build great web experiences quickly.
Python and REST Kevin Hibma. What is REST? Why REST? REST stands for Representational State Transfer. (It is sometimes spelled "ReST".) It relies on a.
ASP.NET Web API. ASP.NET Members MS Open Source ASP.NET MVC 4, ASP.NET Web API and ASP.NET Web Pages v2 (Razor) now all open source ASP.NET MVC 4, ASP.NET.
Chapter 2. Core Defense Mechanisms. Fundamental security problem All user input is untrusted.
@CloudOps_www.cloudops.com Swift UI in CloudStack with Single Sign-On CloudStack Collaboration Conference 2012.
Welcome to Azure App Services! Amie Seisay
Deconstructing API Security
06 | HTTP Services with Web API Bruno Terkaly | Technical Evangelist Bret Stateham | Technical Evangelist.
ICM – API Server & Forms Gary Ratcliffe.
Securing Angular Apps Brian Noyes
Welcome to Azure App Services! Amie Seisay
Keith Telle Lead Software Engineer Bit Wizards REST, WebAPI 2, and Best Practices.
ASP.NET 2.0 Security Alex Mackman CM Group Ltd
WebApi: What is it? How can I use it? Guy In Front of the Whittaker.
Vladan Strigo CTO NETmedia ASP.NET Web Api Tips & Tricks.
Power BI for Developers Rui Romano SQLSaturday.com
Redmond Protocols Plugfest 2016 Andrew Davidoff Mail, Calendar, and Contacts Graph API Demonstration Senior Software Engineer.
Developers Introduction to the Power BI Platform.
API Manager for Vendorlink
ENOG13 Saint Petersburg Diego Luis Neto SW NL-ix.
Introduction to .NET Florin Olariu
Building production ready APIs with ASP.NET Core 2.0
API (Application Program Interface)
Better RESTFul API – Best Practices
Node.js Express Web Applications
API Security Auditing Be Aware,Be Safe
Automate Custom Solutions Deployment on Office 365 and Azure
REST: Web Services Abel Sanchez.
Node.js Express Web Services
WEB-API & MVC5 - Identity & Security
ASP.NET REST Services SoftUni Team ASP.NET REST Services
What is REST API ? A REST (Representational State Transfer) Server simply provides access to resources and the REST client accesses and presents the.
Web API Design Jeremy Likness | Principal Architect
Twitter & NoSQL Integration with MVC4 Web API
Ashish Pandit IT Architect, Middleware & Integration Services
MVC in ASP.NET Core: The new kid on the block
End-to-End REST Service Testing Automation
…and web frameworks in general
Testing REST IPA using POSTMAN
Explore web development with Microsoft ASP.NET Core 1.0
Azure AD Line Of Business Application Integration
Microsoft Build /11/2018 2:12 AM © 2016 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY,
Building Modern Web Apps with ASP.NET MVC 6
WEB API.
Explore web development with Microsoft ASP.NET Core 1.0
02 | Web API Basic Design Jeremy Likness | Principal Architect
DotnetConf 11/17/ :06 AM © 2016 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE.
Should I Transition to .NET Core? Will it hurt?
Controllers.
$, $$, $$$ API testing Edition
Cloud Web Filtering Platform
Testing RESTful Web APIs
Office 365 Development.
What’s new in ASP.NET Core and Entity Framework 2.2 (Preview 3)
TechEd /22/2019 9:22 PM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks.
…and web frameworks in general
Computer Network Information Center, Chinese Academy of Sciences
#01# ASP.NET Core Overview Design by: TEDU Trainer: Bach Ngoc Toan
Chengyu Sun California State University, Los Angeles
Concepts in ASP.NET Core App
API Working Group September 26, 2019 Includes notes from meeting.
Presentation transcript:

Building production-ready APIs with ASP.NET Core 2.2 Miroslav Popović https://miroslavpopovic.com @miroslavpopovic Building production-ready APIs with ASP.NET Core 2.2

Thanks to our partners!

Introduction

REST(ful) REST RESTful Web resources – identified with URL address architecture type that’s using the existing web infrastructure RESTful services that implement REST architecture Web resources – identified with URL address HTTP verbs – GET, POST, PUT, DELETE, PATCH… JSON or XML Strict and pragmatic approach

ASP.NET Core Benefits Performance Cross-platform Dependency injection Middleware / action filters Routing (conventions and attributes) Content negotiation (JSON, XML,…) Configuration (environment specific, user secrets…) Logging

ASP.NET Core 2.1 Making MVC into an opinionated, forward-thinking, batteries included framework for HTTP APIs HTTPS by default [ApiController] ActionResult<T> Kestrel on Sockets https://blogs.msdn.microsoft.com/webdev/2018/05/30/asp-net-core-2-1-0-now-available/

ASP.NET Core 2.2 (preview 3) API Conventions API Analyzers HTTP/2 in Kestrel Health Checks Endpoint Routing HTTP/REPL https://blogs.msdn.microsoft.com/webdev/2018/10/17/asp-net-core-2-2-0-preview3-now-available/

Production-ready?

Best practices IActionResult, ActionResult<T> View Models Model / input validation Exception handling Logging Paging 2.1 2.1

Security HTTPS OAuth 2.0 Identity Server 4 Third party Token based authentication Identity Server 4 https://identityserver.io/ Third party Auth0 - https://auth0.com/ Okta - https://developer.okta.com/ … 2.1

Testing Unit testing & Integration testing Manual testing Tools (Postman, Fiddler…) Stress/load testing https://loader.io/, https://artillery.io/, https://gatling.io/ …

Documentation http://swagger.io/ -> https://www.openapis.org/ Swagger -> Open API Specification 3.0 API framework Docs Define an API Automate API testing Code generation ... API Analyzers - Microsoft.AspNetCore.Mvc.Api.Analyzers Swashbuckle or NSwag and Swagger UI 2.1 2.2 2.2

Rainbows and unicorns Image source: http://koisuruwakaduma-deri.info/rainbows-and-unicorns-wallpaper/

Usage limiting Limit per token With middleware or action filter https://github.com/stefanprodan/AspNetCoreRateLimit Limit per Client IP Limit per Client ID header

Versioning URL Query string Custom request header Accept header /api/v2/games/ Query string /api/games?api-version=2 Custom request header api-version: 2 Accept header Accept: application/json;v=2 Microsoft.AspNetCore.Mvc.Versioning Supports all types, query string by default (?api-version=2)

Monitoring Simple logging – errors, logs Performance tracking Usage tracking Azure – Azure Monitor, Application Insights, Log Analytics … ASP.NET Core Health Checks Warden, open-source, cross-platform health checks https://github.com/warden-stack Third-party monitoring services https://newrelic.com/ https://stackify.com/ https://www.monitis.com/ https://www.runscope.com/ … 2.2

Closing up https://miroslavpopovic.com @miroslavpopovic

Summary Basics – REST, ASP.NET Core 2.2 Best practices Security Testing Documentation Limiting Versioning Monitoring

Further reading https://github.com/Microsoft/api-guidelines Specifikacije HATEOAS – Hypermedia as the Engine of Application State https://ionwg.org/ - The ION Hypermedia Type http://jsonapi.org/ - JSON API Specification http://json-schema.org/ - JSON (Hyper-)Schema... http://graphql.org/ - GraphQL APIs https://dev.twitter.com/rest/public - Twitter REST https://developer.github.com/v3/ - GitHub REST / v4 GraphQL https://stripe.com/docs/api - Stripe https://www.twilio.com/docs/api/rest - Twilio https://github.com/nbarbettini/BeautifulRestApi - samples and video course https://github.com/miroslavpopovic/production-ready-apis-sample-2.2

Hvala! Pitanja? https://miroslavpopovic.com @miroslavpopovic

Thanks to our partners!