18
Welcome to ASP.NET Core in Azure

Asp net core in azure

Embed Size (px)

Citation preview

Page 1: Asp net core in azure

Welcome to ASP.NET Core in

Azure

Page 2: Asp net core in azure

Shahriar Hossain

Microsoft MVP

Trainer

Author, Microsoft Silverlight for Windows Phone

Tech blogger

Microsoft Technical Community Speaker

Page 3: Asp net core in azure

ASP.NET Core & Azure

Page 4: Asp net core in azure

Agenda Introducing lightweight ASP.NET Core • Overview• Getting started• Middleware• Deployment in Azure

Page 5: Asp net core in azure

ASP.NET Core

A new open-source and cross-platform framework for building modern cloud-based Web applications using .NET

Page 6: Asp net core in azure

MVC Web APIWeb Pages

Razor

HTML Helpers HTML Helpers

Controllers Controllers

Actions Actions

Filters Filters

Model binding Model binding

DI DI

ASP.NET framework

Page 7: Asp net core in azure

MVC + Web API + Web Pages =

ASP.NET Core MVC

Page 8: Asp net core in azure

ASP.NET Core 1.0 – Key Values

Choose your Editors and Tools

Open Source with Contributions Cross-PlatformOSS

Seamless transition from on-premises to cloud

Faster Development CycleTotally Modular

Fast

Page 9: Asp net core in azure

ASP.NET Core Pipeline

ResponseRequest Middleware

Page 10: Asp net core in azure

ASP.NET Core Middleware

Page 11: Asp net core in azure

Standard Middlewarepublic class Startup{    public void Configure(IApplicationBuilder app)    {        app.UseStaticFiles();        app.UseWelcomePage();    }}

Page 12: Asp net core in azure

• Static files• Routing• Error Handling• MVC

Built-In Middlewareapp.UseStaticFiles();

app.UseRouter(routes);

app.UseExceptionHandler("/Home/Error");app.UseMvc(routes =>{ routes.MapRoute( name: "default", template: "{controller=Home}/{action=Index}/{id?}");});

Page 13: Asp net core in azure

Middlewareapp.Use(next =>

{return async ctx =>{

await ctx.Response.WriteAsync("Hello from USE");await next(ctx);

};});

app.Use(async (ctx, next) =>{

await ctx.Response.WriteAsync("Hello from USE");await next();

});

app.Run(async ctx => { await ctx.Response.WriteAsync(“Hello from Run"); });

Page 14: Asp net core in azure

Custom Middlewarepublic class MyMiddleware{

private readonly RequestDelegate _next;

public MyMiddleware(RequestDelegate next){

_next = next;}

public async Task Invoke(HttpContext context){

await context.Response.WriteAsync("Hello!");await _next(context);

}}

Page 15: Asp net core in azure

DEMO

Page 16: Asp net core in azure

Community Group• Microsoft Azure Bangladesh• group: www.facebook.com/groups/microsoft.azure.bd• fan page: fb.com/microsoft.azure.bd• Asp.Net MVC - Bangladesh• www.facebook.com/groups/asp.net.mvc.bd• NerdCatsSchool • www.facebook.com/groups/NerdCatsSchool

Page 17: Asp net core in azure

Shahriar Hossain

Facebook

Find me athttp://facebook.com/Shahriar.cse

Personal Blog

LinkedIn

Find me athttp://bd.linkedin.com/in/shahriarhossain

Find amazing .Net stuffs at http://LearnWithShahriar.wordpress.com

Page 18: Asp net core in azure

Thank You