Dive deep into ASP.NET Core 1.0

Slides:



Advertisements
Similar presentations
06 | Implementing Web APIs Jon Galloway | Tech Evangelist Christopher Harrison | Head Geek.
Advertisements

 Vijay Sen Senior Program Manager Microsoft Corporation ES14.
customer.
C# and VB code-focused development with Visual Studio
2/20/2018 7:04 PM BRK1038 Meet Azure Information Protection customers and learn about their success stories Jeffrey Kalfut Strategy & Architecture Manager,
Microsoft Ignite /30/2018 9:28 PM BRK3174
Deliver business insights with Microsoft Dynamics AX and Power BI
Make your app a native part of Office with Add-ins
Examine information management in Cortana Intelligence
Microsoft Virtual Academy
Develop, debug and deploy containerized applications with Docker
ASP.NET Core: Web apps, cloud apps, and containers
TechEd /1/2018 7:56 AM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks.
Microsoft /2/2018 3:42 PM BRK3129 Query Big Data using the Expanded T-SQL footprint with PolyBase in SQL Server 2016 Casey Karst Program Manager.
BRK3288-Discover data-driven apps that learn and adapt
Microsoft /4/2018 8:21 AM BRK3082 Build solutions and apps with Microsoft OneDrive API and Microsoft Graph API Ryan Gregg Principal Program Manger,
Conduct a successful pilot deployment of Microsoft Intune
Review the Nutanix Cloud Platform System Standard solution
Microsoft Virtual Academy
Microsoft Ignite /11/2018 1:18 AM BRK4017
ASP.NET Core 2.0 Fundamentals
Microsoft /17/2018 4:24 AM BRK4012 Dive deep on Skype Web SDK & Skype for Business App SDK - Build apps across Web, IOS & Android Srividhya Chandrasekaran Amit.
Microsoft Ignite /17/2018 4:41 AM BRK4016
Microsoft /23/2018 1:11 AM BRK3180 Migrate CRM OnPremise organizations to CRM Online cloud using Dynamics Lifecycle Services (LCS) Aditya Varma Ganapathy.
Web development productivity with Visual Studio
Deep Dive into the Azure Container Service
Microsoft Virtual Academy
Microsoft Ignite /22/2018 3:27 PM BRK2121
Secure Remote Access to on-premises Web Apps using Azure AD
BRK2264 Move 13,000+ global Dynamics CRM users from on-premises to Online at Caterpillar Inc. Todd Byrne & John Finney 1 Business Unit Name Here.
Master Modern PaaS for the Enterprise with Azure App Service
Get Started with Common Data Model (CDM) and PowerApps
Microsoft Ignite /8/2018 3:50 PM BRK2112
Design Seamless Upgrades to SQL Server 2016 with Query Store
Microsoft /8/2018 4:45 PM BRK3062 BRK3062- Build smarter and scalable applications using Microsoft Azure Database Services Moshe Gutman CEO, GeoSafe.
Microsoft Ignite /16/2018 2:39 PM BRK3307
Use server-based personal desktops in Windows Server 2016
Accelerate Your Transition from Traditional IT to the Cloud
Explore web development with Microsoft ASP.NET Core 1.0
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
Azure PowerShell Aaron Roney Senior Program Manager Cormac McCarthy
Explore web development with Microsoft ASP.NET Core 1.0
Microsoft Ignite /14/ :21 AM BRK2101
Migrate to CRM Online - Tips and Tricks
Determine your role in a managed service
Dive into Predictive Maintenance using Cortana Intelligence Suite
DotnetConf 11/17/ :06 AM © 2016 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE.
Microsoft Ignite /22/2018 3:58 PM BRK2254
Microsoft Virtual Academy
Microsoft Virtual Academy
Automating Windows 10 and software deployments from the Cloud
Task recorder in Dynamics AX
Learn how to use and customize the Dynamics AX interactive help system
12/9/2018 Desktop Virtualization Corey Hynes Kyle Rosenthal President Technical Lead HynesITe Inc Spider Consulting @windowspcguy.
Overview: Dynamics 365 for Project Service Automation
Microsoft Virtual Academy
Keep up with Office 365 evolution in the real world
Microsoft Virtual Academy
One Marketing Template
Manage your App Service resources using Command line tools
Виктор Хаджийски Катедра “Металургия на желязото и металолеене”
Diagnostics and troubleshooting in Azure App Service Support Center
Microsoft Virtual Academy
Build /27/2019 © 2015 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION.
Microsoft Virtual Academy
Microsoft Virtual Academy
Microsoft Virtual Academy
Microsoft Virtual Academy
Microsoft Virtual Academy
Presentation transcript:

Dive deep into ASP.NET Core 1.0 Microsoft 2016 11/14/2018 1:16 AM BRK3194 Dive deep into ASP.NET Core 1.0 Daniel Roth Senior Program Manager © 2016 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

A deep dive into . . . Hosting Request handling Routing MVC extensibility Futures

Get Started with ASP.NET Core 1.0 Go to http://dot.net Docs: https://docs.asp.net Samples and code: https://github.com/aspnet

ASP.NET Core hosting ASP.NET Core is just a bunch of libraries Host in your own process (ex. a console app)

Setting up ASP.NET Core hosting Build the host Setup host services Configure a server Identify startup logic Build the app RequestDelegate Run the host Start the server for the hosted app Handle requests using the app RequestDelegate

Configuring hosting properties Server Server URLs Startup Content root Web root Environment Application name

11/14/2018 Hosting Daniel Roth © 2015 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Hosting in production Kestrel is not yet hardened for internet facing traffic Run Kestrel behind a mature reverse proxy Ex IIS, Nginx, Apache, etc. Proxy Kestrel Internet Kestrel Kestrel

Publishing to IIS Install the new ASP.NET Core Module Native IIS module that forwards request to your application Supports forwarding client certs, Windows auth, IIS sub applications, app offline, logging Setup module in web.config New iis-publish tool will handle this for you Point IIS at your app content root Static files will only be served from the web root Setup IIS integration for your ASP.NET Core host webHostBuilder.UseIISIntegration()

ASP.NET Core Module (ACM) 1. IIS receives a request 2. ACM starts the app in a separate process (if it’s not already running) The app no longer runs as w3wp.exe but as dotnet.exe or myapp.exe 3. ACM forwards the request to the application 4. The app processes the request and sends the response back to ACM 5. IIS forwards the response to the client

ASP.NET Core Module configuration <?xml version="1.0" encoding="utf-8"?> <configuration> <system.webServer> <handlers> <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified"/> </handlers> <aspNetCore processPath="dotnet" arguments=".\HelloWorld.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" /> </system.webServer> </configuration>

Env vars set by ACM for the host process ASPNETCORE_PORT Port to forward the request to ASPNETCORE_APPL_PATH Application path to forward the request to ASPNETCORE_TOKEN Pairing token to ensure only local requests from IIS get received

Hosting in IIS Daniel Roth 11/14/2018 © 2015 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Request handling Request handling pipeline defined in startup Use middleware to process requests Built RequestDelegate used to handle all requests Lots of built-in middleware Routing, authentication, static files, diagnostics, error handling, session, CORS, localization, custom

11/14/2018 RequestDelegate public delegate Task RequestDelegate(HttpContext context); © 2014 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Middleware app.Use(Func<RequestDelegate, RequestDelegate> middleware);

Middleware public class MyMiddleware { public MyMiddleware(RequestDelegate next, …) { … } public async Task Invoke(HttpContext httpContext, …) { … } } app.UseMiddleware<MyMiddleware>();

Middleware Middleware1 Middleware2 Middleware3 // logic next(); Request // logic next(); // logic // more logic // more logic // more logic Response

Request handling Daniel Roth 11/14/2018 © 2015 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Routing Routing middleware calls into IRouter IRouter creates a RequestDelegate for handled requests RouteCollection iterates through a list of IRouters and stops when one handles the request Route implements route templates and calls a target IRouter when the request matches RouteBuilder creates a RouteCollection using a default IRouter for the target of added routes MVC sets itself up as the default IRouter on the RouteBuilder Supports link generation too

11/14/2018 Routing Daniel Roth © 2015 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

MVC: Application Parts ApplicationPartManager is the one-stop shop for discovery logic in MVC Controllers, View Components, Tag Helpers, Razor compilation references Application parts are resources from which to discover features (ex assemblies) Feature providers populate features from the application parts

MVC: Application Model Conventions Application model is a representation of your MVC app that you can read and manipulate Controller names, action names, action parameters, attribute routes, filters Modify the application model with custom conventions Ex Web API compat shim Explore your app Ex. Swagger

Application parts & conventions 11/14/2018 Application parts & conventions Daniel Roth © 2015 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Roadmap (subject to change!) 1.1 - Q4 2016 / Q1 2017 URL rewriting Response caching WebListener server (Windows only) Middleware as MVC filters Precompiled views View Components as Tag Helpers Improved Azure integration 1.2 - Q1 2017 / Q2 2017 WebSockets SignalR Web API security “Razor Pages” (views without MVC controllers)

Futures Daniel Roth Microsoft 2016 11/14/2018 1:16 AM © 2016 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Join us! Code: https://github.com/aspnet/home Docs: http://docs.asp.net Live: http://live.asp.net

Please evaluate this session 11/14/2018 1:16 AM Please evaluate this session Your feedback is important to us! From your PC or Tablet visit MyIgnite at http://myignite.microsoft.com From your phone download and use the Ignite Mobile App by scanning the QR code above or visiting https://aka.ms/ignite.mobileapp © 2014 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Free IT Pro resources To advance your career in cloud technology Microsoft Ignite 2016 11/14/2018 1:16 AM Free IT Pro resources To advance your career in cloud technology Plan your career path Microsoft IT Pro Career Center www.microsoft.com/itprocareercenter Cloud role mapping Expert advice on skills needed Self-paced curriculum by cloud role $300 Azure credits and extended trials Pluralsight 3 month subscription (10 courses) Phone support incident Weekly short videos and insights from Microsoft’s leaders and engineers Connect with community of peers and Microsoft experts Get started with Azure Microsoft IT Pro Cloud Essentials www.microsoft.com/itprocloudessentials Demos and how-to videos Microsoft Mechanics www.microsoft.com/mechanics Connect with peers and experts Microsoft Tech Community https://techcommunity.microsoft.com © 2016 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

11/14/2018 1:16 AM © 2014 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.