Monday 21 October 2024

ASP.NET Core 2.2

hi my name is Glenn Condren I'm a program manager on the asp.net team and today we're going to talk about some of the cool features coming up in a bit in their core 2.2 we're going to specifically talk about a few of the features we have that build together really nicely in order to help you build api's api is everywhere most of your applications probably have a couple floating around and so in 2.2 we really wanted to focus on making that experience better so we're gonna talk about api's our analyzers and our conventions and we're going to talk about health checks as well and so bringing a little bit of cloud native micro services in here and then at the end we'll have some links to where you can get started where you can find more information and where you can see a demo app that kind of shows off every feature that we talked about plus a lot more that we that we won't have time for today so let's get started with some demos so here we have an asp.net core API project what it is is this is its kin this is a startup class and all we do is we add MVC we say that we're using the 2.2 version compatibility switches we add some swagger if you're not using swagger swagger is a way to kind of document your api's and show other people that other people consume your API eyes and knowing the sorts of things that your API does it describes it it tells everybody about the things that you're going to return and the things they can do with your API then we add an ended identity framework here with this section of code and in this case we're also starting to use this net topology suite which is the beginnings of using a new feature in AF core 2.2 their spatial types we don't talk about it much but it is a feature that you can check out if you're interested in and then at the end here we add the necessary services to be able to do health checks in asp net core 2.2 which we'll talk about a lot more later so to begin with here let's open up the browser now I have the browser open to my application running and it is hitting the swagger slash wagga endpoint right if we go back to our startup CS just here we say add us this in this line of code adds this wagon endpoint that I'm hitting that displays swagger UI and what swagger UI lets you do is describes your applique it shows you me the end points that I have in my app but it describes the models that my application can return so in this case I have a solutions at places controller it has a get that returns a list of all the places that I have in my database and has it get by an ID which returns a specific place and then if we look at the swagger UI for that then it has the places I can try it out I can execute this and it returns me a list of places from my database here in the browser so I can test out my API and I can also try it out by passing in a parameter now we're gonna say let's execute one now if you look up here in my dataset I don't actually have my IDs of goods so there's not gonna be a one and that's interesting because the UI says that the only things that this API could respond with is 200 okay but we know that's not true because right here it's returning a 400 and it's returning this type some type here which is not documented in any way in our swagger now the reason for that is that in order for the code that generates the swagger document from my code to know what my API does I need to give it some attributes so in here you need to add more information telling the swagger generator what stuff it does so into 2 we added some stuff to try and make that easier and we did that by having a package but i'm going to uncomment here this is asp net core MVC api analyzers what these do is kind of augment your tooling experience to let you know when you're doing things that aren't documented and so if I build my project now with this new package ref and I come down here and I look at my warnings you'll see I have this action method returns an undeclared status code 404 and if I go into my actual method then what I see is return not found has a squiggly line and it has a squiggly line because I'm not documenting the fact that I'm returning this not found and so if I control dot on this it'll say hey let me add all the attributes that it looks like you're doing here and it's saying okay you're going to return the 200 you go through 10 to 404 and you're going to do this producers default response type so if we just do that we control dot and then save a file then if we head back over here to our swagger endpoint then what we'll see is that we now have this new model this problem details model which is another feature that we added in to two problem details are basically a type that we will return that describes what ask what went wrong when something bad happens or when something that when you don't tell us to return something else will return a problem details when there are problems it's just a structured way of giving information back to people who aren't humans necessarily so you could parse this and you could understand it when you're writing a client that talks to this API so now it now that we've added those attributes the swagger doc you the swagger document now knows that we could return to 404 we could return a 200 we could return default right it's pretty cool you get some good this just gives you hints it gives you help when you start doing stuff but adding all of these attributes to every one of your API is this kind of kind of adds a lot more boilerplate code to your controller and we like to try and avoid that so over here in our program CS we can see us another feature that we added - - - which is the concept of API conventions so with an API Convention what it's saying is what this is saying is add to this whole assembly an API Convention type of default API conventions we ship this type and you can ship your own if you wanted to you could have this code in here with any type that you want that implements this stuff and if we go to the definition of this type we can see it has a lot of Method declarations with a lot of attributes and so if we look at our get 1 because that's what we've been live been looking at then this says name match prefix so this is saying any methods in my application to start with get and have an ID have something with an ID suffix so this could be you know place ID or something like that then apply these attributes to it dosent default attributes because if you've got to get that accepts an ID you probably get a return of 404 when that ID doesn't exist yoram generally going to return a 200 when that does when it is there and we know we're gonna do the default response type stuff because that's what that's what we do now into two so now without any attributes in my controller if I go back to my swagger document and hit the same endpoint then I'll be able to see the same thing that we just saw where I'll be able to go to places go to places ID now I have this 200 I has documented that I've done a for f4 it's documented that I've got a default so if you are following some patterns or guidelines within your organization that either are the same as the ones that we ship or different but a fairly consistent or you want them to be consistent this is a really good way for you to get reminders and hints and help around getting just the right things into your app now one thing that your one thing is that we do not give you warnings and squigglies if you give us give more information than what you return so it's not a warning from the analyzers point of view if you say that you returned a 404 but there's no code that we can tell to actually do it that's us walking the line because sometimes it can be difficult to know exactly what you do and we believe that over specifying information is better is is good it's okay but under specifying is really bad so we want to give you help to under 4 when you're under specifying but we're not really worried when you go when you say more than what you're actually gonna do okay so then the other feature that we saw you know startup CS was health checks so this is a new feature that we added specifically around building using load balances deploying to things like kubernetes using the power of a clouds like you like using ah sure or or one of the other clouds so and the reason for that is you frequently want to be able to ask your application are you okay should I send traffic to you should I restart you and you can do that today you could make a controller you could put an endpoint on it you could make it that controllers job to report the health of your application but that's a fairly common pattern and you writing the code to check all of your dependencies potentially it can be can be some time consuming so we wanted to just remove that from something that you needed to think about so we have a service you could add this health check service this gives you a service that you can consume in your application like any other service that's added to the DI system so you can go manually invoke this to check whether you're healthy within your app if you wanted to and then we also add this dbcontext check so what this is going to do is if I ask the health check system are you healthy if it cannot connect to the database that this context is configured to talk to it will say no I am NOT healthy if it can talk to it then he will say yes I am healthy and what that lets us do is we have this middleware you can add to your application saying app don't use health checks / ready in this case and what that means is if I go to slash ready in my application then it says healthy because I have a docker container running on my machine that's running sequel server and my application is communicating with them if I was to go and stop that container then it would return unhealthy right makes sense so this is interesting and it's valuable for things like if I was going to load balance to this application I was gonna have several instances of it and I was going to put say and as a traffic manager or any load balancer in front of those several instances and then route traffic to them say on geographical location maybe you want to deploy an application to several regions of the world and you want you want to prefer the locations that are closer to any customer that's going to come to you well you need an endpoint that your load balancer can know don't send traffic to this one because it's now down and in order this let you do that you just tell the load balancer the slash Radio endpoint is going to be the one that you hit in order to tell whether or not this app or API is ready and we are going to use that now what this where this also becomes really powerful is if you have a file that looks like this guy this is a kubernetes configuration file then just here we have the concept of a readiness probe now a readiness probe in kubernetes means that if this prove there's two things that it will do very importantly so let's talk about them in order if you're doing a deployment you're deploying a new version of a service that you have running in kubernetes and the readiness probe never says that it's ready that never returns a success or 200 then the deployment doesn't continue it just sits there and waits for somebody to resolve whatever that problem was so for example if you add a new dependency to your API and you forget to deploy that dependency as part of your deployment but you do add it to the health check system for the ready endpoint this will be caught right and we all know and you won't be able to actually finish that deployment the other thing that already readiness probes do in communities is you can't they will not route any traffic to you just like a normal load balancer scenario we talked about if this area ever returns false so super powerful from cuba Nettie's it plays into what is built in here the other concept that kubernetes has is a liveness probe so in here we could do so we could write liveness probe and we could do exactly the same thing that we just did we could do a hasty to beget and we could add anew them another path now generally what we want here is we don't want to do the same exact path we don't really want to say slash ready because the difference here is that when a liveness probe returns unhealthy crimini restarts it so we really want a different set of checks to be available on ready versus liveness versus ready and so you what we were the way that you would do that is in your arc in your startup CS you would add a second use health checks middleware in here and you would name all of your checks and then in your in your options we use health checks middleware then you would only run the ones that made sense so you can interview where you can add a new health check options in here and then you can configure how that works and you can name when adding health checks you can name them and you can add tags to them in a future version which will let you tag health checks and then only execute subsets of them for when you want to do the different tasks but we expect readiness to be like the main line the one that the vast majority of people need in all sorts of scenarios and liveness is interesting as well when you're in other places where somebody is monitoring you and wants to reset you and so the last thing that we should mention is you noticed over here in the CS proj I have this new asp net core hosting model up here and says in process now in process asp net core hosting means that when running in IRS you should see significant performance improvements because of us running within the IRS process instead of it as today we start up a second process and we send all the traffic over so those of you using ia yesterday with asp.net core should get some pretty significant perf improvements by by switching to this model and yeah that's all of our demos today ok thanks for watching these demos here's a few links to help you learn more and get started this first link here is how you can download all of the pieces you need to be able to run asp.net core 2.2 and dotnet 2.2 we have a link here to a demo to a sample app with all these demos came from so on github you can send pull request log issues talk about it ask about it it's there as a resource for everybody to learn and it is really supposed to be about learning not about like you know shipping it to production so it has lots of stuff but it shows off all of our features really well and then that will these last couple of links are our blogs almost nothing that I talked about today would be a surprise if you had been following along reading the announcements we show code we talk about roadmaps we can be posted we post there fairly regularly so if you want to follow along in the future then check those out and read some more and thank you for watching have a great Kinect

ASP.NET 5 & .NET Core (RC) announcement & Scott Hanselman demos

[Music] >> Scott G.: What I'd like to do is actually start off this event with some cool demos. And I'd like to invite Scott Hanselman on stage to actually show off both what you can do with VS 2015, as well as highlight a whole bunch of new capabilities that we're excited to bring to market for the first time as part of this week's announcement. So here's Scott. [Applause] >> Scott H.: Cool. Thank you, sir. So today we're going to be showing a whole series of demos based on a health clinic theme. We'll be using healthcare throughout. Everything will be based on this health clinic. In this particular application, it's going to be the public facing app for the health clinic. And this has been written in ASP.NET 5 using the .NET Core CLR. And this is kind of a Hello World demo you've seen before, and I'll go run this app. You'll see what you've usually seen. This is a standard the Hello World. And now of course ASP.NET 5 is open source and .NET Core is open source. We use a lots and lots of open source at Microsoft. And, in fact, I can usually bring in additional open source. From Visual Studio, I'll say Manage NuGet Packages. NuGet is where .NET service side libraries come from. You can see a number of popular ones there. But I'm going to try to bring in a library called RequireJS. This is a JavaScript library. It's a client side library that people use in other platforms. And you'll notice here that in Visual Studio Update 1, it's actually promoting that I use Bower instead. Bower is a package manager that's appropriate for client side technology. So now we've got tooling within VS for me to go and bring in that JavaScript library. And you'll notice here on the side Bower and MPM are both available as package manager options. And now I've brought RequireJS to that client side loader. So we've got all that rich tooling for technologies that people want to use. Now, I want this Hello World app to look a little bit prettier. So I'm just going to pick these up, some existing assets, and drop them in and then replace. And then I'll come over here to Edge and I'll hit refresh. And then the front end of my application looks nice. And that kind of make a change and hit refresh experience is what you would expect with static things like CSS and JavaScript. But I can also go back into Visual Studio and look for the home controller, for example. And I'll grab some actual C# and I'll make a change to the code, best health clinic ever. And then I'm just going to hit save. But I'm not going to do a build. I'm going to come back into Edge and then hit refresh. When we go over to the About page, it's actually recompiled that app. So I can have that kind of make changes to code and hit refresh. Make changes to code and hit refresh. The experience you'd expect with a Ruby or Node, but you're getting that with the power of C# and Core CLR. That actually compiled the application itself. So Visual Studio didn't do the compilation; ASP.NET did the compilation. And that's going to enable us to do that across platform as well. A really nice experience. This application is going to need diagnostics and telemetry. I'm going to bring in Application Insights. And this is going to send all the performance and availability and diagnostics information and send that telemetry up into the cloud. So as I run this application, if errors occur, exceptions happen, either in JavaScript or in .NET, that will be sent off to the cloud. So we'll right click and hit publish. And we're going to send this to the East U.S. We've got datacenters all over the world. In this case we're going to send this one to the East U.S. While that's happening, I'll run over into the Azure dashboard, and there's a thing called Traffic Manager that allows me to do geographically load balanced systems. We have this not just in the East US but also North Europe and Brazil all at the same time. So this public facing website is now suddenly available everywhere. What can I do with that, it just got published, it popped up. I'll switch back over to the dashboard and pick that website and click on tools here because I want to do some performance testing. Now that I have a scaleable website that's been sent all over the world, I'm going to performance test it. And I'm going to do that using the power of the cloud to create that load. We're going to generate load from the East U.S. And with Azure and Visual Studio Online we're going to collect a whole bunch of computers that are going to now start hitting that machine and generate load. That's going to take a few moments to start up. So I'll show you some load that I generated just a few minutes ago. You can see here we had 130,000 successful hits. I can see how many requests a second. We're hitting that sight. So already I know that I'm going to have a great experience no matter where in the world that we are. And all of that information is being sent into Application Insights. Now, I can look at that Application Insights diagnostics and telemetry in Azure, but also I like spending time in Visual Studio and with Visual Studio Update 1 we have included the ability to look at that telemetry from within the IDE itself. So I'm going to come in here and bring up the Application Insights search and look at the time range over the last few hours to see that telemetry data. And here I've got all this information that I can query and see page views, what browser it used, where the data came from. Look at time ranges. I can dig in on individual page views and see all the detail, both server side and client side, and query that richness of the telemetry. But I can do it from inside Visual Studio. So you can see that with ASP.NET .NET Core and Azure and Application Insights I've got everything that I need in one place. >> Scott G.: Great. Thanks, Scott. Excited to announce today some of the things that Scott also showed there in terms of the ability to use the new ASP.NET 5 based on the new .NET Core runtime that enable a bunch of new capabilities, including the dynamic compilation, that we're releasing the release candidate of both of those technologies this morning. And they're now available for you to go ahead and take advantage of and use. And what's great about the release candidate is not only can you download them, build apps with them, they also include a Go live license and enables you to also now start to go into production and start deploy real apps to real customers using all those technologies. Let's take a look at what you can do now with the new support that's cross platform. So here's Scott. >> Scott H: Thanks. I liked that little bit applause when we talked about how we can get this to run everywhere. I hope you enjoy this. I'm going to go right click, say publish again. When we publish something to Windows, we can go to Azure, we can go to IS, when we publish to Linux, you'll not necessarily FTP that up to Linux, you'll send it maybe up to Docker in a container. You can notice here, when I hit publish in Visual Studio, that Docker appears in the list there. It's first class inside of Visual Studio. So I've gone and said publish to take the exact same ASP.NET 5 application running on the .NET Core RC1 and I'm going to send this now up to Azure on a Linux VM with Docker inside. This is using the same Docker tools we already know how to use. Just like we saw that integration with Bower, a tool that people know how to use at the command line, here's an example of using Docker, another tool we know at the command line. I'm going to bring up the command line. And in fact I'm going to use the new SSH client that you may have heard we're going to be shipping with Windows. Little tiny clap for that. Appreciate that. [Applause] So what we're going to go and SSH into this machine over here. This is now switching from the command line now. We are looking at Ubuntu running in Azure. I'm going to hit top to prove it. You can see Docker right there using up some CPU as Visual Studio is sending that up to Docker and that build is being sent. And that Docker container is going to be one of these images. Those are Docker images. You can see here's my health coming in here. I can say Docker PS A. Just 14 seconds ago was created the image called My Health and in the background, in the bottom left, you can see Visual Studio trying to talk to Docker to get that fired up. That is going to be a version of this exact same website. So I can publish to the operating system of the choice that I have, publish to the container that makes me happy. And in this case that's going to pop up. Now this again has been kind of a Hello World demo. Sometimes when we see Hello Worlds we're not really impressed. We're like okay there it is. Hello World. But we are not joking when we say this is ready today. This is a Hello World demo. Let's see a more advanced one. Let's see the private section of this health clinic with authentication, with SQL and entity framework with Linux talking to SQL Server. This is real data on a real app, running in Docker. Now, you could run one app on one VM in one Docker container, but in a real sophisticated production environment you might start including things like many Docker containers on many virtual machines. This is in fact running in a cluster of virtual machines running multiple Docker containers. And we managed all of that with the Azure Container Service. That takes care of all the complexities of creating all of those containers. And then I can go and layer on top of that and include technologies like Mesos or Marathon to manage them. So I'm getting to use the technologies that I want to use on the cloud that makes me happy. So hopefully that gets you excited. You can go and make this happen. You can start writing apps with ASP.NET and C# and putting it on Docker containers and Linux today. Start doing that now. This is some of the stuff we're doing today. Let's take a moment and talk about the potential for tomorrow. So I'm going to switch to another machine here. Here we go. So here I'm on an Ubuntu machine, and I'm going to look in this folder and see that I've got some C# code there. And, you know, wouldn't it be nice if at some point in the future I could do something like App Get and ask Linux for .NET and be rest assured that .NET was there and ready for me; and wouldn't it be nice if I could say something like .NET compile and then compile a .NET application and run this on Linux. This is a preview of some of the work that we're going to see early next year where .NET and the .NET command line here is going to allow us to go and run an application like this with a .NET Core on Ubuntu. Now, this example is the .NET that you know and love. This is the .NET where we've created a DLL and we have a Jitter and we have a garbage collector and all that. But wouldn't it be nice if I could do something like this and say dash dash native and use that .NET Native technology that you're familiar with for Windows that makes Windows universal apps so nice. I'm going to go add dash dash native there. And I'm going to compile the application, same exact application, same compiler same command line .NET compiler. There's the original one and there's to be clear a statically linked, no dependency required, native code application compiled from C#. And when I run it, it's fast because it's native code running on Linux that was compiled with the open source .NET Core and this is where you applaud. [Applause] I know it takes a moment to absorb. But that's a big deal. So I'm going to go ahead and just pull that applause from you. So this is some of the future work that we're doing. But I want you to know that you can take .NET Core RC1 today and start building applications. You can deploy them in Docker, deploy them on Linux, Ubuntu and Red Hat, and put them in Azure. And I hope you have as much fun working with it as we had building it. >> Thanks, Scott.

ASP NET Razor Into the Razor'verse

alright everybody we are back when and talking about asp.net racer take it away are you guys doing good Oh take it away sir ready to go yeah all right so I'm gonna talk about razor today and there are a lot of razor things to cover so I'm ready to go ahead and switch to my my screen here when you guys are we're all set sir all right so hello net Kampf hopefully everybody's enjoying the show so far my name is ed Charbonneau I'm a developer advocate for progress and let me get a justed here there we go I'm a developer advocate for progress software a Microsoft MVP and today we're going to talk about razor into the razor vers razor is an ecosystem that has expanded over the last few years and includes many different razor technologies so we have razor the engine itself the syntax razor views HTML helpers razor pages raise your tag helpers blazer and it's razor components so we're gonna start at the top level but we are gonna deep dive into each one of these things we only have a short period of time so let's get going the first thing that I want to cover is the syntax itself so razor the syntax is a template markup syntax based on the sea shark programming language the nice thing about razor is that we don't have opening and closing tags with razor we use the @ symbol to open up our template and it intelligently finds the end for us so if we look at the old way of doing this in web forms you can see it's a lot more verbose than using razor if we look at something a little more modern like angular we still have this very specific angular language that we're using to define our templates in our markup where razor is just using c-sharp and markup so there's some benefits to razor here and there's even more with the ability to do complex expressions so we open up an @ symbol we can do all sorts of things in this example we're doing some math and just writing out an out into our HTML we also have control structures like for each if then statements try catches all of those things are valid within our c-sharp syntax or a razor syntax here's an example of an if statement and we can branch out and write out different portions of HTML to our page using razor this way so let's talk about razor execution really quick it's actually a complex thing happening behind the scenes so razor generates c-sharp code from the template if then compiles that code into a dotnet assembly it loads it into memory and then execute that compiled code so that's the razor syntax that's a quick overview let's jump into razor views in HTML helpers next so razor views our streamlined way of writing code focused templates in dotnet there return from a controller action as a view result and the content is generally made up of HTML and components that are HTML helpers now other component models are valid here like tag helpers and razor components but typically with views you'll find HTML helpers being used this project template comes from file new project if we click on web application and specifically that Model View controller application we're talking about the view portion here so razor views in that template so that's razor views in a nutshell we're gonna talk about HTML helpers next so HTML helpers are the component model for razor views they're invoked as methods within HTML razor views they encapsulate code and HTML so we're building components using this this structure at the end of the day these things turn into an HTML string and that's really important to remember here and we're gonna get into the reason why it's important later but the main takeaway here is these things turn into HTML strings so keep that in mind so this is what an HTML helper looks like and how we use it in a razor view we call at HTML and that identifies that we're info being a helper and then we call the method on that extension method on the HTML class now we pass in our parameters and output the type of helper that we were looking for in this case we're doing an action link so we get a nice anchor tag with the path that we're specifying in our HTML helper creating these is actually fairly simple we just need to extend my HTML helper as an extension method and we've returned I HTML content so let's take a look at what that looks like if we look at the function signature signature it's very simple we take in IH tml helper we output IH tml content and we have an example here of a hello helper we're gonna write out a span with a message inside we're actually going to break away here and do a quick demo and we'll view that HTML helper in visual studio so let's do that let's break over to visual studio and in this solution I have three projects and we're gonna start with the razor view project and this is identified specifically by saying that there is a controller model and view folder so this is an MVC application and we have razor views so I'm gonna open up the index page here the index view will zoom back out and we can see that we have our razor mark up and we've got a couple lines of HTML a mark up here and two things I want to point out specifically we have that HTML helper that is at HTML hello and we're passing in the value world and I also have a tag or a piece of razor markup that is at this get type base type so I'm gonna discover what the actual type is that's resolved for this view so that's gonna be interesting first let's open up our HTML helper and take a look at how that was built so first of all we're returning an eye HTML content and the method name is going to be hello and we're passing in a HTML helper as an extension method so that's what this keyword is for we're extending the eye HTML helper interface with method called hello and passing in the message job parameter we're gonna write that out into a span an HTML span and that gets turned into an HTML string so this is the basis of an HTML helper which act as components in a razor view so let's give this a run I'm going to ctrl f5 we don't need a debug I just want to see what this looks like on the page so we're gonna load this up in the browser and our application loads and we have hello world this is our HTML helper being executed and we also have that segment where I said at this so tell me what this thing is and what is the base type so this is actually the razor view is a razor page of T so a razor page takes some sort of type in this case it's an object that object is actually your model being passed into the razor view so interesting stuff there let's break out again to a folder view so what I'm gonna do next is a little crazy I'm gonna dig into the bin folder for this project and inside of the bin folder we're gonna find a project views dll file I'm going to use a free tool called telluric just decompile to open up this razor view and let's go ahead and see what was actually compiled from a razor code here so I'm gonna dive in if you see me dismissing a window here this is actually trying to decompile any dependencies that are on that object don't need all the dependencies decompiled I just want to look at the specific razor view so inside of this razor view this is what was compiled from that code that we wrote and we have our our class of view home index that inherits from razor page so that's where the razor page came from of tee object also interesting inside of this is that we automatically generate some properties here so we have an HTML property so remember in our code when we wrote at HTML that's actually where that property is being extended with our extension method but what's really important is at the very bottom here so we have a task at the bottom called execute async and what this does is actually renders the string based on all of the markup that we wrote in our razor library so we have write literal and write and in here you can see our actual HTML helper being executed all of this stuff gets turned into a literal string an HTML string that we can view in the browser so that's very important to know because later on we're going to talk about rays or components and things are going to be much different so let's go back into our presentation and we will talk about the razor views and sorry razor pages in tag helpers next so razor pages was introduced with asp net core it's a page focused approach versus model-view-controller like the previous template so pages incorporate their own controllers actions and routings inside it's in a it's able to be integrated with MVC so these things aren't mutually exclusive you'll find that's a common trend with all the things I'm talking about today the content is actually made up of HTML and typically tag helpers so tag helpers are new to asp net core we're going to talk about those next but we can still use HTML helpers and even razor components in a razor page will show that last if we do file new project and choose web application we will get a razor pages application this is different from the model-view-controller application as we'll see in a minute if we look at them side-by-side the asp net MVC application has controllers models and views or a razor pages application has just a pages folder and inside of that pages folder each page has their own code-behind file so that's how they're primarily different the razor page versus of view is also written differently so we have an at page directive this identifies that this is a page in a razor pages application we also have an at all directive that ties into the code-behind so this is where the code vine comes from this is where the page model is represented so we can set properties and things as you see in the example here we have a message that is used within our markup on the left-hand side now also unique to raise your pages is we have an on get method these methods actually correspond to HTML or HTTP methods so get post put in delete so you'll have on get on put on post on delete and those things are used in place of controller actions so the the page concept is more of a vertical slice and we're able to do everything in the code behind so the component model for razor pages is actually tag helpers and tag helpers our asynchronously server-side processed pieces of HTML these you these use tags and attributes much like HTML does which helps eliminate context switching between HTML and C sharp they're also designed for a unit testing in mind I don't have time to show that today but it is something that is a benefit of tag helpers over HTML helpers so HTML helpers versus tag helpers when you're writing them there are some fundamental differences between the two now one of the things I like to point out when talking about these two types of component models is HTML helpers are nice they have nice fluent syntax but when you go to add things like HTML attributes such as a class you have to do some special things so when we want to add a class which is a normal thing normal operation to do in HTML we have to do something like this we have to new up in add-on of this object then we have to escape the word class because that's a reserved word in c-sharp so things start getting a little messy when we have to do this HTML helpers have this problem tag helpers alleviate this problem by using tags and attributes directly so this same example below we're producing the same output but with very minimal effort the tag helper portion of this is actually the a sp4 attribute so that identifies this as a tag helper and Razer knows how to handle this and they output the same thing and what's nice in the second instance here is our class when we define it we actually get intellisense within visual studio and we don't have to escape it and create those anonymous objects and those types of things if we look at a more complex example like a teller at grid we have a nice fluent syntax with the HTML helper but if you look at the tag helper it looks a lot like HTML and inside of a big page this doesn't really stick out and there's no context to switch between if we want to control the scope of tag helpers within our raiser pages we have special directives to bring those things into scope or remove them so we can use the add add tag helper directive and there's built-in tag helpers in asp net core all the things that you need to build a form are there and if you look at something like the telluric UI for asp net core there are both asp net HTML tag helpers and tag helpers for both sorry for both razer tag helpers and razer HTML helpers this is a mouthful guys there's about 60 UI components there that support either type of type of model so an example of that would be a big picker and you can see these are very easy to read and understand so let's jump into a raiser pages demo and we'll decompile that one at the end as well so I'm gonna pull my Visual Studio project back up here and want to switch projects over to raise your pages and we're gonna dive into the raiser pages project and right away you'll notice I only have a pages folder now the code for our index page is actually represented in the code behind and we'll look at the mark-up as well so this is the raiser page for our index page the mark-up is in this CS HTML dots yes file behind it and you can see I have an on get method that's not being used so we're not actually doing a whole lot of work here but it is nice to know that it's there most of this page is written in HTML and I also have a tag helper on my page here this is a some tag helper so we're gonna talk about custom tag helpers for a moment so let's jump over to custom tag helpers and we'll take a look there and then we'll go back into our demo oh sorry that that actually got removed for time concerns we're actually going to dive into the code instead of some slides here so in our tag helper it's a little bit different than writing an HTML helper so instead of writing at HTML we're gonna target a specific tag and we do that through HTML target element this is a directive that we can use to target something inside of our markup so I have a tag helper called dotnet - comp that I'm going to be targeting with this tag helper and when we build a tag helper we need to override or inherit the tag helper base class and override the process method when we do that we're able to take in content and write it back out as HTML so we're gonna take in some parameters we have a property called name we're gonna take that in as a parameter and then we're gonna write that out to a string and that string is going to say property the the name property loves dotnet comp we're gonna ignore some errors here visual studio is not playing along for dotnet cough but anyhow once we're done we're gonna say we're going to set that HTML content and then we're going to render that out to the browser so we're consuming this custom tag helper here you could see it's highlighted it says dot net comp I'm passing in my name and we're gonna render it that out to the browser so we'll ctrl f5 and again this is the component model for a razor page and we're going to write out ed Charbonneau love's net comp that's our custom HTML helper let's take a look with inspect and you can see we're writing out a span in that text that was produced by our tag helper gets emitted there so let's take one more look here we're gonna go back into the folder view and we're gonna find our dll file again so we're gonna go bin I'm in debug and we have our project dot razor or project views dll we're gonna decompile that I'm gonna ignore any dependencies once again I don't need to decompile the entire universe I just want to see the one page that I've written some custom code in let's see what we get here this is the compiled version of that razor page and in that page we have a static class or a public class of pages underscore index but notice here it's inheriting from page so a razor views actually inheriting a razor page razor page is just a page there's some similar properties in here you'll find hTML is here so we can still do HTML helpers and down at the very bottom once again we have this asynchronous task called execute async which turns everything inside of that razor page into a literal string so again keep that in mind that's very important that is the main takeaway that I want you guys to have today so we're gonna go back and we're going to close just decompile and next we're gonna start talking about blazer so blazer brings with it razor components so razor components is the component system for the blazer framework now can still be used in asp net projects which we will see in a moment but for the most part keep in mind that the Razr component model came from the blazer framework now blazer and razor components use the razor syntax they are a component architecture versus HTML generation tools they create what is called a render tree which is a dom abstraction i'm going to show you a little bit of that in just a moment there file extension is dot razor vs. dot CS HTML and one of the reasons that we have this distinction is because how different they are in execution so razor files are used to generation and these special dotnet classes that implement a render tree so what is a render tree well in a typical JavaScript or jQuery application we're responsible for writing directly to the Dom Blaser does that work for us and it does it through a difficult job a script application we use a selector using jQuery in this example we might find some elements in the Dom remove them and replace them so this is an expensive task for our browser to do so for removing things from the DOM and then scrapping all of that and writing it back there may be some things that were actually unchanged in this process but we've gone and removed it and re added it to the bra the browser anyway so this is a very efficient model of operation pleaser does something different so Blaser creates a Dom abstraction or a shadow Dom so it has a copy and object graph as you if you will and it can operate on this object graph much like it would directly in the browser so if we will remove elements using Blaser it will do it to the render tree first and then when it adds things back and notices that some elements may not have changed it only goes to the browser with those changes so there's a difference and says only update the things that have changed in the browser so this is a system that is very efficient and we don't want to circumvent that so Blaser has all of these wonderful features the component model and the render tree are some of the key features that I want to talk about today so we're gonna go into a blazer application and first I just want to mention that with these components we also have all of these available with telluric UI for Blazer so let's jump into a blazer application and see the difference between the views razor views and razor pages and now how razor components act within the razor environment so I've got in my project here a razer components project in my solution and again you'll notice that we have this pages idea so we don't have model views and controllers so this kind of is a the next step in raiser pages but then it does a little more so we have all of our pages and components inside of this folder here because pages and components in razor or a blazer are the same so I'm going to open the index dot razor file and we'll also open the cup the counter razor files so these are components with page routes so these can act like pages we can call them from route in our browser but they also still maintain the ability to be components so they are both so if I go back to my index page I can reuse my counter component so I can call a counter here and now I have that counter component which also has a page route on my index page as well as it being its own counter component and page so I have that reusability there and the counter component is made up of HTML rays or markup in c-sharp there is no JavaScript here so we don't have to write JavaScript to build a component architecture for blazer and razor components so let's run this application we'll see what it looks like and then we'll do a deep dive again and see what the differences are between what we saw with razor pages and razor views earlier so we've got this nice component architecture I can use my counter on my index page I can also navigate to it as a route so it's acting as both page and component let's go back into our application and one thing I want to point out before I do the deep dive is that our razor application here if we go under pages we have a host CS HTML file so this is a razor page that is using and I'm gonna focus on this line here it's using an HTML helper in a razor page to render a razor component so we've got all three technologies here just mashed up together and we were awaiting at HTML render component async and then we are rendering the the app component which is the container for our blazer application so we're using razor pages and an HTML helper to bootstrap a blazer application how interesting is that let's go to our source code now I'm going to go open a folder view and we're going to go D compile our application again so I'm going to go under the bin folder and inside of the bin folder instead of opening the views folder I'm going to open the actual application folder because the Razr components are not views so they actually get compiled into the main application DLL so we're going to open this up with just decompile we're going to look at the guts of that counter component I'm gonna ignore all the dependencies once again I'm gonna dive into razor components DLL and under pages I have counter we'll open this up and this is completely different from razor views and razor pages so what the main takeaway here is we're actually inheriting from a component based architecture and this counter component becomes a class that uses a method called the build render tree method and this build render tree method actually is responsible for building that Dom abstraction that I talked about earlier so it's not writing directly to a string it's not writing this as HTML anywhere so when you're writing components for the Blaser framework you don't want to go in and do manual Dom manipulation a lot of people when they start using Blaser they ask how do I write raw HTML in Blaser you can but you shouldn't so this is why you shouldn't because you're going to skip past this build render tree method and you're not going to have that efficiency of the system doing updates for you so the build render tree actually adds the content to the this object graph through these methods so we can see add markup open element add content all of those things and it uses us to keep track of that object graph so we don't really need to know how all this works in great detail just remember it's there so you're not writing things in your application to go in and manually manipulate that Dom let's zoom back out here and I am free to take questions and hopefully you guys found that interesting so we got the top level of what all those technologies is and then we dove into the source code and saw what was actually compiled front of all those racers views that's probably something you don't do every day so I I hope that you guys found it interesting all right thanks so much yet I think we have time for one question one question Oh quickly so a question was asked how do you avoid the bad patterns of web forms with razor pages how do you avoid the bad patterns of web that's a kind of a broad question I'm not sure what bad patterns were talking about but I would assume things like viewstate which a viewstate doesn't exist in Blaser the way it does in web forms so there's no viewstate for us to manage what is held in State in the render tree is managed by Blaser so we don't have any control over that so that's not something that we need to worry about web forms has the idea of an abstraction around state that doesn't exist in Blaser we handle state in Blaser through dependency injection and plane class objects just like we would in any other type of net application so that that concern really isn't there's no parallel for it to kind of make a comparison ok so then a quick question if you are familiar with web forms and you want to dive straight into razor pages and Blaser quickly what would your Learning Path be so the learning curve for Blaser in my opinion is pretty small because if you're already a.net developer it's using all DET dotnet technologies so i'd say go to blazer net and click on get started and just follow the first few examples there on building your first blazer application there's a nice to-do list app in there that you can build and the component architecture architecture in blazer is so dead simple that I think people will gravitate to this very quickly alright awesome thank you so much thanks so much thank you guys and enjoy the rest of net comp thank you so much yep now we're gonna get Geoffrey Palermo up talk about Azure DevOps so we'll be moving things around and really quick we were talking about legacy stuff check out this Visual Basic for that's you can get a workout just lifting this this is nothing but books see it's a box we still say in the box in the out of box experience that's right all right shows in the box we will all see you guys shortly

ASP NET Core Health Checks

thank you so I think I'm life yes you hopefully cool so let's start yeah I will talk about the asp.net core health checks today but first I will quickly introduce myself so my name is Sharon Gooch I'm from southern Germany I'm a Microsoft MVP for several years five years I think I'm blogging writing a lot leading it on a user group since years and speaking at several community events and meetups and I also started a stream on Twitch not regularly but from time to time and I'm a software engineer at the U in Basel so I'm working Switzerland living in in southern Germany hopefully the sound is good last turn last year the first 10 minutes were awful it's it's going well this time so I have a quick agenda oh I need to quickly close not close minimize Skype window as well I see two versions of the agenda currently so yeah I will quickly quickly introduce asp.net core health checks and then I will show a basic implementation of the health checks and there are also a lot of checks in the community so we'll have a quick look there and how to visualize the health of subsystems of an application and if it's some time left I will show you quickly on an enhanced scenario so I built something with docker containers to show how this could look like so all the sources I will show today are will be available on github so the repo already exists but I will push it afterwards so what's next exactly about the health checks what are the health checks so that health checks are kind of a framework inside of the ASP and framework to check the health of application subsystems maybe databases or services which are not inside the application or you can also check your your system you can check memory you can check your space of your hard drive whatever you want to check you can also handle the health of your subsystems we get a feedback and the checks give you the state of your subsystems and you can handle them we can show the states in your weekly application and you can provide an endpoint to show the information about the health of your current application and of the subsystems of the current application so the namespace is Microsoft add extensions that diagnostic start health checks you'll find all the stuff here and yeah a little bit of history so I'm was pretty much involved into health checks so the development started at 2016 I think I'm not sure when exactly but during the MVP summit in 2016 LAN Condren asked via Twitter if there's anyone who want to attend the asp.net hackathon and help him through write checks for the asp.net health checks the first version I think it was a draft at that time so Damien said yes I said yes and we met Glenn Conner in an Andhra nurse at the asp.net hackathon and started hacking some checks then it moved through some repositories until it makes it into the product so it is in the product still in speed on that code 2.2 I think what can you do with health checks you know maybe mention it it is monitoring the health of parts of your application or yours or subsystems of application imagine it databases some Web API is G RPC service is any other services or the environment of application you can check memory performance drive space and so on and you can provide the health state of your application including the health of the subsystems you want to check so you get an endpoint that that tells you about the health of the whole system the entire system I think yeah that's almost about the theory why should you use the health checks yeah you can handle unhealthy states in the application you can maybe provide information to the users that some of the subsystems or databases aren't available currently you can keep you a partially running in case of an unhealthy state of an subsystem maybe there's yeah a specific database not running and you can keep your application partially running without this database for example or you can tell the users about the unhealthy state and so on I can switch to alternative subsystems in case of an unhealthy state of this specific system subsystem maybe you have a different one and what I didn't mention here in the slide is you can provide a an end point I think it's the exactly same endpoint to the what is called Essure a load balancer thing as I can connect your Asia environment to this end point and the load billets I can is able to to switch the applications or they the switch between the instances of your application okay let's share some code and this section I will demo you a simple implementation of health checks so this is the kind of agenda of this section just created a spill don't care a SP donate core MVC application using the.net CLI I already did this then we will configure some basic simple health checks without any logic in it we will implement a custom health check and we will use the health health check service to to curl the checks and to to visualize the states of the subsystems this is the basic configuration of the startup of your SP donut corportation you can add the health checks services and the configure service method and you need to provide the the endpoint I mentioned this is the endpoint which provides the state of your application including the subsystems so we say abuse health checks is the mom exactly I will switch to the console hopefully the font size is okay we can increase it a little bit and I'll open yes code and go to the startup and this is common asp.net MVC application already added the health checks here I'll check your services and I added the endpoint this is a little different than in the slides because in asp.net core 3.0 we have the new endpoint routing and the middleware which provides routes are now registered here with map something map controller route or map health checks this is the endpoint I mentioned so this is the basic configuration just to add health checks or just to have the possibility to bad health checks so now I want to add a few health checks so this is a way to add the liquid based Orlando based health check pretty simple this doesn't add us nothing here it just outputs unhealthy state so we can say add check yeah I'm sum over I to you you can do it the delegate way or we can add an health check instance we don't see this later we can do it the generic way to add an health health check type here Oh as well with thee with a funk we get a health check result so we return the result that's that so that's one I can also return an unhealthy States or some options some things to return we can return healthy unhealthy or something but in between degrade it so we leave this and I have another quick sample which is more useful I think it is a check to ping a subsystem okay this one starts a ping oops wrong keys here I did you know that you can press windows start to add emojis here yeah what works okay we create a new ping I said send the ping to localhost because it's currently it's hard to find a service on Azure or somewhere which responds to a ping I think all the edges services don't respond so I can't ping dead confident nets are also kind of ping my own block and so on so I need to find find a host to ping so if it's not a success state then I will return unhealthy if this needs more than 100 milliseconds I think yes then it's degraded it's pretty slow then and if it's all fine I will return and healthy state so in case of errors I will also return an unhealthy state I think that's with the delegate a checks but we can also create more your more complex checks using classes so it's this one you can create an eye health check so I need to find the interface it's not implemented correctly so I need to get this one the cancellation token and now it's implemented so it's almost similar to their to the lambda expressions here so I in this so we will return a health check result and get a context and we get a cancellation token so this is more complex way we can check the state of something so this is just an example I set it to true so it's healthy and if it's if the subsystem is healthy or we return our healthy state and otherwise unhealthy state so here this line you can put your checks whatever you want to check I will show you a more useful sample later okay so we need to add this you say add check I'll use that generic way it's so I don't need to add a name next ups let's get be null I think and here we need to add some tax a different keyboard layout here so now it's working so I'm switching between German and US American layout okay so this should work but I this should work if I call the endpoint let's try it I press ofin the five also the language is switching between German and English I'll place only if something bad with the with a stream font size audio and so on okay if this should work buzzer OH open up in the wrong window so yeah yes so it's running if I press f5 um I see something's going on here and the end and wash think it's unhealthy yep it's unhealthy the complete application is unhealthy because of this here if I switch this to the healthy state I've said it okay I'm to restart it it will be healthy so this is the endpoint okay you can't extend the endpoint a little bit so I need to find the snippet for this yep there's some options we need to set and configure and we can have this lines here say predicated true say response writer s d-u-i response writer to find the using so this isn't there okay let's check the namespace check options response my turn okay let's remove this I was sure in the next day more than okay that's about the one endpoint but what about visualizing so to visualize the the health of the epic of your application now I can use their health check service and you can call all the checks on demand and display reserve and the results in your view so to do this I'll go to the home controller and inject the health check service so like this this is already in the DI container so I can use it wherever we want and I'm going to add a new view so I also need to add the views here so just copy the privacy and call it health and put some code in it so okay so we use the diagnostic self checks here our model is the health report and then we write out the the status of the models of the model is the health report we return this from the control action we can display the duration of all the checks and we can iterate through the checks and display the state of all the checks we have okay let's change this back to unhealthy turn a better message and restarted so paid there so we haven't created a link for the health I will do it so I think I did something wrong at the end point end point and if you do have the same URL so I will rename this end point no I'm wrong I did it wrong so I shouldn't have changed the the end point here it should be under home health exactly so that's it so the state is unhealthy yeah needed five milliseconds seconds or milliseconds than that so the foo is healthy the bar is not healthy healthy and we have the ping here you should have set the name and we have the simple health check so the ping is healthy don't we have a name here tag [Music] should be pink they don't see it yet I don't know why anyway so it's working we have the the health state of our sub substance here and we can also add an indicator to the page to see if the entire application is healthy or not so to do this open the layout see is HTML pennants injection here so you can do a dependency injection in your view I inject the health check service and I use it in our code block let's put it here so we await that check health async armed with this we get the health health state so I think this is a health state response our health result so as you can see it here this is a health report okay that we have the same in the layout and we can check the states here so as SATA background come current in case the state is unhealthy degraded or I don't set it in case it's all healthy so and I'm able to set it here and let's see what happens I need to repeal it I think yep so let's close this one now the head is red and unhealthy and if you changed this and let's say this is decorate it to rebuild it again it should be orange them or whatever set here orange yes so under and healthy state doesn't have a background color so it's it's white okay do we have any questions until yet if not that will continue with the slides out there and let's have a quick look into what the community did so what was expected after I had another look into the health checks health checks um a post playing around with the health checks for a year or so uh didn't had a look until this time this period and after had another look expected some health checks created by Microsoft but there are almost no health checks the reason is that it's pretty simple to implement some and the other reason is that the community already created a lot of health checks so if you see this slide yeah if you entered interested go to this repository that's better it's a burial I'll pronounce it right he created the asp.net core diagnostic health checks package or packages on the right side let me see a list of nougat packages available so you can check the system cat Network sequel server MongoDB and so on ready event store secret light a lot of other stuff also um Amazon Web Services can't be checked and fire a signal or and so on Kuban eighties and I think the list will increase a lot so this project is port from beat pulse and it also provides UI features so well show you in there more enhanced steam off so please have a look also you some of these packages to check sequel server or or Seco light and so on um also try to check circulate I think this doesn't work currently I need to check it again maybe I did something wrong and if not I will a pricing issue you also it wasn't possible to connect to and secure light database you know inside the docker container that's didn't work okay so about the health check your ISO also ends of this project they created a pretty nice health check UI so you can add it with with this service registration and with these middlewares here and this also provides another endpoint which is specific for this UI and it also provides health checks UI endpoint with them with a nice HTML UI so let's have a look what I did for this demonstration I created something like dummy weather statistics application downloaded a lot of weather data from Washington State I have implemented four different with the station spree mutton Cedar Lake and Monroe and a health monitoring app and what's missing currently so where the data visualization app but this is not important here and it's all running on docker I'll close this one here and go to the console this one oops openly is coached there so these are six applications this one doesn't count it's not implemented yet at at a common library to share classes also shared the the dbcontext this is this is the health monitoring app and we have the four different weather stations here I'll go through the f qor to connect to the secret light database so this is all wired together with docker compose this is the visualization of the health health visualization export some ports it depends on the day and therefore stations and also need to link the docker containers together it was talking it working stuff here and I created four different docker files per container one to run so so let's quickly look here this is the configure services of the of the check visualization app so I created the dummy foo health check just to check whether it's working or not and edit a database context check I think this is the only health check provided by Microsoft the only finished health check then added a check for URI so this is called your group it's in the URI package you can set your I want to check give a name like with the other ones you need to tack this or it make sense to tag this let me to filter it later on so I created for ping checks and for data checks there's this one for checks only check whether the services are available or not and the other one are really loading data and check whether there's a result or not so I also added the health checks UI and also set it to the to the after the apps here so this is the health checks this is what I wanted to show in the previous demo you need to define a different response writer and with this you can enhance your own endpoint to add some more information I will show it quickly and I need to add the hell check CIA middleware so I don't want to start it here with Mia's code I used the console one and run docker come powers up it's all compiled and it only needs to start so all the services are available so we see the name docker container here tennis here this one is the monitoring app and the other ones are the stations so it's called 5,000 that's not HTTP and it's running this one is just a single Web API application and this is our endpoint we extend it so now we get a JSON result we get this state here it's not a longer a simple text and we get a lot of more informations so the duration we get all the entries these are all the checks we have they have the checks I also provide it's an endpoint this is almost the same but needed for the for the UI so and this is the after checks UI provided by these guys by the community so and here we see all they all the services that are running so these are running in the docker container this is in the alternate docker container but in the end the visualization yep and this is our dummy justice to check so what happens if we kill one of these ok a little bit so here are the containers running so looks a little bit bad I will resize it all the way around so like this ok I want to kill one of them let's say the weather station in canvas well don't have container killer okay some it was the idea it's just darker kill it's it's not docker container kill really try to lift up your containers there you go yeah no it's killed thank you almost almost done let's just this last demo okay you can see now there that station in Kent was offline its offline and you see the checks are unhealthy no okay so that's pretty much it um I say thank you and hopefully you enjoyed it I thought I really liked seeing the level of community interaction here with the health checks you're right they're so simple to write and already so many of these that really help with those other integrations and services that we want to know the health of mm-hmm yeah absolutely there's a lot of implementation see a lot of documentation and from the community yep the user interface right we saw the same thing with the folks who do swagger stuff to have health checks you want yes it's something every user administrator is going to need yeah absolutely yeah I didn't know that I'm I definitely need to make sure I had that to my applications going forward thanks to thanks for hosting thanks for having me for champagne

ASOS - Discover Fashion Online (Customer Video Connect(); 2018)

Isis wants to be the number one fashion destination for 20-somethings around the world but we don't have shops people know about a sauce from the internet we have one minute where that digital platform is out we're not serving our customers because a sauce offers such a wide variety of products eighty-seven thousand at any one time with five thousand new ones added each week we've invested heavily in their recommendations platform we need to help our 18 million active customers discover the things they love we really like cosmos DB as a fully managed database service cosmos DB is used as model store the gateway from the offline to the online data science world's allows us to distribute the data models to be near the services wherever in the world they're deployed we like the immediate elasticity so we can store data models of any size we like the very low latency for random reads during peak sales periods we need extra compute power to cope with customer demands and manage our large data sets on Black Friday 2017 a sauce services backed by sequel Azure and a zero cosmos DB processed 750,000 orders the product API served more than a billion requests at a Black Friday through Cyber Monday bursting up to five and a half thousand requests a second with an average response time thirty nine milliseconds we had literally no problem throughout the entire weekend Azure has delivered as a rock-solid platform to create a and ever more compelling consumer experience [Music]

Ask A Special Olympics Athlete

- Special Olympics USA Games and Microsoft teamed up with KUOW to host Ask A Special Olympics Athlete, a person-to-person conversation bringing together members of the Puget Sound community with Special Olympics athletes. (people murmuring) - [Ben] You're Devon? - Yes. - I'm Ben. - Nice to meet you. - So what do you think people should know about the Special Olympics? - Put it this way, just 'cause we have a disability doesn't mean we can't compete like everyone else. - Come to a competition and watch. See for yourself what people can do. - And I get excited when they cheer me on. - It's changed my life for the better, and I am so thankful that I'm a part of it. - [Woman] What was your life like before? - It's always been a little uncertain, trying to navigate the waters of life, and so now with it I have much more confidence, and I've been able to branch out and just really be able to show what I offer, not just from sports but from life. - My coach gave my mom a phone call that by the way, Rebekah was chosen for nationals. - Yeah! - Like yeah! Yes! I like it when people actually take time to listen to me, you know? - What do you want people to learn from having USA Games in Seattle? - Acceptance and also that Special Olympics is for all sorts of people with all sorts of disabilities, and all sorts of abilities too. It's not just one thing. - I feel like I'm part of a team, and that they see me for who I am and not my disability. Growing up, I felt like an outsider, and that no one wanted to sit by me 'cause I have Down syndrome. But I kept all those negative vibes and put it into this big motivation for myself, so I can keep moving forward and to change their view of what I was. And then all of a sudden, Special Olympics came in, and that gave me a real boost of confidence within myself, and it became a family of friends, which I needed, and that truly just changed my whole entire life. - Look at us and what we can do, not by what we can't do. Don't just jump to assumptions or conclusions just because somebody has autism or Down syndrome or whatever. - [Photographer] Awesome, thank you all. (crew claps) - [Rebekah] Look at what they can do if you give 'em a chance. - [Narrator] Come and cheer on the athletes July first through the sixth as they compete in the Special Olympics USA Games. To find out more, go to www.specialolympicsusagames.org.

Artificial Intelligence for every developer

how's it going my friends I am so excited to be back here is this on am I good ok they're giving me thumbs up I'm excited to be here how you doing my friend I'm doing great how are you why don't you introduce yourself my name is Eric Boyd I lead the AI platform team of Microsoft so the first question obviously in the most important that everyone has for you is are the robots taking over and how can we become their friends the robots are totally taking ok ok no I mean that question is such a great one to get I've gotten variants of that and I hear some of these variants by the way please get your questions in because I'm sure I've gotten some really weird questions about AI you know I was at an onyx conference and onyx is the open neural network exchange it's something we work together with Facebook on and Amazon and NVIDIA and invited the whole ecosystem in as a way to exchange you know models from one format to another but in a space it's a file format yeah and after sort of talking about onyx I got a question that was well have you ever had an onyx model you know like become self-aware and I'm just like it's a phone format that's really not how this stuff works so it was yeah there's a lot of misunderstandings around what AI is how it works and you know what people can do with it and so that's a lot of what we need to work through is hey I can do some really incredible things particularly in the areas of vision and speech and those types of areas but you know it's not sentient it's not self learning like if you have an AI model that plays chess really well it's not gonna clean your floors no I've tried and it made a mess and my wife got mad yeah that it made a mess I bet it didn't do it did do anything so here's here's a question for those that are out there they're like because there's a lot of AI they say/i that all over the place for businesses out there that are like ok I I think I need to take advantage of this where are some good opportunities to start yeah that's a great question I spend a lot of time talking to companies about what are their opportunities and what are the things they can do you know the the great thing about AI is it really is touching and transforming each and every part of every business and so even like the feature that we showed today some of the key notes the Intel Akkad if you think about that that's such a small feature in Visual Studio right just reordering the way that the intellisense or options come back but they were able to make that better and and you know by using AI and having a predictive model that knows what am i likely to be using it for they really made Visual Studio better how much better a half percent better but if you can do a half percent across all the different capabilities you can make so much better and so you know I was talking to one company it was a you know a beer manufacturer and I said well how are you using AI and beer manufacturing and his answer was we don't use it at all in the beer manufacturing we use it in everything else in logistics in the supply chain and predicting the inventory that we're gonna need and pre and forecasting the prices we're gonna pay all the other capabilities that they had they were using AI models and those areas of their business and so really it's it's that's what's so interesting to me is just finding each business and how its gonna transform each of their businesses and really challenging companies you need to have the creativity to figure out how are you going to actually make your business better where can a I really work for you and really learning those different areas so what is it good smell humor code smells I don't know where that term came out it was such a weirdo know that term it all his code smells like you're looking at code and you're like this smells like something we could fix it or make it better where are the AI smells so to speak in a business that you're like hey you know maybe you should consider using this program because I consider AI a programming technique that's right you know what our good clinic cases for it if you have something where you know you are you're applying some rules like the sorting algorithm and Intelli code right someone came up with a rule that said let's sort it alphabetically you can almost always find an AI algorithm that's going to predict or do that better fraud detection is a classic place where people have rules if we're get too many requests from this IP address is probably fraud AI is going to do fraud production prediction way better if there are you know financial forecasts I'm gonna look at these three things about you know the the industry or the trends and sort of project what our finances are gonna look like a is gonna do that better insurance industry is getting completely redone if you think about how insurance works today they look at five different factors about your driving history or your car you have or maybe your neighborhood and a I can consider ten thousand factors effectively okay and so those are things where a is gonna do a much better job of predicting and so yeah those are all things that smell like a I would do well in it so tell me about the requirement the data requirement for a I like cuz a lot look I've had people come up to me be like hey just do some AI and I'm just like well can you give me some data why is data such an important element of AI yeah one of the first things I talked to companies about when I meet with them is if you don't have differentiated data you don't have differentiated AI so what is the thing that you have that's special and unique about your business that's gonna make your business and your product better and so you know if a company is not collecting that today and a lot of companies I've talked to companies and they're like oh we throw all that data away and you're like that's gonna be the foundation that you're gonna build your models and make things successful from but you've got to understand what is that differentiation what is the thing that you've got that's unique about your business that you can build a great date asset on and then build models on top of that so before you even start thinking about AI you should probably think about saving your data just making sure that and saving collecting and really looking for places where you have data where you can tell this was a good outcome or this is a bad outcome right if you take insurance this person default on a loan this person didn't default on a loan so I can I use that to predict forecasting financials I knew why I predicted very accurately based on this information I predicted poorly here the more you have those those are the labels that's the stuff that's gonna feed into your model and it's really gonna you know be the way that your AI algorithm is gonna learn and so if you have that then you've got the foundation to do something interesting awesome so you're using the term a lot model yeah and for those that are maybe don't know what a model is how would you describe what is a model yeah a model is it's really just a system of predicting what's gonna happen based on some inputs and so I mean you can think of a really simple model you can think of Scott today Scott Guthrie was talking about I want to predict the price of a car and so a model could be as simple as you know I take the year that the car was and I take the condition of the car and I multiply it by three and that's the price of the car that would be a particularly bad model an AI model is now going to take those same inputs and come up with a price based on you know how a I sort of learned and so there are a lot of different ways you can represent models and think about them but at base that's what a model is it's something that predicts something awesome so we want all of your questions so make sure you get them in and I want to ask them for those that maybe don't have a lot of data and they want to do AI how can Microsoft help so there are a lot of ways that companies can get started there are a lot of use case that depends on what people are trying to do if you look at their speech you know if I want to add speech recognition to any application that I've got how could I do it well I could go and collect a whole bunch of speech people talking and transcribe that and then build a model that predicts that or I could use a card in my service which is gonna do it way better than what they're already doing so we have a wide suite of cognitive services that'll just really help accelerate people you don't need anything to go and use a cognitive service and you can do speech you can do vision you can do language you can do search all of these you know right off the bat you can go and get started with them yeah and it's really easy I have it here on my screen you go to a sure calm front slash cognitive I think it'll go right to it and like an easy one to look at is his vision basically I'm clicking it right here and if you go to for example seen an activity recognition and images you basically just upload your picture yeah it's really simple if you have you know you want to be able to identify the objects in a particular scene just upload it and it'll sort of show you the different things on it then you can go further with that the custom vision service and you can say everyone's favorite example if you watch the TV show Silicon Valley not yet but I will hot dog or no hot dog hot dog no hot dog this is a classic app really funny part of the the movie or the TV show you can build that in about I built it in two hours but that's because I'm not a great programmer anymore I usually happened I got old yeah I stopped programming as the main you know two hours though to build a hot dog non Hunter and it was really very good I did you use cognitive services what I did is I use the custom vision model okay and so I went to Bing and I searched for pictures of hot dogs and I found about 20 of them and I put them in there and I four pictures of things that weren't hot dogs nice and there's your classifier and it really was very straightforward to go and build awesome so here's some questions coming in does Microsoft AI support self training classifiers so I think we do with Auto machine learning so automatic machine learning will do that automatic machine learning is yeah so I guess it depends a little bit what they mean by self training classifier automatic machine learning is gonna do a lot of that what automatic machine learning does is you basically would specify here's the data set that I have and I don't know do I need a support vector machine do I need a neural network to a needle gistic regression I'm not an AI expert please just figure out the right model for me and so automatic machine learning is gonna do that for you and so that's available today you can get that as part of Azure machine learning in the SDK it's one line of code and it'll go and build you a model just based off a data set I have the line of code actually right I'm scrolling it here it is it's it's literally oh no that's the deployment sorry that's this here it is it's the auto machine learning yeah it's actually two lines but because one you define the problem and to run it it's actually one line right actually really nice it's really straightforward really simple to use and we're finding a ton of customers who are using this and it really broadens the scope they're really two ways I see people using it one is you know if you're a data scientist there's a lot of tedium that you go through in trying let's try the support vector machine let's try a learning rate of 0.1 and trying to change all these parameters now you can just sort of say just give me a model that's pretty good you know an automatic machine learning will just go and do that the other class of users are people who don't even know what they would need to do and they can you know if I'm a developer but I don't know how to do machine learning I can use automatic machine learning and get a model just from two lines of code so let's see if I understand so basically you have a bunch yeah III obviously usually I think of Excel because it's the canonical I say Excel and everyone's like oh I just pictured a row like a bunch of square of data and you say here are the columns I want to use to learn and then here's the column I want to learn you feed it in and then it does it and it's funny you say excel because in power bi in and we announce this as in preview that it'll be integrated as a wizard where you can walk through the experience doing exactly that and so create a model just from saying this is the column I want to predict and here's the rest of the data that I've got and that's pretty amazing I mean if you look at the code right here hopefully you can go to the screen you can see that there is this data script that's basically says get data and in there you define and you can see my get data script right over let me go here real quick get data script right here it's basically saying here's the X and here's the Y you want to learn you give it that and then it says I'm gonna run a bunch of model that's right it goes through it tries all the different models it's really great it's a it's a little meta it is a machine learn model that predicts which machine learned model is gonna work best on this set of data and the more you use it the more you use it on your sets of data it actually learns right from the history of how it's gone and predicted and it gets better because it has a great answer of like well how well did it predict against the test set and so the more you use automatic machine learning the better it's gonna work for your data the better is gonna work for you which is really pretty neat and the cool thing about this and this and this is the meta bit like it's using a recommendation algorithm so basically like your shopping cart when you go shopping online and it recommends other products we have that AI when you run a model and it says oh it did okay it starts to recommend others and it runs them it's pretty cool it's exactly it's the same idea so the exact same implementation was the same ideas that yeah really cool really simple to use and I think honestly going forward I think more and more stuff is gonna start fitting into that automatic machine learning paradigm I think you're gonna start seeing image classifiers work that way you know I all the types of things that you're doing today more and more of it's gonna fit into automatic machine learning and that's that's really our goal is how do we simplify this stuff because there's so many people now who the demand to have a machine learn model the number of people who wanted the demand freya is really high but there aren't enough people who can go and develop it and so how do we make it simple so that any developer can go and build and have an AI model you have developers today if you think about I use the analogy of a hash table developers use hash tables without even thinking about right they probably learned about it in college and they studied what's a good hash function and things like that no one's ever actually implemented that they just use a map and they just call it right how do we get that you know machine learning from the days where it is today we kind of need to be an expert in linear algebra and calculus and you know back propagation to know this is a space here's my data push a button and go do it it's coming and we're gonna get there but you know what it's still okay to learn linear algebra or calculus because it is dear to my heart because I'm a nerd I'm not wearing my glasses but if I was you would see love calculator oh and and this is what you're seeing a lot of people doing everyone who's a developer out there today is learning more and more about how to be a data scientist and it much like the hash table understanding the fundamentals is really going to be important to doing it effectively awesome so it looks like Tony from Brazil is watching we want to say hello to you my friend I have an idea in mind to build a face recognition for my business customer comes profile loads for receptionist can azure help me with this that's a great question so we have the Congress service the face recognition API and so you can absolutely go and do that and have it recognize your customers and and suggest a profile of it I think it's you know it's really great idea right a customer walks in and you say oh they typically order you know this particular type of cup of coffee or something you can start getting it ready as soon as they walk in and so for your regulars what a great experience right I'm coming back to that restaurant every time because they're gonna be ready that much faster they see me coming and that's amazing like just with computer vision it will tell you the box around the face right and then you can use in China together with with custom vision with faces of your customers and so you get the face box you take the box out and you give it to custom vision and now it'll tell you that's right you can build up the profile in the history over time and so I think it's a really interesting use for how face recognition they're actually already are coffee shops and China that do this really so absolutely you you walk in and they they recognize you and they get your drink already so I think this is gonna be coming more and more awesome so follow-on question but do you have an auto classifier where the data does not have predefined data so the auto classifier would group similar things I mean that's a really good question I'd like look I'm an engineer and most people don't know this but I'm like an AI person yes so like right away when you say group things I'm thinking like k-means or hierarchical clustering or Gaussian mixture models so there's already ways to do that yeah but we have the compute to do any type of machine learning I'll tell us a little bit about Auto a machine Azure machine learning service and what that is sure so you know you talk about you need access to the compute to go and train your different models that's one of the you know why is AI really taken off it's been three factors first is the amount of data that's available the advent of big data and product you know products like spark and an azure data bricks and now you can use those to really manage your large data sets the second you alluded to is compute and it comes in in two different ways one is it comes through GPUs which have really accelerated the amount of parallel computation you can do and things particularly matrix multiplication as well as the cloud where these GPUs are really expensive and if I need twenty or a hundred of them I don't wanna have to go buy them because I probably only need them for a few hours and so the cloud ability to go and use all that compute you know for the time that I need and only pay for what I use has really transformed it and then the third thing is the new algorithms coming up with you know deep learning and convolutional nets and things like that has opened up a whole host of applications and so with Azure machine learning what we're trying to do is bring that together and make it really easy for you to consume and so you know we do it through a Python SDK so you can be in an azure notebook or a jupiter notebook or in vs code or in pycharm or whatever you like to use you're right there in your notebook and you can get access to start training locally change one line of code you know now i'm accessing a whole host of resources on the cloud and you know managing the data that's stored in anyway you can store it on Azure data at everything from Azure data Lake to you know cloud DB everything is all out there cosmos DB awesome so yeah it's all really simple and integrated so we started with if you want to just get started quickly you should use cognitive services yeah if you want to customize a little bit we have some custom versions of cognitive services we mentioned custom vision there's also others you can I think you can upload your own acoustic and language models for speeds that's right you can use Lewis to start to tag your own data and get so there's ways easy ways to enter but let's talk now to those that maybe are more advanced that are starting to use like scikit-learn or pi torch or tensorflow can you tell us what the current development process is like and how Azure machine learning trimmers can help sure you it's interesting the progression you walked with we think about it as cognitive services are you know Microsoft's model Microsoft's data the custom services are Microsoft's model with the customers data and then when I want to get to a custom model well then it's the customers model and the customers data and so you know how do you do that if I'm building a model you know frequently what I'll do is I will come up with the set of data that I have that I think has the best features in it and I'll come up with the algorithm that I think I'm going to use and I'm gonna Rigaud and train it and then we call that an experiment and I go and run and I compare that experiment against the the history that I've got the test data that I've got and I see how well I performed and what you find people doing is this iterative loop over and over where they keep changing maybe I need some more features or made this feature is gonna make it predict you know in my car example maybe the year is not very interesting but the location the zip code is or something like that what features can I add in and so as your machine learning will keep track of all the experiments that you've run so that you can see which one actually perform the best without and you know basically keeps the history of what did you do different each time that you had it and then when I have a model and I'm ready to sort of deploy it then the you know Azure machine learning will put it in the model registry and so now I can keep track of all the models that I've got and as I deploy them I can understand where each model is and its life cycle is it deployed in which different systems and so it can manage that deployment and management of them much much simpler there a couple of other capabilities that I think are pretty interesting I talked about sort of the the the lifecycle of I'm going through all these different experiments a lot of times what I want to do is what's called hyper parameter tuning right each of these models there are probably a dozen different parameters the learning rate the number of nodes in each level all sorts of different things and so hyper parameter tuning is a way of helping you select the best ones without having to sort of painstakingly iterate through them all yourself and so you put all that together and it dramatically simplifies the machine learning developer the data scientists in getting their models develop they're become much more productive we talked to people who you know have spent weeks training a model and rather like we can get this done in a day I can do this much much faster and the important thing to note is that like look generally when I'm running these things I usually run it on my machine and then my machine is tied up and then I try to get someone else and I'm using PI torch 0.4 0.1 9 7 & 8 you know and Sally's using PI torch 1 preview because she's all way more advanced than I am and it's hard to get all these things to match up how does a skirmish e-learning help people that work in teams and data science teams what is it about Azure machine learning that will help people work together yeah I mean there are a couple things you can look at you know one is you mentioned like my machines all tied up that's the beauty of the cloud right is I can now use extra computation on the cloud I can put it in a data science VM I can put it on the training modules a whole host of GPUs and have sort of complete access to my machine the other is really the reproducibility I can take sort of each model and I can sort of run it the exact same way that you ran it and so yeah you mentioned the different versions and all the different things that I'd need to do you know makes it much easier to sort of say hey we're all sort of working on the same thing and share the code and and really stay aligned with it and that's something that we've learned internally you know we have on our internal services thousands of developers working on the same model and Bing and how do you do that effectively how do you have a thousand people try and make improvements to the single model you have to have all this infrastructure and so as we've learned from Bing all that infrastructure that we built is through our machine learning and that's what we're deploying in as machine learning all the things we've learned in making that product much better awesome well keep your questions coming obviously any AI questions that you might have we want to get those in so there was announcements regarding AI today can you tell us about those sure it's a couple announcements that we made first and foremost our machine learning is generally available I'm really excited about this we've had a whole bunch of customers try it and preview and their feedback has been really really great they think the direction that we're going with it has been fantastic we feel like the quality of the service the quality of our documentation understanding is all great and so we're happy to announce that it's generally available product and you know with that all the things that come with that automated automatic machine learning which we've talked about is generally available the hyper parameter tuning the experimentation capabilities the model management the ability to deploy all of that service generally available and something that people can go and take and use which is really exciting another thing that we announced today is the onyx runtime so I talked a little bit about onyx at the start onyx is this file format for exchanging models and you know for really making it simpler for hardware manufacturers to to optimize them one of the challenges that hardware manufacturers talk us or talk to us about is they say look I've got tensorflow I've got PI torch I've got chain ER I've got paddle paddle I've got cafe I've got all these different frameworks and people expect me to optimize each and every one of them how do I do that simply and onyx says hey you can just sort of make this in onyx model they can all convert into onyx and now you can optimize one of them what the onyx runtime is is this is the same runtime we've been using in Windows and Windows machine learning it's now available open source it runs on Linux it will run on Windows and it runs dramatically faster than sort of the native implementations and so we've seen internally you know virtually every model has run faster some have the average is probably around 2% two times faster but some have been as many as like seven or eight times faster and so this is available it's open sourced and people can go and get it I'm really excited about that as well another thing that we announce that there's sort of major areas around cognitive services we are the only company that does containerize Congress surprises people want to be able to run AI models and they don't want to just consume it in the cloud sometimes they have latency requirements or they have intermittent connectivity for some machine that they're trying to run it in and so they want to be able to take the model and run it on Prem or on the edge right and so we announced containerized models and today we announced that the language understanding model is also available in a container amazing Lewis Lewis Lewis is now available in containers so that's amazing I was recently like I was recently in in New Zealand and one of the hospitals there they wanted to use cognitive services to do OCR yeah but they couldn't do it because they could not but the records could not be upload to the cloud this really enables them to start to do that work that's exactly one of the use cases we see is you know regulations prevent them from moving the data and so being able to bring me the cognitive service directly to where they actually have the data opens up all kinds of doors that previously they couldn't do before and so we have had a ton of positive feedback from customers on it people are really excited about this so I'm excited to see that going out it's basically the first ever lift and shift down that I've ever seen yeah it's interesting all the you know everyone is trying to lift and shift up to the cloud and and look that's an important trend because the cloud offers a lot of advantages but as a company we've been very committed to the hybrid and making sure we work with people where they need to be and often that means hey some of the things we've done in the cloud need to happen on the edge there are real legitimate requirements a little why that needs to be done and so we want to make sure that that's support like just basically and here's a really silly use case that I thought of if you run a parking lot and you want to have an unattended parking lot and still charged people you can have a local model taking picture as cars drive in with OCR getting license plates that's right all sorts of examples like that where you know we hear of manufacture of companies that have manufacturing plants that you know their connectivity comes and goes right they have vehicles that they want to drive out into the field that they might not have any connectivity at all and so to be able to still run models locally these did a lot of great examples with drones they want to fly drones along power lines and sort of see hey are there defects and the power lines and things like that things they need to go repair you could have someone drive for thousands of miles you could fly a drone and have it take pictures say this is where you need to go to that's awesome and so yeah it works great so here's a couple questions well ml dotnet expand to training framework so I don't have to learn Python numpy tensorflow PI torch and I can rather stay in c-sharp or I feel at home so I'm all that nut has a whole host of algorithms where you can it you can train models directly in c-sharp in ml dotnet and well that net again grew out of internal technology that we had were a bunch of internal developers use C sharp and wanted to have a good framework for developing their models in c-sharp and so we've wrapped it up and made it ml dot and that is something that now you can go in and train models in c-sharp you know we have a ton of developers in c-sharp that are really not well served by the ml community because the ml community says everything has to be in Python and so being able to have ml net as a way that you can now stay in c-sharp is really pretty interesting for people and you know there's still a ton of activity happening on Python so I wouldn't necessarily discourage you from learning Python because that's where there's a lot of value being created but absolutely I'm Ella and that's gonna let you stay in c-sharp awesome next question ai is more than just image recognition what about searching for text and dynamic images kernels your engine is not accurate and cost per transaction forces us to use on-premise solution interesting so I'm not really sure what they mean about not dangerous or dynamic images yeah I mean maybe in videos or something I mean so the the OCR solution that we have I get benchmarks on all of our under services on a weekly basis we're beating everybody else with OCR so I believe we have the best OCR solution that's out there it really performs quite well and you know we have I talked to our researchers they are very proud of the techniques that they've used some of those some of the tricks that they've done in their models to make it really perform so well you know additionally with images you need to sort of talk about finding different things within the image I mean I love the example today that you had the NBA example showing really the face detection working on all sorts of small areas there's also logo detection right and being able to find the logos and all sorts of different places in it and one of the places where we really pull all this together is a knowledge mining right so you take exactly what you were doing and now you've got your extracting all this information from across an image and some of it is OCR some of it is looking for text in an image some of it is face recognition on the image some of it is sentiment analysis on the image or on the text or whatever it is I'm building an index that's now searchable and brings all the you know the named entities you can sort of think of whether they're people or places and what's the relationships between them you can bring all that together and so knowledge mining makes that really powerful now and I will say for for you that that submitted this question like if it's not working for you can you email me and I'll look at it because I've seen our OCR engine get like words behind chain-link fences that say stop that are crooked and give you the right bounding box it's ridiculous I've even seen it there's you love the blacked-out text where they used a magic marker and you can still kind of see the text interact of it and our OCR is telling you what the text is underneath of it which is really very cool it's amazing okay so tell us a little bit about some of the exciting things that you see some of the customers doing because one of the problems with this technology is people have a hard time like saying they once they get it they're like oh okay I can see how this works yeah but they have a hard time seeing where it might fit in there in their business what are some exciting things you're seeing customers you know there's been a lot of interesting examples you know one of the things I may be more fun ones is you know we've talked to shell and so shell has gas stations of course all around the world and so they put cameras in there gas stations and what they really want to detect is fire which is a big problem at a gas station but what they also are detecting are is the person who's filling up with gas is he's smoking and if they are they want to alert the attendant say hey go yell at that person it's really dangerous to smoke at a gas station and so lots of applications like that we see a ton of image classification applications companies you know Jabil is looking they manufacture chip boards and so the last step they wanted to sort of take an image of it and see did we miss any of the solder is in it is there anything any defects we can see with this and so just improving the quality that they have there we see a ton of Bott solutions people are looking for BOTS you know often in customer support can I deflect you know twenty percent of my customer support costs and save myself twenty million dollars while giving my customers a better experience we see virtual assistants where people want you know their branded experience their voice you know sort of interacting with a customer in a virtual assistant way so we see a lot of solutions there so yeah just a ton of applications across the board awesome so we have a question coming in how could I use AI to help with accounting such as invoice coding so I'm not an accountant and I'm not entirely sure what invoice coding is but I'll guess um you know presumably it sounds like a classification problem right I have an invoice come in and I need to decide which budget do I charge it to or which type of invoice it should be or anything like that there are a number of different ways you can do it depending on sort of higher invoice comes and one is you can do image classification if you have an invoice that sort of looks like image one or an image and something else that looks different you can do it that way the other is to build sort of text classification and sort of understand what type of system this is but that's the standard classification problem and that's the exact example of what I'm talking about of each business and each industry needs to find the ways that things are changing for them and how they can really use it to make their business better where you know if you can speed up your your classification on your accounting invoices and have better accuracy with that you just get so much acceleration from that as a business and so really finding those ways that haven't really getting the industry to have the creativity to understand one of the places they should be using this technology that's gonna be one of the most exciting things over the next few years I found earlier Mike early in my career as a programmer anytime someone wanted me to optimize something I would look for tasks that someone repeated exactly the same way off that's right now I feel like when I'm doing AI my particular smell is if someone is like altering code like point seven to 0.5 or adding extra if statements and then deploying yeah like for me when you're doing those kinds of tweaks where you feel like you need to take a shower afterwards as a coder that's a good place to start thinking about using a on they're using rules to make a prediction that's what you're sort of describing should it be 0.5 is the threshold should it be point 3 isn't threshold and you know this is where I say you saw this in fraud a lot and I get a thousand requests from the same IP is probably fraudulent and you know I remember the early days when I was working on fraud you know AOL dial-up modems were a huge problem that tells me how old long I've been working on fraud because they all came from the same ip address and so you shut down all of AOL from their one IP address and they and I are models gonna be much better to learn that hey they're different patterns that I should be looking for and so instead of having these broad course rules I'll have these you know I can really pull in a thousand different features in and build a model around that let's talk a little bit about sort of the elephant in the room and this is important because people are looking at this and they're like hey how much is this gonna cost if I want to use if I want to build my own machine learning model and Azure machine learning service is this gonna cost me a lot so the beauty of using the cloud is that you use only what you consume right and so the cost for GPUs if you were to go out and buy a whole host of them they're tremendously expensive and so the rates that you can use when you're using the training service you know is measured in you know the tens of cents per hour and things like that so dramatically cheaper you know building models yeah there's cost associated with it but it's it's not exorbitant this is something and the benefits that you get from it on the other side I don't think I've seen anyone come back and say hey we're not gonna build this model because the the training costs are too high and here's the thing like I I've laid down an azure machine learning service workspace and we basically lay down for things we lay down a pin sites which is nothing yeah we lay down storage which is empty yeah right we lay down a CR which there's a free version yeah right and then we lay down so app insides Azure storage ACR and there's there's one more thing that I'm forgetting happens science as your storage ACR and there's one more that'll come to me and compute back oh yeah the computer yeah the compute stuff and like you and even the compute isn't laid until you specifically specifically asked for it and so you can also create a compute environment that has zero to n nodes yeah and it won't even run yeah I mean that's you know I honestly I don't know how everyone doesn't develop on the cloud these days the the economies of scale that you get from being in a cloud are just they just give you such a better efficiency from that it's pretty amazing okay so we've got about three or four minutes left where can people go to find out a little bit more about this AI stuff and how can they like get start like if you're a programmer and and because you already know all about all this AI stuff what would you suggest someone go do right now I mean the things that the easiest way to really get started is to go and look at the azure notebooks and start with they're the azure notebooks will walk you through how to use Azure machine learning service notebooks are such a great environment for learning in because there's a description of what you're trying to do right in line with the cell that executes the code you can change the code and continue to execute it and make it just go right there in line that's the thing that I would recommend everyone go and do it'll both you know depending on sort of what you need to learn if you need to learn how the services work they're great document they're great notebooks sort of walking you through how to use the service if you need to learn how to build AI models there are notebooks that'll show you hey here's some of the simple iya models do I want to do like you know the classic amnesty I can type draw number and sort of have it recognize you can those are really straightforward ways to go and do that I just remembered it's key vault is the last one so there's four things we lay down storage app insights key bald and Azure as er a CR right which is as a container registry okay so I figured I'd show just a little bit of its what this looks like because a lot of you are probably wondering what this looks like and like it's really simple and the cool thing is that the part that maybe we haven't seen in Francesca's showed that a little bit during Scott's demo is we actually have these amazing integrations individuals to your code where I can go in and submit experiments by right-clicking right or viewer experiments or attaching right and and that's that the coolest part right and the other thing that I really liked about this that I've used so far there's a team of like four or five of us that work on these models and all of us can see what all of us are doing yeah like here's an example that you talked about hyper parameter tuning yeah it ran 20 experiments and notice that here there's like this green line it actually stopped running it because it's like yeah this one didn't work what a type of rider is not working and that's cool because initially like usually I'm running a for loop and spanning over hyper parameters like the learning rate or momentum or whatever here it's a smarter for loop because if it's within and I use the bandit method if it's got 20 percent it's gonna kill it now and that's a great example of you know usually you'd have to sort of be sitting there and watching and tracking having it basically printf hey this is what's the learning rate how it's converging you know high parameter tuning is just gonna do that for you and so it's it's really saves a ton of time for you and the other thing is and this is the part that's really cool here's all the computer environment you see on my computer we have like some batch AI we have some kubernetes services in our compute and it's basically we just submit and forget and then we can see all the output it shows us all the output in notebooks it's amazing now here's the the part that we were talking about models to me are like the executable part of a on yeah that's right it's like it's like when you compile your code to get this assembly I feel like that's what a model is - it was a great analogy you put something in and something comes out and as a programmer it's something that we want a version yeah and in here you can see we are versioning all of the models that's right and then we can marry models with scoring files to create images and then we can do deployments and so for example you can see the simple m nest service right here I wrote it like a cheesy little app here where I submit like I can draw a number this is the cheesiest version the cheesiest thing but you can see it returns things from me directly from the service and I'm gonna make like weird numbers and you can see that oh it really thinks it's a 4 but if I start to do crazy things like this you can see that it's gonna start to be sure about other things right and it's it's pretty cool that you're able to go from idea to submit a job to save a model to create an image deployment all within the same environment yeah I think it's really important that the software development lifecycle for models is different than for software so it is and so understanding what are the tools that I need and how do I really use that more effectively those are the things that are gonna make you productive and successful in building your models and deploying them if you if you try and do it you know sort of the standard software way you're gonna have a hard time figuring out how it all fits together awesome well anything else to finish up with my friend I'm really excited that Azure machine learning is GA I think there's gonna be a ton of amazing uses for it and I'm excited to see what people will do with it well thank you so much for being with us Eric all right well the show is not over we have my amazing colleague Brian Benz just over there with Beth to talk all things java let's go to that

ASP.NET Core 2.2

hi my name is Glenn Condren I'm a program manager on the asp.net team and today we're going to talk about some of the ...