 Hello, and welcome to D2 of.NET Conf. Obviously, we could not afford Scott Hanselman for two days. So you got me, and? Hello, everyone. My name is Mika Dumont. I'm super excited to be here. And I am Seth Juarez, and we've got tons of exciting things today, a ton of sessions. Mika, can you give us a little taste? Yeah, let me get out my list here. We have Visual Studio for Mac Reborn as well as some future of the laser, some F-Sharp, new things in F-Sharp, tips and tricks on moving to.NET Core, and much, much more. Fantastic. So make sure you get your questions in while you're watching. Yes. Because if you ask your questions after we leave, then we can't ask them. So get them all on the board. We want to get all of your questions in. But also, we also have a technical treasure hunt. And I'm going to read this because Beth Massie probably wrote this. By the way, you need to follow her on Twitter. She is almost to 10,000 followers on Twitter. And if she gets there, she owes me like 50 bucks. And Mika, she's going to give you like 80. I don't know how to work this out. Yeah, I think we're going to split it maybe. Right. So she gets 80, I get 50. Do you like solving hard technical problems and winning cool prizes? I know you do and I do. Yeah, I definitely do. You're not, you're going to want to watch all of that.NET Conf 2019 because.NET partners are sponsoring a technical treasure hunt. There will be fun challenge to solve and you'll be eligible to win prizes. Just go to.NET Conf, front slash partay, but spelled party. So what is the session we got coming up right now? Yeah, so right now we have Visual Studio for Mac, reborn new editors and new experiences with Cody Bayer. So Cody, take it away. Hello and good morning, good evening, wherever you are today and thank you so much for joining me here. My name is Cody Bayer, Senior Program Manager on the Visual Studio for Mac team here at Microsoft. Today, we're going to be talking about what's new in Visual Studio for Mac from new editors and new experiences and all the other great goodies that we have in Visual Studio 2019 for Mac. So without further ado, let's get started. So 8.3, that's the version of Visual Studio for Mac that we just released yesterday. It is the biggest release of VS for Mac that we've ever had. It's filled with all bunch of great news features from new web editors, multi-targeting support, of course, .NET Core 3 and C-Sharp 8 support, as well as smaller updates like pinning documents and proof quick fixes and source link. By introducing all these new features, we're hoping to really improve the overall developer experience within Visual Studio for Mac. Not just one thing, not just another thing, but the overall end-to-end experience. We have updates in each of those and we'll get to those in a moment. Of course, this is built upon the solid foundation of Visual Studio 2019 for Mac. That includes updates such as the new C-Sharp editor and the new XAML editors, improved Git reliability, updated templates, published your folder and all sorts of other improvements as well. So not only does 8.3 represents a major step forward in web development and in .NET Core development on VS for Mac, but it's built on top of this great release with new editors, new native editors. We can get right into those because I can't wait to show you all the neat stuff that they include. But first, I want to thank you to our preview users. None of this would have been possible without the folks who hopped onto the preview channel, tried out these new features and gave us feedback. It's invaluable to us and we could not do it without you. So thank you very, very much for trying out these new features and giving us that feedback to get us to where we are today. All right, so new editor, new backend. Let's talk about what makes up this new editor, why we have a new editor and what we can do with it. So I had to think of .NET as the most powerful cross-platform toolkit there is. And if you look at what .NET does and what we can do with .NET, nothing to me demonstrates this more than the new editor for VS for Mac. So if you think about what a quintessential Windows application is, the Visual Studio editor on Windows fits that bill. It's WPF, it's been on Windows forever. It's fast, it's stable, and it's also based on .NET. So we looked at what we needed for a new editor in Visual Studio for Mac. We looked no further than Visual Studio on Windows. And because it's based on .NET, because it's this cross-platform toolkit beneath it, we were able to port a vast majority of that over to Mac OS. The only portions we didn't take with us was the UI layer on Windows, that's WPF, on Mac, that's Cocoa and Cortexed. So we were able to take all the high-level editor features IntelliSense, all the quick fixes, Roslin, and the language services, all of the little tools that tell what text were to go, all of these things were shared between VS for Mac and VS Windows. That is the power of .NET, and that is how we were able to take the quintessential Windows application and move it to Mac OS. So let's take a look at it and see how it looks in the real world. So I have a cat, this is Buttons right here, he is my cat. I went to my vet and I was told that he needed to go on a little bit of a diet, so I needed to start tracking my calories for my cat. And this is something that is kind of hard because if you didn't have cats, you know they don't take well to being told how much they can eat. So I wanted to make an app to remind me of this. And I thought, what a perfect opportunity to do this, to try out the new web editors to see how I can make an ASP.NET Core app with tracking my cat's feeding. So in this application, super basic, I wanted to use ASP.NET Core 3 with the MVC pattern, utilizing razor pages, and I wanted to mark which days exceeded the K-Cal limits, as well as allowing multiple cats because I do have more than one cat and I don't want to get them confused, feed all one and not feed the other, that would be a disaster. And finally, I want to clearly demarcate by day so I don't, again, give all my cats food one week and one day. That'd be terrible as well. So let's take a look at what we did. Hopping on over to VS for Mac, I'm going to launch the Fitty Kitty demo. And I immediately see there's a to-do here. I need to fill in this class. So what am I gonna do? Well, first I know that I need a DB context here because this is the meal context class. So by typing in deep, oh, shoot. I don't remember the library and the namespace which DB context comes from and that's rather embarrassing. But with Visual Studio for Mac, I am given a beautiful new tool that helps me figure this out. So we're hopping to preferences and selecting IntelliSense, show import items. I'm able to enable this new feature that lists which import items are available to be imported into my project based on what I'm typing in IntelliSense. So let's see that in action and hopefully that will make some more sense. By typing in DB context, now I have all of these different completions available to me and you'll see to the right I have the namespace for which those completions belong. So DB context, which is what I need to import into my project comes from Microsoft entity framework core. So all I need to do is arrow down to DB context in my editor, hit tab and not only does it complete DB context, it also adds the using into my application. This is a huge time saver and really speeds up the amount of time it takes for you to remember all these different imports. I forget them all the time. So it saves me a lot of time and I hope it saves you a lot of time too. All right, now another great time saver that I've found to be super useful in this IDE is the concept of snippets. So snippets represents any amount of code that you may use many times. So in this case, I need to type in all the methods and mechanisms for the DB context here and I don't necessarily again remember the exact everything about it. And because I wanna impress my friends, I'm gonna go ahead and use a snippet that allows me to see and enter the code but just a few characters. So previously I created a snippet for creating the DB context information. So to do this, I'm gonna type in DB CTX. You can see right here that not only is there a snippet here, it has a snippet icon of the ellipses there. So and as the IntelliSense says, if I tab twice, it's going to insert the DB context snippet. So go ahead and hit tab tab and there we go. Now I have all of the code I need for the DB context method and I can type it in here. So as you can see, there's two sections within this code that say not set. Those are variables that I set within the snippet that allow me to, as I'm filling out the snippet, type in the code. So let's see, I know this needs to be named meal context. So I type in meal context and you can see not only does it fill in the first variable but also fills in the second because it both marked with the same placeholder. I'll show you what that looks like in a snippet editor. So you go to preferences, navigate to code snippets. You can see the DB CTX is the first one on the list. That is the one that I created. And as you can see, I have public dollar sign name dollar sign that represents a placeholder for user input. You can see that the name is the same name between both of the insertion points. This means that what I type in one, I get in the other. If these were different variables, I'd use different variable names. And you can mix these up as much as you want to get the results that you want. Again, I find snippets to be a huge time saver, mostly for code that you have to type a lot but you don't necessarily remember every aspect of or for code that has a few plug and play parts that you can quickly replace with others. All right, so that's great. I got this part all completed, but I do need to add my DB set. So I am going to call public DB set. And while we're here, I want to point out another fantastic time saving feature of Visual Studio for Mac that I absolutely love. And that is type filtering. So and this worked really well when you have the show import items feature on that we talked about previously. Now, my completion list is rather lengthy. So if I backspace here and okay, I'm gonna start to the D. You can see this is a very full completion list. And it can be somewhat daunting when you don't necessarily remember exactly what you want, but you know it's a class, you know it's a delegate. So with IntelliSense type filtering, you see these icons down at the bottom of your completion window. You can select which ones or which types you want to filter by. So for example, if I want to filter only by classes, I click classes and that limits the completion list to only include classes. Same goes for things such as enums and structures. There we go. By limiting the number of items in my completion list, combined with the power of showing all available imports, I have a much more helpful and friendly completion list available to me. Watch, I know that DB set is a class. So I'm going to limit to class. Navigate down here to DB set. I know that it is a type of meal. And IntelliSense is going to suggest that I call it meals, which I agree with, that's a good name. So I'm gonna accept that by hitting tab and add my get set here. There we go. That essentially completes my context here. Now check out my to-do list and see if there's anything else I need to do once I clear this guy out. There we go. All right, by clicking on tasks, I can see that I need to change kcal from strings to int. So I'm gonna double click here and navigate. All right, change, ooh, okay. So yeah, it actually doubles. So I need to change these doubles to integers because that's the day type it needs to be and whoever did this probably Dominic he did it wrong in the first place. So I'm going to go ahead and change this to be integers. All right, so I can do this in several different ways. I can do a final replace, but that might replace things which I don't want to replace. I can do them one by one, but that's, we don't want to do that anymore. This is the 21st century. We don't need to do things one by one. So what options do I have? Well, I have the power of multi-carat editing. Now multi-carat editing does, it allows me to have multiple insertion points based on pattern matching. So what I'm gonna do here, I'm gonna hit command, sorry, option shift period, and it's gonna select double. Now if I type that key combination again, we'll see that the next double is selected and the third time, the third double. And now if you notice to the right of each of these strings, I have the word or the cursor blinking for double. That means that there's three insertion points in my code right now. So if I type in INT, each of those is changed to integer. So without having to find and replace or doing these each by hand, I'm able to quickly replace those code snippets. Now this is a very simple usage of multi-carat editing. It is a super powerful feature and it clearly has way more uses than what's demonstrated here. But I hope you give this feature a try. It's available again through keyboard shortcuts and also through your mouse clicks as well. For the keyboard shortcuts, if you check out multi-carats under the edit menu, you can see all the different combinations of keys that you can hit to enable different multi-carat options. All right, so that's step two is done. Now if we recall, I need to be able to tell when I overped my cat. So let's go into the index.cshtml, take a look at the new web editors. All right, so this is the Fitty Kitty index.cshtml page. Now I know a few things, surprisingly, but I do know a few things. And one of those things is that I need to have a CSS style, but I want to make sure that I'm using proper intelligence here. So I'm going to, right now I'm in an HTML document essentially. It's a CSHTML, but the code I'm looking at is HTML. So I'm open a tag and I see that I get HTML intelligence. That's exactly what I would expect at this point. But I know this is style. I know that the style I want is going to be of type CSS. All right, so now I'm within CSS, because I'm within the style tab. So I need to have a designation for overweight or overcalories, apologize. And here I'm going to say background color. So now I'm getting CSS IntelliSense. So by giving this CSS IntelliSense, I'm able to then complete what I need in this context. So background color, I want that to be red, to warn me that I had a little overfeeding. And I want the text color to be white, so it is readable. I also mentioned that I wanted to have some sort of designation of differences of days. So even days will have a gray background, odd days will have a white background. That way I can clearly demarcate the day. So I need to have another designation here. I'm going to say even day. And again, I'm going to use CSS IntelliSense to give me the background color. I'm going to pick light gray. Perfect, all right, there we go. Now I have all the CSS that I need to fill out the styles. So I'm going to hop down into my for each loop and add the code. So we saw HTML IntelliSense, we saw CSS IntelliSense. And now we're going to see C sharp IntelliSense all in the same file with context-aware IntelliSense. All right, so how are we going to do this? Well, you can type in C sharp. So I know that I need a string to designate the type of style I'm doing. So style choice, I'll just initialize that that way. All right, so I know the main differentiator is going to be the day. So the first thing I want to mark is whether it's an even or odd day. So if item.time.day is an even number, then style choice is going to equal even day. As that's what I set here, so even day. So you notice that I have set these values to be even to or to be equal to those which I declared it in my style. And that way I can use the CSHTML and the C sharp code to designate my style. So I'm going to do the same thing for the over. So if item.kcal limit or day total is greater than 75, 85, let's go with that. Style choice is going to equal over. As again, that is the name of the style that I put in place with MSCSS. So finally, I need to add the class here to my table row designation. So class equals at style choice. All right, that should complete it. Now I should have what I need here to see if I've ever fed my cat, which is important. One thing I want to quickly point out is I can now choose which IDE, or sorry, which browser I want the IDE to launch. So in this case, let's go ahead and launch with Microsoft Edge Beta. So I'm gonna click deploy and we're gonna watch this work, hopefully. The ability to really pick out your web editor is a small but big feature, if you know what I mean. It's not something that's going to change everything but it makes things a lot simpler. And, oops, I have to trust this certificate. Of course I do, I'm a trusting person. And then you type in my password and I'm gonna let you all see it. So I'm a trusting person. All right, passwords typed in, bill is successful, deployment is occurring. Let's see how I did on feeding this week. All right, localhosts 5001, perfect, here we go. Now I do have these days designated for when I overfed my cat, I overfed HEMA one day, buttons the other. That's unfortunate but now at least I know which days I did overfeed my cats on. We did have an issue with even day and that is because I named it wrong. So if I go back down here and I run it again, even day should now designate the colors as we would expect. Let's make sure that works as expected. There we go, now the even days are marked as such. So let's take a look back at what features we covered. First we covered the updated web editors. These include native typing performance with context-aware intelligence. Again, that context-aware intelligence was the ability to have different intelligence languages within the same document based on the context in which I'm writing code. We also saw automatic intelligence importing through show import items. That allows you to import types as you type and ensure that you have anything available to you. One thing to note though, is that if a NuGet package is available in your solution but not within your current code file, it too will be available in the completion list. Intelligence type filtering allows you to limit the amount of data within your completion list based on type. Again, that with combined with the show import items, this super useful feature. And finally we saw multi-carat editing. This allows you to insert multiple carats of code at the same time based on meaning number of different constraints such as matching characters as well as strings. Finally, one thing I didn't get to show, which is super important, is right to left support in the editor. Now, if you see on the translation here, it says welcome to the editor in Arabic. Arabic being a right to left language. That means the language of the sentences start on the right and end of the left, opposite of what we are used to in English. On the legacy editor, you see that the string was backwards so it actually read in reverse. That's no good if you're trying to type in the right to left language. Luckily, the new editor supports right to left languages and we can see that the end of the string is where it should be in a right to left language. Again, this is a very important feature if you type in the right to left language or bi-directional languages and we're super happy to have that in our IDE. It was a top community request and we're happy to fulfill it. All right, so quickly I wanna talk about multi-targeting here and then let's see here. So I'm going to open a new instance of the IDE and multi-targeting is a new feature in Visual Studio for Mac that allows us to target different versions of the .NET Core framework within the same solution. This is super useful when you're trying out new framework types or you want to work on migrating your code. So I'm gonna open up this multi-target sample and as it's opening, let's take a look at what this actually means in practice. All right, so here we are, multi-target framework. So you can see up here, I have the ability to choose .NET Core App 3 or .NET Core App 2.2 and I also have the ability to target it here. One thing I wanna point out in this example is how IntelliSense is aware of your multi-target situation and lets you pick and sorry, demonstrates what versions of completions are available to you. So I'm just gonna go on down here, gonna type A and as I scroll down, you're going to see that some of these have these little warning triangles next to it. Let's see what that's all about. All right, so if I hover over and select App Domain Setup, we see that it's only available in .NET Core 3. That's not available in .NET Core 2. So now as a developer, I know which target framework I need to pick in order to use the code I need to use this time. Again, another super handy feature that really makes development go a lot faster. All right, let's hop on back over to PowerPoint here. Play from current slide. All right, so again with multi-targeting, you're able to see that you can target different frameworks with a single app and the framework is aware, sorry, the IntelliSense is aware of the framework which is selected and also aware of what's available in each framework. Super powerful feature and I hope you check it out. We also have an updated XAML Editor in Visual Studio for Mac, which is a huge, huge, huge benefit if you are a Xamarin developer or if you write in XAML at all. The new XAML Editor includes fuzzy searching, resource intelligence and type filtering. Now, we don't have enough time to get into this today, but I do suggest checking out both James Montemagno's talk as well as David Orton now is to see how the new XAML Editor works in real time. I also want to point out that there's more VS for Mac available at .NETConf tomorrow at 8 a.m. My friend Sayed Hashimi is going to be here to demonstrate how to get started in .NET Core 3 with Visual Studio 2019. Again, I scratched the surface of what's available in .NET Core 3. Sayed's going to deep dive into it and make an app from beginning to end. I really suggest checking it out. It's going to be a great, great, great presentation. All right, so time for questions. Quickly, my name is again Kody Byer. You can follow me on Twitter at seal underscore buyer. We have at Visual Studio for Mac if you want to follow us on Twitter as a team. Documentation, check it out aka.ms slash VS Mac docs. And finally, check out developer community. We're here to listen to your feedback to provide suggestions aka.ms slash VS Mac devcom. All right, let's toss it over for some questions. Wow, that was awesome. Thank you so much, Kody. I love those multi-carat tools that you showed earlier actually. It was pretty, pretty sweet. We have some questions here from Twitter. So let's see the first one. Over here, SRavi Kumar wants to know, I don't see an option to add Docker support and new editor. Any idea when that will be available? I don't off the top of my head, but if you want to hit me up on Twitter, I will get back to you as soon as I can on that. I believe that most of those, the main goal was to get C-Sharp, then XAML, then web, and then these extra kind of Docker files and YAML and all those other files in there as quickly as we can post that point. So we're looking at the 8.4 timeframe, most likely. But yeah, hit me up on Twitter and I'll get you some more exact time frames there. Great, yeah, we have another question on Twitter. Let's see, so they want to know what's on the roadmap for VS for Mac. Great question. First of all, you can check out our roadmap on the docs page. I don't have the link available, I apologize for that. But we're really focused on bringing Blazor support in 8.4. So if you've watched any of Dan O'Roll's amazing Blazor talks, Visual Studio for Mac is aiming for 8.4 as our Blazor timeframe. So check out that. Also update your get back ins to ensure that your get experience is as good as it can be. And again, bringing more of that editor goodness across other aspects of the IDE, including the support files. Awesome, well, one more question right here. When will .NETConf videos be available on demand? They will be available within 24 hours. So you can get them right off the presses. Well, I'm pretty excited for the next session. Well, actually we have a little commercial break. Please enjoy this short little package. Hey there, treasure hunters. I've got your next clue from our friends at Lead Tools. For this challenge, you will use the Lead Tools OCR and barcode SDK technologies to extract the secret key as text from both an image and a barcode. Join those two parts into a one line secret key and then whisper that complete key to the .NET bot in the Visual Studio Twitch channel to continue on with our technical treasure hunt. Go to this URL to get started. Solve that and you could be well on your way to the next step in our technical treasure hunt. Hi, I'm Cam Soper. I'm a content developer working on .NET docs here at Microsoft. And welcome back to Entity Framework Core 101. So far we've looked at using Entity Framework Core exclusively with SQL Server. In this video we're going to look at using Entity Framework Core with other database providers. The database provider is a layer in the EF Core architecture that's responsible for the communication between Entity Framework Core and the database. It's a pluggable architecture which means we can support all kinds of databases. The first database provider we're going to look at is SQLite. SQLite is an open source cross-platform embedded database technology. I'm starting with a web application where I've already got Microsoft Entity Framework Core .sqlite.design.tools installed. To use the SQLite provider where I would previously use .use SQL Server I'm instead calling .use SQLite and I'm passing in the connection string in the SQLite format. That connection string points to a local file here on my machine. I've created a new record. I'm going to use a tool to read SQLite databases. This is an open source tool available for download on the internet. And we'll browse to the products table. As you can see, there's the rope pull toy I just added. The next database provider we're going to look at is a brand new database provider from the Microsoft Entity Framework Core team that supports Azure Cosmos DB. Cosmos DB is a cloud-based distributed NoSQL database which means that instead of being a relational database management system it works with JSON documents. Just as in my previous example I have a working web application and in this web application I've already added Microsoft Entity Framework Core .cosmos.design.tools. We already have a working entity model and a working database context. We'll use the useCosmos method to pass in our connection information and once again I'll have to remind you don't include sensitive information in your code. One difference with Cosmos DB is that it doesn't support the concept of an auto-generated int for a primary identifier. So I've changed the entity model so that our IDs will be strings and they'll be initialized to a new GWID or globally unique identifier. Let's run the application and add a record to our Cosmos DB instance. Now that I've added that record we'll go over to the Azure portal, refresh my list of items in my Cosmos DB instance and you can see the squeaky bone I just added. These are just two of the possible database providers you can use with Entity Framework Core. Visit the Entity Framework Core documentation to see the full list of supported providers. Some are provided by Microsoft and some are provided by the community. Support includes MySQL, Postgres, Oracle, DB2 and others. In this video we looked at how EF Core uses database providers to support a plethora of different database technologies. In the next video I'm going to show you tips to get the most performance out of your EF Core applications. Hi everyone, welcome back. I'm Daniel Roth and in this session we're going to talk about the future of Blazor on the client. Blazor is a client web UI framework based on .NET and C sharp instead of JavaScript. Now previously the browser was a black box that you couldn't get your .NET code into. Now with Blazor you can use .NET for your client web development needs. But what if you need to take your app to other native platforms like mobile, desktop and other devices? It could be really expensive to have to build native experiences for all those platforms. You might not have the developer resources or the developer skillsets. One common strategy is to use the ubiquity of the web and your existing web developers to build apps with native like capabilities. In the future we want to evolve Blazor so that you can use it to build apps that have those native like capabilities. So we're going to walk this spectrum from the web to native applications. Now we've already seen Blazor server apps in .NET Core 3.0. It's available this week. Download and install it, try it out. Blazor server apps enable you to add rich client side interactivity to your existing .NET web applications. Now they run on the server but they allow you to have that client interactive feel like a single page web application. They also enable you to leverage the capabilities of the browser using JavaScript intro. Let me hop over here to Visual Studio. Here's the Blazor weather application that we saw earlier this week. This is a Blazor server app. I've already refactored it again to move all of its components into this Razor class library this Blazor weather.core. We expand some of these folders. We'll see all the Razor files in there. There they are. That's so that I can reuse these components in the future demos. When the Blazor server app, we've seen what this looks like. It has a UI for showing the current weather. And one of the things that we already saw is that we do have client side interactivity. We can click on and change the current temperature unit. We can also use the capabilities of the browser to get the user's current location by clicking here that should use the geolocation APIs to give us where we're currently at. All right. One other thing that I've added to this application that also leverages an additional capability is the browser's local storage. I used, it's actually a community project. I was at github.com Blazor'd. This is a project by Chris Sainte. And he's done a whole bunch of really good stuff. He has a package that uses JavaScript interrupt to enable local storage and Blazor applications. I use that so that if we go back to the app, we can store our pinned locations locally in the browser. So that's like go to Chicago and we'll pin that one. There it is. And now we can cycle through our pinned locations. So we have Seattle and Chicago. If I grab this URL, I'm just gonna close that tab and then we'll open up a new one, browse back. We still have Seattle and Chicago as our pinned locations using the browser's local storage to store those things. So we get to leverage browser capabilities as well with our Blazor server applications. Mr. Ross, Mr. Ross. Oh my goodness. I brought your blazer. What are you doing? I brought your blazer. Oh my goodness. Yes. Yes. Gotta look the part. Oh yeah. This. We blazing blazer. This makes me ready now for the demo. Thank you Mr. Fritz. All right. All right. We're gonna blaze on now. Okay. Woo. Yeah. I'm not expecting that. Okay. So what's the next step on adding more native-like capabilities to our Blazor application? Well, the next step is Blazor WebAssembly. Blazor WebAssembly apps run in the browser on a WebAssembly-based.net runtime. Sorry. So with a Blazor WebAssembly app, your app is just a bunch of static files and they can be downloaded. They are downloaded into the browser and then executed. And they can then leverage the capabilities of the browser as well. So I've taken the same application. This is the server version. Let's close that. Let's now go to a different project and this is a WebAssembly version of the same project. It's actually using exactly the same components. This is kind of cool. A lot of customers that I talked to are starting out with Blazor server with the plan to when once Blazor WebAssembly is available in May of next year, that they can then shift their app to actually run full-on in the client. But let's go ahead and run the WebAssembly version of this app. Looks pretty much the same. Does the same things. Like we can get our current location here. We should be in Redmond. Yep, there we are. All right, and then if we F12 and look at what was downloaded to this application, it looks a little bit different. Yeah, so there you see down at the bottom, there's that mono.wazm file. That is our WebAssembly-based.net runtime. So this app is actually running client-side directly in the browser. Now to show that that's really occurring, we can even debug when I F12 again. If we look in the console, you can see there's a debugging hotkey gesture that we can do. I'm not debugging this in Visual Studio. I'm actually gonna use the browser dev tools to debug it. We don't support debugging in Visual Studio yet for Blazor WebAssembly apps, but we will in the future. For now, don't run it with Debugger in Visual Studio and then you can use do this trick. So I'm gonna hit Shift Alt D. And that's gonna try and bring up the browser dev tools to connect to the tab that I want to debug through a debugging proxy that we set up for you. Now for that to work, we actually have to run the browser with remote debugging enabled, which I don't have it doing currently. And it's telling me how I can restart it, so it does do that. So I'm gonna close down the browser completely and I'm gonna run the command that it just told me to do. To restart the browser with remote debugging enabled and we'll hit that gesture again, Shift Alt D. And now I should get the browser dev tools that can connect to my tab. There we go. So let's put this side by side with the tab I want to debug. And we've already got some files open. Let's go ahead and close those. In the sources tab, we can see down here, we can actually take a look at all of our, let me give myself a little more space, all of the files that are in our application. So there's Blazor Weather Core. What do we want to look at? Let's look at the temperature unit picker. We'll open that file up. We can set a break point right here on the click handler when the temperature has changed. Let's go ahead and get the current location back up on the screen so we can change the temperature unit. We'll click and there, we just hit a break point in C-sharp in the browser, running on top of a WebAssembly-based.net runtime. We can even expand down here and take a look at some of the local fields in our component. So currently the temperature was Fahrenheit. Let's hop out of here and let the app continue. If we clip the temperature unit picker again, it should say that it's changed and has it. Yeah, looks like we're good. So now the temperature is Celsius. So there, we just debugged our Blazor WebAssembly app directly client-side. So that's pretty cool. We'll go ahead and let that run. All right. So that's Blazor WebAssembly. Now we can use some of the more modern web standards in our Blazor WebAssembly app to make it even more native-like. And apps like this are typically called Progressive Web Apps or PWA. So what is a PWA? Well, a PWA is just a web app but it uses modern web standards to enable things like offline support. You add a service worker so that the files can be cached and used even when the browser is not connected. Support for push notifications. PWAs tend to are fast and responsive so they have that native app-like feel. On some platforms they can even be OS installable. Like you can pin them to your home screen on your phone or on Windows 10 you can install them so that they can be run from your start menu. So we can take our Blazor WebAssembly app and turn it into a PWA. All right, let's do that. So actually we've already got it running. And if we look at the top with our Blazor WebAssembly app you can see there's a couple of icons up there. And this one here says install Blazor weather as a PWA, that's because the browser and Windows 10 is detecting that this is a Progressive Web App. If I go ahead and click that, yep, let's go ahead and install. And now we see our Blazor WebAssembly app but it's in like a native shell with all the same functionality still works like, I don't know, St. Louis. So we can find new locations, we can get the location by geolocation. And we can see that on the start screen of my Windows 10 box there is my Blazor weather app and it has a nice little icon so that it shows up in the start menu. So that's pretty cool. So that's a Blazor PWA. How did we enable this if we go back to the code and look at how this was implemented? In the www.root folder, we can see there's a service worker that was added to this application. This is a piece of JavaScript that enables caching. And then there's also this manifest file which specifies like icons that can be used when this app is either pinned to a home screen or to the start menu on a Windows device. So that is a Blazor PWA starting to look a little bit more native. It's got a native shell. It's runnable from the start menu. Let's go ahead and close that. Great. Hybrid apps are native apps that run natively on the device. They have access to all the native capabilities of the device but they use web technologies for rendering their UI. So for example, you might have a mobile application that's running natively but it's using a web view for rendering all of its user interface. Or you can have an electron application and an electron application is using an embedded chromium shell to handle all of its user interface. Let's see if we can build Blazor hybrid apps as well. We've been doing some experiments in this space. Let me go back to Visual Studio. All right, so here in my third project we have a BlazorWeather electron app. So I'm gonna set this as the start project and we're gonna go ahead and run it. Again, it's using the same components as before but now instead of running as a web application this Blazor electron app is gonna run in an electron shell. It's a native shell, like we have all the access to all the native capabilities of electron, the same functionality still works. Let's see what the weather's like in New York. There it goes, we can get the current location and so forth. We have all of our pin sites and this app is interesting because it's not actually using WebAssembly. The Blazor WebAssembly app and the Progressive Web app those were both WebAssembly based. They were running inside the browser using the WebAssembly based runtime and as a result they were also limited by the browser security sandbox. A lot of people ask me about Blazor WebAssembly apps when they see DLLs being downloaded into the browser and ask is that safe, is that okay? Like is there any security issue there? The answer is no because the code that's being executed is being executed using that .NET WebAssembly runtime running in the browser security sandbox. So it can't do anything more than what normal JavaScript could do in a browser application. Can't do anything more and it can't do anything less either. It has all the capabilities of what JavaScript can do but no more. So it is safe. In this case though we're running an electron in an electron app the .NET code is running in a normal .NET core process. Not .NET core process does actually have full access to the native capabilities of the machine. So if you wanna touch the file system or open arbitrary network connections with this application that's stuff that you can do in this application. So basically what we have here is a native desktop app with the UI built using web technologies built using .NET and its cross platform. This will run on Windows, Mac and Linux. So that's an example of what a Blazor hybrid app might look like at least for desktop scenarios. This is something that we're exploring and investigating. If you wanna play around with Blazor Electron I think I have this URL set up. You should go to HBS colon whack whack Blazor Electron. AKAMS Blazor Electron is the URL. And let's see if this is now live. I think I set this up this morning. Yeah, there we go. This will take you to our ASP Labs repo and we have an experimental project that we're working on that integrates Blazor with with Electron and there's a sample there that you can try out. All right, now the last stop on our spectrum from web to native is going, well first we'll get past the hybrid screen, is going full native. Actually having a native app but instead of using web UI or web technologies to render the UI, we use native controls so that we can leverage the native controls of the device. This is an area also that we're investigating and experimenting with. I don't have a live demo for this area but Blazor was architected from the beginning so that its renderer was extensible. The default renderer in Blazor renders HTML and that's why you use Blazor to build web applications not too surprising there. But the renderer can be replaced. In fact, you can replace it with a different renderer that renders to whatever you want like you might render instead to native controls. And there's a really cool demo that is just a tech demo and experiment. It's not anything that we have any plans to ship but that Steve Sanderson did at NDC Oslo earlier this year and what he did is he took the Blazor renderer, he replaced it with a renderer that could render to native Flutter controls. So he was able to build a Flutter app using Blazor, writing his code in C sharp. Normally Flutter apps would be written with Dart. It's pretty cool demo. You can take a look at it at the link below so Blazor plus Flutter who gets you Blutter I guess where you can see Steve Sanderson demo that capability of Blazor. Now again, this is not something that we actually plan to ship but it just shows you what is possible with the Blazor model. This is very similar in nature to what you typically write with applications that are using technologies like Xamarin or React Native. These are applications that run natively on the device and then also render to native controls in a cross-platform way. We're looking at could we do something similar with Blazor like have a Blazor native that does a very similar thing. Nothing to share yet there but it is an area that we are currently looking at. All right. So this is what the roadmap now looks like for Blazor. Blazor server is available today. It is supported in .NET Core 3.0. If you wanna build a Blazor server app and deploy it into production, you can do that right now. Go ahead and download it, install it. It's great. You can start adding some rich interactivity to your existing .NET web applications. Blazor WebAssembly, we announced earlier this week. We'll ship next year. We're targeting May of next year. We'll start to see more progress on that in the months ahead. We're also starting work on Blazor hybrid apps and Blazor progressive web apps. You should expect to start to see previews of that functionality in some of the .NET 5 previews that will be coming up shortly. .NET 5 is expected to ship in November of next year. But hopefully we'll have previews of PWA support and Electron sooner than that. If you wanna play around with Blazor WebAssembly apps as PWA's, there are actually some really nice community projects out there that you can download and install and those are really great to try out. Blazor native is not something that we have any concrete roadmap for, but it's an area that we are experimenting with and we hope to learn more about and talk to folks like you to see what we should do there. So that is the future of Blazor on the client. I hope you enjoyed the things that you saw. I hope you're excited about them. Give them a try, try out Blazor and Electron with a sample, try out Blazor WebAssembly, give us feedback and of course make sure you download .NET Core 3.0 today. There is no time like the present, so make sure you're using the bits that are already ready available. This is a bunch of useful resources that you can go look at to get started with Blazor. Go to blazor.net to get the bits and find the documentation. You can get the .NET Core 3.0 bits at .NET slash get-core3. Go make sure you get Visual Studio. If you're on Windows, you're gonna wanna get the latest release of Visual Studio 16.3. We have a wonderful Blazor workshop. If you wanna learn how to program with Blazor and participate in the Blazor community. They have a lot of great folks like Chris Dainty who did the Blazor project and others that are building wonderful JavaScript interop libraries and component libraries. And with that, I'm gonna turn the remainder of the time over to questions. Yeah, thank you. Check this out. Like I am in sparkling. Yeah, that's pretty awesome. I love that, yeah. Yeah, so thank you so much. We have a little special surprise. What? Another surprise. What is this? Lots of surprises today. Just go on over there, just walk over and let's get you. What is this guy? Let's get this over there right now. So I want everybody that's watching to know that this is actually Dain's 15 year anniversary at Microsoft. It is. What? And Blazor probably wouldn't exist without Dain. With a lot of people. With a lot of people working on Blazor. And so I want to give you this gift. This is a Blazor pillow. What's even better about this Blazor pillow if you swipe up? Oh my goodness. What is this? This is wrong. On the Blazor pillow. That. Look at that. Is that spectacular or what? It is spectacular. Are these being fabricated at large? Because I love to just like lay my sweet head on that. This looks like a one out of a kind thing. I don't know. What is this? That is. Congratulations on 15 years, Dain. Thank you very much. It's been a good 15 years. So the next 15 years. Yes. Fantastic. Thank you. Can I borrow that pillow for a couple of weeks? I mean, just maybe. No? Creepy. This got awkward real quick. I'm so sorry. We probably have a ton of questions. Let's do it. Oh wow. Lots of people tweeted you in your brand new jacket. So that's pretty sweet. Do you want to take a look? Yeah, let's do it. So let's start from the left here and we're going to get this question here. Will Blazor be a good choice for enterprise level web apps that need high availability, scalability, and fine-grained services on the cloud? Wow, this is really good. Yeah, you know, yes. I mean, that's what it's built for. And Blazor server in particular, that's what's shipping today. That's what's supported. Absolutely supported for large enterprise applications. I think we think of Blazor as being particularly well-suited to enterprise apps for line-of-business applications. Yeah, it would be, absolutely. Yes, it is ready. So yes, yes, yes. The answer is yes, yes. All right, what else do we have here? So what about this one? How do users update new build versions in a Blazor PWA? Oh, updates, how do you do that? These updates to new versions in a PWA. So I believe that's all managed by your service worker policy. Like, so I think the inherent question there is when you download a PWA, you can often set up a service worker so that it's available offline, which is effectively like caches the files. When you set up the service worker, I believe that's where you put policy about like when does the app go back to get the new files. And I'm sure there's also a way where you can just force the app to refresh. But I think that's how you would do it. I'll have to, I'll double check on that, but that's my current understanding. We haven't done a lot of investigations in Blazor and PWA yet. We've just done some early proof of concepts like you saw today. This is an area that I expect that you'll see us looking more into in the .NET 5 wave. All right, next question. Any updates about supporting GRPC Web for Blazor? Also Blazor native on mobile. Yeah, GRPC Web, that's really interesting. So we support GRPC now in .NET Core 3.0. However, it doesn't work from a browser. You can't speak the GRPC protocol from the browser to your front-end servers. There is a variant of GRPC that you can use called GRPC Web. We don't currently support it today and we don't have concrete plans to support it yet, but we are talking about it as a potential area to invest. So don't know yet, but let us know if you think that would be interesting and useful. For Blazor native, well, we just talked a whole bunch about what we're thinking for Blazor native. We are right now in the prototyping and investigating stage. Blazor was architected from the beginning to support non-web native scenarios where you replace its renderer with some other renderer that can go to native controls. It's very similar to what React did. React started out as a web framework and then moved to support native apps with React native. Blazor can absolutely do the same thing. What the roadmap for that is yet, we don't know, it's still TBD. TBD, okay. We have another question here. APWA using Blazor, that's something really attractive, but for now my question is, which server authentication is preferred, like Windows or DB? Chrome has problems with Windows auth. So which auth mechanism should you use with a Blazor application? So that will in part depend on your hosting model, like if you're hosted on the server or if you're running on WebAssembly in the client. And really the type of auth you then use will depend on your app and will depend on your environment. If you're running in the client on WebAssembly, that's like a spa. So you use spa style authentication patterns. Typically that means using like open ID connects, OAuth like flows where you acquire a Jot token and use that with all of your HTTP client requests. You can also use cookie based auth from a spa that is possible. Blazor server apps, you have the whole set of auth options available to you based on what you're trying to do. If you're writing a line of business application and you have Windows users and you wanna let them log in, Windows auth that would be a great option. If you're writing an app where you need users to be able to register their own user profiles and have their own passwords that you wanna manage, then using ASPnit core identity for your authentication support is a great option. For the WebAssembly apps, using identity server support for open ID connect would probably be probably what you wanna do. Fantastic. So just a couple of pictures, like this one to me is wonderful. It feels like I'm there. Yeah. Right? It feels like we're there. It feels like we're there. Yeah, it's wonderful. It's wild. And another one of course, Jeremy. Wow, looking sharp. If you follow him, you'll find he did another picture of me, but not as flattering as this one. Jeremy, you gotta get my good side, buddy. Now for more. For more Blazor jackets. For more important questions, obviously, can this be integrated with an existing .NET Framework project? If so, how? Be a nuke it? That's a great question. Could you use Blazor with a .NET Framework app? I mean, Blazor server obviously not because Blazor server is running on ASPnit core. Like it's using the signal our support in ASPnit core. So no, with .NET Core 3.0, you can't run that on a .NET Framework app. Blazor WebAssembly is just static files. So it doesn't really care what is on the server. It could be actually PHP or whatever on the server. So technically, I guess you could use .NET Framework on the server with a Blazor WebAssembly app, but it's really been optimized and integrated with .NET Core. So like the full stack experience that we imagine for Blazor WebAssembly is you have .NET Core on the server, Blazor WebAssembly on the client, and we provide you all the nice integration points there. That's how we mostly imagine it being used, but technically, it should be doable. And here's like a super awesome question. Mika, what does it say? Yeah, is that Blazor's future of web development? Is Blazor the future of web development? Is it the future of web development? Oh, no, I'm not trying to put it on your spot. It's just wearing the jacket and you have a pillow with your face on it. Right, Blazor. Whatever you say is super authoritative when it comes to the future of web development. It absolutely is. For many, many web developers, is it going to be the only way that people write web apps going forward? Like some people ask like, does this mean that no one will ever write JavaScript again? Like, no, that's not what Blazor is going to do. There will be lots of people still writing JavaScript. There'll be lots of people writing and all sorts of different technologies. What WebAssembly did is it actually opened up the door for really any platform you want to be used in the browser. So I imagine there'll be people using Python Go and Rust in the browser as well, but we are working really hard to make sure we have a great .NET full stack web development story. All right, so here's another one. And this is interesting to me because I remember when this was introduced, I saw Sanderson demo it to me. It was me, it was Damian Edwards and Fowler. And we just sat there like, holy cow, this is ridiculous. The first thing I thought was perf. Is this going to be the same as the other? So any stats that show performance comparison between ASP.NMVC web and Blazor? Yeah, so there's a couple of different comparisons that you could do there. First of all, it's not really an apples to apples comparison. And the reason is, like we talked about yesterday, Blazor is for your client web development needs. It doesn't replace MVC. It doesn't even do the same things that MVC and Razor pages do. Those are server render technologies that you use on the server. Blazor is meant to be used in the browser for a client web UI. So you don't even do, when you want to do a server rendering, you do that with MVC. You don't do that with Blazor at all. But there is some interesting perf characteristics of Blazor that are worth mentioning. The Blazor is based on a diffing algorithm where you render your components, it calculates a diff and applies it to the DOM. That diffing algorithm has been highly optimized to be very, very efficient. When you run it on WebAssembly, there are some known performance issues with any CPU intensive loads on our existing WebAssembly runtime right now. And that's because right now our .NET WebAssembly runtime is doing IL interpretation. And it doesn't have a jitter. It's just interpreting the IL on the fly. And that can be slower. We're working on that. We're working on supporting a head of time compilation to WebAssembly, which does give you back that native-like performance. We haven't had a preview of that yet, but we hope to have one as soon as we can, shortly. So that will hopefully address the performance problems of running a Blazor WebAssembly in the browser. When you're running on the server, you're running on .NET Core. It's super fast, no performance problems at all. All right. I think we have one more question. Yeah, we have time for one more, right? Yeah, we do. All right. Will Blazor support a per-raiser component server-side WebAssembly configuration in one spa? I don't know if I can parse that. Will Blazor support a per-raiser component server-side slash, that's like so many pieces here. That's why it's such a good question. I think, the way I choose to interpret this question. Nice. Nice. Well, you are wearing the jacket, so you can do whatever you want. I think what this is asking is, you could imagine maybe having a mixture of hosting models in the same app, where this component is going to run on WebAssembly, but that component's going to run on the server. Maybe for whatever reason, it makes sense to do that. We don't have a first-class way of doing that today. It is something that people have asked us about. Right now, you either pick one or the other. You're doing Blazor WebAssembly or you're doing Blazor server. It doesn't seem like there should be anything blocking it, though, because like I said, Blazor WebAssembly is just a bunch of static files. You could have a Blazor server app. You throw a bunch of Blazor WebAssembly files into its www root folder, and you can download those and use those. So it seems like you could get it to work. I haven't actually done it yet, though, and it's not an area we've really played around with. Maybe that's something that we'll look at going forward. Well, this has been amazing. We have coming up a short commercial break-in afterwards. No commercial. We're going to go directly to Jeff Holland, who's probably going to get us to think about servers less, his words. That is exactly right. What an amazing transition for the Blazor Power Hour that we're having this morning. I am Jeff Holland. I'm a principal PM on Azure Functions, working on Azure Serverless. And today we are going to continue the amazing conversation and very flashy conversation that Daniel had this morning with his Blazor and his pillow around Blazor, both server side and WebAssembly. We're actually going to apply that into a very common scenario, which is running Blazor and Azure Functions for serverless web apps. So to start with kind of what to expect for the next half hour, let's start by talking about what are serverless websites? What's some of the architectures that people are using? What are some of the benefits of why people would look into doing this? Where Blazor fits into the story? Where Azure Functions fits into the story? We're going to talk about how you deal with things like domains and delivery of that content. And then finally, we'll have some time for questions and answers. So to start with, when we look at a traditional web architecture, like the kind of web app that you probably built before has been kind of the one often talked about is a three tiered web application. It works a lot like this, where you have a client who's got their browser and they make a request to some website. In this case, I've got a cool hip.dev domain. So let's say I want to call jeff.holland.dev. That's the website I want to go to. Well, the browser makes that request, that request travels across the internet, it ends up landing on some server. And that server is running some code, right? Maybe this is an ASP.net app. Maybe it's a Node app running Express. It doesn't really matter. It's just the architecture I want you to be aware of. So it's gonna land on that server and that server is going to process the request. Maybe it has some things like razor files or CSHTML. It's got some assets and images. And the server is going to render in index.html page and it's gonna return that page back to the browser and the browser pretty much just paints it for you. So this is the traditional web architecture. You've got your browser, you have a server that's running some code, maybe talking to a database behind the scenes. And this is a fine architecture, but it does have some limitations. One of the limitations is that I need a server there. So in this case, I have a website, jeff.holland.dev, right? That might be my personal website. I'm not a super popular guy. I don't really need a server running 24-7 to process those requests. But in this architecture, I need to have a server running all of the time, ready to process those requests. So I'm paying maybe some, whatever, a dozen, couple of 20, 30, $40 a month on a website that's maybe only getting a few hits a week. But on the other side of it, maybe I actually have some traffic that is incredible load, right? Maybe I actually need to scale out. And with this three tiered architecture, I have to scale out all of these servers because as I get all these browsers that are coming, I have thousands of browsers that all need their rendered version of an index.html page and they need that to be processed in the server, returned back. So I also have to now scale these large servers which can be a cumbersome process when I need to then serve this for high traffic, right? So now let's talk a little bit about a serverless web app architecture and how you can write apps in a serverless way. It starts the same. You have a user and a browser and they say, hey, I wanna go to jeff.holland.dev. But in this case, instead of hitting a server, they just hit some files in storage. So it's like pulling directly from a storage account. You could almost think if I open OneDrive and I get a link and I email it to someone and they click that link, that's all I'm doing here. I'm just routing the request to say go pull in some files. So the storage account is going to return back in index.html page and some code that needs to be rendered on the browser. So in this case, since there's no server that's rendering the page, what I'm actually relying on is the browser to render that page for me. So all of the code, all of the logic to draw the elements to update the elements now actually needs to run on my browser because I don't have a server behind the scenes. I just have this storage account with static assets. Now, this is a popular architecture because in many ways it's a lot less expensive, right? I'm not paying for a server. I just need files in a storage account. I can also just have the browser do all the processing for scale out situations. It's very nice too. But one of the challenges with this architecture in the past is that really it was JavaScript users who were able to benefit from this architecture because JavaScript had frameworks like React and View and Angular that you could do this rich native rendering on the browser. You couldn't run .NET in the browser. But as we've talked about already a lot today in this week, you can now run .NET in the browser. You can have the same architecture but have it be .NET code that's rendering an edge or Chrome or Firefox. And this is all made possible because of this amazing technology of Blazor and WebAssembly, right? So WebAssembly is like an underlying universal technology that lets you run compiled binary code from a browser in a safe way. Blazor is the .NET implementation a part of .NET Core 3. So now .NET developers can build these serverless web architectures too. You mentioned here it might look a little something like this. And in the case of I do need to call a database while I could write Blazor code that connects to something like SQL or Cosmos DB directly that makes me feel a little bit antsy to be thinking about all these browsers making a direct connection to my database. So the other pattern that we often see in these serverless web apps is that when you do need some code that runs server side like a database connection or anything to deal with data really you can call an Azure function. And these Azure functions are serverless so you're only paying when an execution is actually happening you still get this amazing scale so you get a lot of the cost benefits and the scale benefits but you can still have some code running in the cloud. And what's nice about Blazor and Azure functions that I love is I can now write .NET code running in my function. I can run .NET code running on the browser it's .NET across the board, right? Even if I need to pass maybe a class or an object from the browser to an Azure function I can use the same class file in both spots I can share code between the server and the client. This is really nice and it also gives me benefits that when I need to scale let's say a million people go to jeff.holand.dev all of you watching now are like, hey what is that jeff.holand.dev maybe you're poking around it right now. My functions just scale automatically and my storage account is super elastic and how it can scale as well. And what's nice here is that while I might need thousands of rendered index.html page all of the compute, all of the processing to actually render those pages is all happening on the browsers, right? I'm kind of taking advantage of all the users, computers I'm making them do the hard work their smartphones, their laptops, their desktops are all rendering the page and it's just up to me to make sure that I'm serving that static content. So it's a super appealing scenario this is how I personally run my website or jeff.holand.dev because I pay pennies a month for this thing I get amazing scale and I'm running .NET in the browser and .NET in the server as well. So I wanna take some time now and demo this to let you know how you can get started building something like this. So the first one to note I have .NET Core 3 already on my machine and to start using Blazor I just wanna make sure I've installed the Blazor templates. So here at docs.microsoft.com I have templates for Blazor right here that I can install in and be ready to go. And once that's there I can create a new project. So let's start with the client side let's create a new Blazor client side web assembly app. So I have here a folder already ready to go and I can just say .NET new and I'm gonna use the template Blazor web assembly or Blazor that's gonna run in the browser, right? So I go ahead and push to create it's using the template to create a Blazor web assembly app and let's go ahead and open this up in visual studio code now so that you can see what this app looks like and some of the stuff that it scaffolded for us, okay? So this is pretty familiar you probably already saw this in some earlier demos this week as well I have things like my startup file which it feels very familiar to me program.cs I'm able to inject in some different builder and configuration aspects I have here some different pages these are razor pages in these case these are razor pages that are gonna render in the client the index.html page is pretty boring it's just some HTML the counter examples a little bit more interesting because here I have some code and it's gonna increment a counter using current count plus plus and then finally the fetch data example is fetching some data from an external source my favorite line of code in all of this template too is this line right here and I don't know why but just the fact that I'm using HTTP client and I know that my good old buddy HTTP client is gonna be the thing making this request from my browser in my case using edge on Mac just tickles me I love it I love HTTP client I love the fact that I can use it in the browser so here I have some code some basic pages here if I want to as well like let's go ahead and just test this out without even making any changes I can just say dot net run it's gonna compile this blazer template in this case it's gonna compile it along with some web assembly kind of artifacts so that it knows how to run cleanly in a browser and in just a second here it should expose for us a local host that we can actually browse and start to navigate to so right here local host 5000 if I open that up here now is this C sharp app knows code server side it's not even doing code locally it's just compiled it and handed over to my browser and my browser is now doing all of the work here through web assembly okay so now let's talk about how we can start to call some data from an external source right in my case I said sometimes you might have a database something like Cosmos DB or SQL that I don't wanna call directly from my web assembly app so here let's add in some function information so since we're already at the blazer side I'm gonna start by creating the blazer aspects to call a function so let's add a new page here let's call it my function dot razor page and here I'm gonna type faster than a speeding bullet and paste in some code I wrote before that says hey I have a new page here called functions I'm gonna get my handy dandy HTTP clients that tickles me as I mentioned before and here when I'm trying to initialize the page you'll notice I'm actually calling an Azure function now in this case it's calling a function that would be running in the cloud if I'm debugging this locally I could change this to local host and actually call a function that's running on my box and then it actually even has some information here so while it's waiting for the function to respond it's gonna say loading and then once I get back my message from the function it will automatically populate the message so it's gonna be dynamic as well and wait for those responses so here I can call that function let's just go ahead into the navigation menu as well and I wanna make sure that there's a way to navigate to this new page so I'm gonna type that very quickly as well too right so now I have what could be some code to call a function what about my function where's the function that I can call and that's super easy to set up as well let's go ahead here and open up another empty folder called function app I'll just create a new window for VS Code I could add these to the same workspace now here in Visual Studio Code I've installed the Azure Functions extension now I could do this from Visual Studio 2019 as well but since I'm already in VS Code I'm just gonna stick with it let's just go ahead and create a brand new function project using that function extension and as I mentioned what I love about Blazor is that I actually wanna write C-Sharp client side and C-Sharp server side or server list side so let's go ahead and choose C-Sharp as our language these are APIs so they're gonna be triggered by HTTP requests I wanna call this my hello function and I can give it the name space and with that VS Code is now scaffolding for me a Azure Functions project that I could use to run all my code in this case server side so here this is the default template it's pretty boring right it's just saying hey get a request look at the query parameter see if they passed in their name and then say hello to their name I could add in here you know connect to Cosmos DB do a query on SQL return the results in my case though let's just even simplify this a little bit and we're just gonna say return new okay object result and we'll just say hello world okay so here now is my Azure Function when I'm ready to go I could debug this locally I could now publish this to the cloud so I can say actually want this code to be running in Azure so it can be called whenever I need to right so I have a function already here called j-haul and Blazor which is the function that I could publish this to or create a new one and so now this code can be available to run in the cloud right at the URL that I decide so if I actually switch back over here you'll notice I've already published this same app ahead of time at j-haul and Blazor and I've said slash hello so let's go ahead and test this out now now that we've actually added some more custom code we'll do the same thing dot net run it's gonna compile this app create the web assembly bridge pass all those static content files over to my browser in just a second and here if we now open up localhost 5000 again same data before but you'll notice here's my new Azure Functions tab and when I click this you'll notice it says loading for a second if you caught it it said loading while it was making that call and then as soon as it got the call back it says the message is hello right so it called that function the function to turn some data in this case it was just a string but I could very easily replace this with data from SQL as well so for the last part of this I wanna show now that I have this running locally how do I get it so that it could actually be accessed from somewhere that's not localhost 5000 right I mentioned before this needs to be in a storage account so how do I go actually get this into a storage account this is actually my favorite part of this entire demo because it could not be easier so I'm in Visual Studio Code already I mentioned before that I have the Azure Functions extension already installed let me show you one other not tasks sorry let me show you one other extension that I have installed I have a lot of extensions because I love VS Code in addition to the Azure Functions extension I have the Azure Storage extension which will let Visual Studio Code know how to talk to a storage account and with this extension I can actually get a one-click publish to a storage account so first I need to generate the bits that I need to publish right so right now I've just been debugging how do I actually generate the static content that I need to upload to the storage account so if you're familiar with the .NET CLI this next command I run is going to be very familiar it's really just .NET publish I'm saying publish me a release this isn't for debugging anymore I'm going to define my own output folder in this case just use the publish folder I could use the default if I wanted to and when I run that it's going to compile my app as well it's going to create a release profile for it and it's going to stick it in this folder I just defined called publish so if I come here once this is done compiling you'll notice I have a new folder called publish and I open up publish it's got all of my bits here now you might be wondering what are the files that I need to copy to my storage account there's some web config there's some DLLs here the answer is right here do you see this dist folder for like distribution this is the folder that I want to copy and paste into a storage account you'll notice here's the index.html page this is kind of the static content it's going to return it's a pretty boring page it just pretty much says load up all the amazing web assembly stuff I've got some framework things here which have all my web assembly bits my bin folder which has my DLLs so this dist folder is the one that I need to get into a storage account and I mentioned this was my favorite part of the demo because check this out I'm going to right click this folder and because I have that azure storage extension in VS Code I have this one click gesture right here which is deploy to static website now really all it's doing is it's just going to copy this folder and copy it into an azure storage account for me and it's going to configure the azure storage account so that it can serve web content so I could do this manually I could do it through azure dev ops if I wanted to but for getting started I really like to just say you know what deploy a static website here it's going to ask me to either create a new storage account or select an existing one I already have a storage account called jholland website so I'll just say you know what publish to that one and let's go ahead and tell it to deploy and you'll notice here it's saying copying over those 49 files into the web folder of this storage account so as it copies those files over it just takes a second now all those files have been copied and here I can now go to jhollandwebsite.z5.web.core.windows.net that's super easy to fit on a business card but I can browse to that and here I'm just hitting that storage account and the storage account now has returned to me back all this static content that I've been able to render into this blazer page so this is no longer localhost 5000 this is now my storage account running in the cloud in fact if I come over here to my storage account I can even open up this storage account there's no magic here let's use the storage explorer preview and here in my azure storage account this is just that disk folder right so all I'm pointing to is that I've configured this storage account to do I'll show you all the settings here static website hosting so I've turned this on which gives me a nice end point and then Visual Studio Code went and copied all my files into this folder that it creates for web hosting and all that's happening is my browser makes a request to this domain and my storage account returns back this index to HTML that it can use to render the page right so no server anymore, just storage now the last thing I want to talk about again I'm not in localhost anymore but I'm not really at a nice domain right I'm at jhollandwebsite.z5.web.core.windows.net and all of you can browse to this and it will work but it's not the kind of website I want for a blog right if you remember the one I actually wanted was jeff.holland.dev is the actual webpage I wanted right and you'll notice here when I go to that I actually do have jeff.holland.dev set up calling my azure function and it even has a beautiful certificate so that it's HTTPS enabled so the last thing I want to talk about is how did I pull that part off right how did I actually get the storage account to be able to use with a custom domain like holland.dev or jeff.holland.dev so the other aspect here if you're gonna go set this up for yourself and there's some great docs and samples as well is that in Azure I have a few resources that are helping me out for one I've hosted my DNS records inside of Azure so I have holland.dev it's a registered domain in my Azure account and I've actually told it and I apologize my zoom here is a little bit aggressive as I've been zooming in and out I've actually told it that when I go to holland.dev I've configured this to route to azure front door so azure front door is a CDN++ service for azure I could also serve this directly from a CDN but I like azure front door for a few features that it provides I've even had some other C names here too so I can go to jeff.holland.dev or functions.holland.dev which will call my functions so I have some DNS here and then I mentioned the azure front door this is the thing that gives me custom domains so at my azure front door which is kind of the delivery network resource I've told it to serve resources for requests to holland.dev to jeff.holland.dev to functions.holland.dev I've set up some routing rules here so that it will redirect always to HTTPS front door gives me free certificates I've also redirected it so if you just go to holland.dev it's gonna reroute you to jeff.holland.dev because I'm vain and I want my full name in the URL and not just my last name so there's a few other helper resources that if you're starting to build these architectures again that resource group I was showing you here this is all I needed so I have my function app I have my DNS records I have my azure front door I have application insights to monitor the health that's really everything that I need to get started in hosting my new blazer apps so hopefully you get a sense for how you can get started using tools like Visual Studio Visual Studio Code create a serverless blazer app and while this is fun for things like blogs maybe we're all finished too is we also see people using this for bigger scenarios right so one of the things I'll leave this page up here on learning more one of the cool scenarios we ran into actually about a year ago is we had a large retailer who was running a massive promotion they need to be able to serve like 10,000 requests a second because they're gonna be giving a huge huge deal and they were worried because their website traditionally was this massive WordPress site and they're like, it's really hard for us to scale that out to handle 10,000 requests a second so what they did is they took just the page that was gonna be hit with the promotion they made that page into this serverless web architecture where they had azure CDN, they had storage they had functions, this was before blazer so they were using JavaScript but the world still lives the same like the true third there but they were able to run this massive promotion this page scaled incredibly elastically the only paid for the number of hits that it had and the rest of the site could go be happy as a WordPress site so this is a really interesting pattern to be aware of I'd encourage you to try it out for your own blogs or even if you wanna try aspects of your website as a serverless web architecture as I mentioned if you wanna learn more about blazer check out blazer.net there's templates and getting started docs there functions, pair great with it for the server code so azure.com slash functions and thank you all very much for joining we'll see now set if we have any questions that have come in along the way we do actually have some questions I'm glad by the way well done thank you I'm always impressed this dude's such a good presenter let's start with this are you ready no matter what you use with azure functions is still one of the coolest and most amazing texts I just wanted to la one I was gonna say I was gonna say is this my own tweet that I tweet some adding blazer to it levels up the cool factor it's good to be cool you know every once in a while at least it was for me that one time now here's a serious one because I wanted to lob one to you and now it's a little bit harder one Jeff Holland doesn't infinite scalability also mean infinite cost ah that's a fantastic question it can mean infinite cost so one of the things with functions that is fantastic is that you can scale per request but there's a term in you here on the serverless sometimes called a denial of wallet attack where if you just hit this if someone actually did a DDoS right now on jeff.holand.dev you might rack up my bill a lot so one of the things that we allow today only in some of our more premium tears for azure functions but as a way to kind of set caps so that you can be like look I wanna have this be serverless but I never wanna be paying more than whatever $500 a month so something to be aware of things like API management are also paired off with functions so that you can do things like rate limiting and throttles so it can mean infinite cost even then it's whatever 0.00054 cents per request but it is something to be aware of yeah but if you're racking up that many calls your website is probably racking in more for you right you better put some ads on that page alright so last question when will .NET Core 3.0 be supported in azure functions yeah this is something we're really excited about so we actually made an announcement on GitHub about two weeks ago in October so in a few weeks we'll have a preview of writing azure functions in .NET Core 3.0 it'll become generally available around quarter one of next year so keep an eye out for where you can start using that where we'll rewrite our entire host and let you write code that takes full advantage of .NET Core 3.0 in azure functions as well so I said that was the last question but I lied because people are putting them in questions are important a question about this tutorial will this tutorial be available for people to look at yes so right now it's scattered in a few docs I'm actually working right now with the learn team to try to turn this into an actual step-by-step tutorial so there's a few docs both on the blazer page that talk about static hosting and the azure storage page that talk about this obviously it's a recording I kind of did everything step-by-step so it is there it's more scattered than I'd like it to be so one of the things we're doing before ignite is turning this tutorial into an actual module that people can follow step-by-step so for me like I did an azure function the other day and I thought of you the whole time and I even wrote it in Python whoa it was super cool and all in visual studio code but one of the questions that I have and my friend here J-Paul also has is how authentication and authorization will work in blazer and azure functions in general yeah so Daniel mentioned this a bit before azure functions has a few features out of the box help with authentication there's something called app service authentication that can automatically do like azure active directory validation generally what we see in these types of scenarios is kind of the o-off type flow where the client makes a call it generates a token and it just passes that token along to the function and then it's up to either the function itself in code or as I mentioned some features like app service authentication or API management that can do the validation outside of your code so definitely look at o-off tokens and that o-off flow and there's even some wonderful .NET libraries to make that even easier that's the pattern I would recommend here's another question can HTTPS server for azure storage be configured to be case insensitive do you know that one? I thought it was I mean I thought if I type in capital jeff.holland.dev which is how I type it in it still gave me HTTPS so I don't know maybe there's a gap here if there is just send me a tweet directly and I'll make sure to pass it along fantastic so for those and I know you probably mentioned this and I just sort of on the slide mentioned Python what languages can you write these serverless functions in? So C sharp, F sharp, PowerShell What? Python, Java and JavaScript Did Jeffery snowboard like show up one day? He says that he writes PowerShell functions and he says the same thing he thinks about me the whole time when he writes them so I hope all of you whenever you're writing a function and you're happy or sad keep me in your mind I'll help where I can Fantastic thanks so much Jeff and by the way all of you get your questions in as early as possible if you think of it during the session just put it in just a couple of stats before we go to my good colleague the people that have been watching the most minutes happened to be Trinidad and Tobago 265.28 minutes on average and I'm wondering who's that one person that's like I think I'll watch for .28 minutes probably me and now without further ado we have here my colleague Zach about talking about DevOps for the .NET engineer let's go to him Hey everybody my name is Zachary Deptawa I'm a cloud advocate for Microsoft and I'm excited to be here today I'm talking about DevOps for .NET Core Devs so let's just jump in so what is DevOps we've we've often thought you know do we actually need DevOps is it a question of you know is this something that we should even be focusing on now or in the near future well we know now that you absolutely need DevOps it's critical for businesses to innovate at the speed necessary in today's world and if you ask people you know what is DevOps if you ask five people you'll probably get 10 different answers and so I can tell you what Microsoft's view of DevOps is DevOps is the union of people process and products to enable continuous delivery of value to our end users and notice I didn't say continuously deliver code I said continuously deliver value because if I just continuously deliver code I can push it up in a source control but I end up with a mountain of code somewhere unless it's delivering value it's not really worth worth anything so why is DevOps important this is a this is a big one so if you're not currently using DevOps best best practices I can guarantee you your competitors either are or they're going to be very very soon and so what that means is your competitor will be able to out innovate you they'll be able to do things at a much quicker pace than you can and that might make you obsolete and nobody wants to be obsolete believe me alright so we always thought about this DevOps thing right we've we've got some manual processes we're going to start to automate them things are feeling good you know it's it's kind of a theory right now let's get things going but now we have actual data we can see the empirical data that says that DevOps companies that use DevOps actually innovate much faster than companies that don't use DevOps and it's not just by a little bit it's by a lot and so when we think of DevOps at Microsoft there's really three pillars that you need to pay attention to and number one being people number two being process number three being products and we'll dive into those a little bit here so admittedly the hardest part of all of this of adopting DevOps best practices in my opinion is the people and people they're averse to change but not only that you have to have this idea of continuously delivering value to your end users from the very top of your organization to the very bottom everybody has to be in line saying yes we want to continuously deliver this value to our end users and that's really going to be the hardest part is making that that shift the process now that's a little bit easier because really all the processes is finding something inside of your organization inside of your team that works for you that allows you to innovate quickly but also allows you to maintain a high quality of a high standard of quality for your application so that's probably the easiest of all three of these and now let's talk about the products so this is where you're going to find things that will help you use the DevOps best practices and methodologies you need products that will help you plan and track things like work items, bugs, impediments you need things that are going to allow your developers to push and pull from source control but not only that that will tie back to that planning and tracking so you can see where your work is actually making an impact and you also need something that's going to bundle up your code for you automatically so your dev should be able to push their code for testing and have something fire off that's going to bundle that up and push it out into a testing environment for you right away and after you have everything into production it doesn't stop there because you need to monitor and watch what's actually happening inside of your application you need to know is your application up is your application down how are the response times within your application and you need to be able to see what your users are actually doing inside of your application I don't know how many times I've talked to clients that say we built this app to do this thing but our customers are using it in a much different way than we thought that they were going to use it so what that data allows you to do is you can look and say yes we're absolutely delivering value and that's great now we can double down on this and we can move forward in our next sprint and do way more cool things for our end users that will deliver value and if you're not delivering value that's awesome too you see that data so you can pivot and make sure you deliver value on the next sprint so all of these things right there's a ton of tools that can do all of these things and these are all great tools you can pick and choose these tools that will fit what you're doing you have to make sure these tools can communicate you have to make sure that there is no problem with that communication you have to make sure that it's set up accordingly and they work great or you could replace all of these things with something like Azure DevOps service you can target any language targeting any platform using Azure DevOps and that's what we're going to talk about today so what is Azure DevOps? well at a high level it's a suite of five products Azure boards being the work item task tracking management you can track bugs impediments, features, things like that Azure Pipelines being the Git repository system for private Git repos inside of Azure I'm sorry Azure Pipelines being the CICD the CICD portion this is the build and the release portion this is the automation Azure repos being the private Git repository portion Azure Test Plans is the testing infrastructure inside of Azure DevOps and Azure Artifacts is the artifact repository inside of Azure DevOps and so that's great that's a ton of talking I got it out of the way as quick as I could let's jump into a demo and see this in action so what you're looking at here this is a .NET Core app that I have deployed it's an actual app that's running you can actually go to that if you want to but what it's doing this is an app that simply tracks my exercise and it tracks my nutrition for me but what I noticed actually what my co-worker Abel noticed is that for some reason we're tracking the color of our food and honestly I don't we don't care about what the color of the food is we just care about the important information so we have this board here inside of Azure DevOps this is our .NET Conf demo project and this is our board and you can see our tracking here we have in sprint swim lane we have a super duper important swim lane and you can see we have a bug here for food tracking should not track color so this is really awesome I'm actually hosting the code inside of Azure repos here so what I can do I can click this little button here create a new branch I'm gonna call this food color tracking if I can spell there we go and it's gonna be based on the .NET Conf demo repository and the master branch and what's really awesome is because I built it from that work item from that bug it actually links right to it so I'm gonna create this branch and it's going to link from my work item to that branch so now on this branch that work item is there so now I have a new branch food color tracking let me drop over to PowerShell and this is just normal get stuff that I'm gonna be doing I'm gonna do a get pull because I just created a new branch I'll do a get oh if I can spell oh my goodness okay check out and let's oh not that okay yet I can't spell today okay there we go now we're back on track I checked out the food color tracking branch and so now that I have that checked out let's actually go edit the code so I don't care about this color field in my database I'm gonna delete it inside my SQL file here and I'm gonna save that I need to comment some stuff out here really quickly I don't need these things okay and I'm also going to comment out here as well let's get this commented out that's not necessary all right so now that I've made these changes I'm gonna save this if I go back over to my PowerShell I see that I've changed those three files so I'm gonna do normal commands a get add I'm gonna do a get commit dash M and this is just gonna set a commit message for these changes food color tracking removed and I'll do a get push so what this is doing is I'm actually pushing the code that I just changed into my food color tracking branch into Azure DevOps repos so now if I go back over to my repository and I refresh Azure DevOps the repos it actually saw that I updated my food color tracking branch and it says hey you just updated this do you wanna create a pull request well if I wasn't done with my work I wouldn't create a pull request but I am done this is all the work that I need to do so I'm gonna click create a pull request it pops it up for me automatically I'm gonna be merging food color tracking branch into master that's great the title and description are pulled from my commit message and you can see that my food tracking should not track color bug is actually attached to this pull request I didn't have to do anything and you can see my changes here that I made everything looks good let's create this pull request and boom I've got a pull request I can check out the files here and take a look but not only that I can make comments I can say inline this is the best code I've ever seen which is totally true I can hit comment there's the comment inline and now if everything looks good I can go ahead and approve this now in the wild you probably don't want to approve your own pull request but for the purposes of this demo I am so what's really awesome is inside of Azure DevOps I have a build and release pipeline and I have it set for continuous integration you can see this little blue here that means that it saw that I made a change in my master branch and it kicked off my build automatically for me and this is happening in real time we're actually watching these tasks run in real time but even after the fact I can drill in and get a look at what happened if I need to if I need to go back for troubleshooting or just want to see what happened while this is running though let's take a look at what a build is actually comprised of inside of Azure DevOps all right here we go so this is a build you can see that we're getting the source this source we're pulling from the Azure repo that I have .NET Comp demo from the master branch I could pull it from another source if I wanted to and also this is an agent-based task runner so what's happening is I'm running tasks on an agent these are the tasks that I'm running but what's really cool is you can use a hosted agent that's hosted inside of Azure or you can run an agent anywhere you want to run it I'm actually running my agent on my demo server and that's just something that you can do if you'd like to do that but you can see because this is an ASP.NET Core app I'm using NuGet building the solution testing my assemblies copying my DAC pack and I'm going to publish this to an artifact and this artifact is what will be used in the release and you can see my build finished so let's go ahead and take a look at this artifact real quick so now that the build finished here's the artifact I've called it drop and you can see I've got my DAC pack and I've got my webapp.zip I've got everything that I need for my release but not only that because I have continuous integration and continuous delivery set up here it's already kicked off my build into my development environment and that is so powerful I didn't have to do anything besides make that pull request and merge it so let's take a look at releases real quick so the way that I view releases you can set up stages and such that you have one for each environment so I have a development environment a staging environment a production environment but you could do this in any manner that you want to if you have a different way that you like to set that up you can also have stages that run in parallel with each other if you need that you can see that we're using the artifact that was built and also I can drill in here and just like my build I can watch this happen real time or go back and look at the logs if I need to while this release is happening though let's take a look at how a release is created and how a release is set up so you can see that each stage has jobs and tasks and for each of my stages they all look the same but it's the same kind of setup for my build so this is a task runner that runs on an agent it can be hosted in Azure again or it can be hosted on an agent on a server like I have here for my demo but I'm deploying my Azure app service deploying my database and running Selenium and that's the gist of my releases let's take a look and see where we are okay so my release finished to development but you notice it's blue here it's not green it's kind of weird right let's take a look at what's going on so I set up a post deployment approver required so now that this has kicked off it's done my development deployment I have an approver that's required to say yes everything looks good I've tested it out let's go ahead and roll over to our staging environment so I'm an approver so I'm gonna go ahead and approve this I can say looks good to me approve I could also reject if I wanted to but everything looks good so theoretically that should have kicked off my build right let's take a look I mean I'm sorry am I released to staging but it looks like it's hung again so what's going on here ah I set up a pre deployment approver as well so yes someone that looked at development made sure everything was fine they were able to approve that push it over to staging but now someone from staging needs to go and take a look before it blasts that code into my staging environment so whoever is managing that environment can go and say everything looks good but not only that if everything looks good they can also defer the deployment for later so say somebody like me decides I want to push code at 5pm on a Friday which is not the best idea well it can roll out to development I can even accept that in my post approver acceptance here but it won't blast into another environment until somebody from that environment can take ownership and accept it so that's really awesome I'm just going to go ahead and approve this though and now it's in progress and it's rolling into my staging environment so you can also set this up to where it's manual only you don't have to do an automatic release if you don't want to but that's just how I have this configured so this is all really cool but I want to show you kind of a neat trick here and actually you know what let's make sure before I do this let's make sure that my changes are working there we go the color field is gone so my changes look good not only do my changes look alright but if I go back to my boards that bug that I was tracking that I opened this branch for because the branch closed and in that pull request it actually resolved this bug for me I didn't have to come here and do any of this it just moved it right on over so that's awesome and it's also tracking that if I drill down into this bug you can see that it actually tracks what happened with this work item and so now that looks all great but let me show you something awesome so I'm just inside my Azure portal here and I'm going to click create a resource and I can click on DevOps project now what this does is this actually scaffolds out an entire DevOps an Azure DevOps project for you so you can see all the different languages here that we have built in you can bring your own code if you'd like to I'm going to click .NET and ASP.NET Core I'll add a database let's go ahead and use Windows web app and let's name this .NET com demo nine we'll go ahead and choose an organization that I have access to and I can change the location here let's go ahead and put this in East US there's also some additional settings that I can set I can change where my application insights are and I can change where my database lives as well I'm going to put them all in East US just because and here we go I can click done and now what this is doing is super powerful this is actually building out my Azure DevOps project for me it's building out my repository it's building out my builds and my releases all for me and it's actually going to do a deployment now this takes a few minutes to set up because there are several moving pieces and it is doing a deployment but I have one that's pre-baked right here and so you can see when it's done building you have your CICD portion this is the DevOps portion on your left side you can see your Azure resources on the right side but what I find really cool is you can go into these and these are deep links into Azure DevOps so if I click here this will throw me right into Azure DevOps into this project and now I can see that it actually gave me an ARM template for what it deployed I can see my application here I can fork it I can clone it I can do all the things that you would normally do with a Git repository and that's awesome and I can see I can drill right into the build I can drill right into the release and I can also hit the application this is a live application this URL will work for you as well it's just a demo application so it's nothing robust but it is an application nonetheless so something else that I want to mention that's really cool you can build this scaffolding right using a DevOps project inside of the Azure portal but once you have that built this is an ASP.NET app that's all it is so I can go in here and take all this code out of my repository push up my ASP.NET core app and have it deploy automatically to my testing environment and that gives me a quick and easy way to test this without having to set up all the bits and pieces myself not only that if you don't want to mess with this repository you can actually go to your builds here and this is just a normal just like the other build that I showed you as a hosted task runner and my sources are right here so I can change the source here that my build is actually pulling from if I want to so you can set this up you can change out your source or you can just change out the information in your repository and you are instantly or almost instantly working with a fully DevOps project and so that's really powerful I implore you to go check that out and try it out but yeah so my work here is done let's go back to this and that's all I have for you if you want to connect with me I'm on Twitter I'm a cloud advocate like I mentioned and I'm at ZDepTowa and here's some good links if you want to take a screenshot of this or a picture of this make sure to follow at azuredevops for the latest information and that's it thank you so much hey awesome wow that was great thank you so much so we have some questions here on Twitter let's see which ones we have alright let's see oh look someone already here is actually like already using it so that's pretty sweet nice yeah and let's see here we have a question why azure repos and not github like I guess what are the pros and cons between the two in your opinion yeah so with azure repos it is it's using the get protocol so you can you can actually host on github github if you want to and you can use it as your source so you don't have to host inside of azure repos but if you are using azure devops you are linking into all of your active directory configuration if you have that that might make things a little bit easier but it's really up to you we don't want to force you to use azure repos we want you to use what is best for you basically sweet alright and then we have another question here hey Zach how can you tell in a pull request that inline comments have been made hmm let me take a look at that let's go back to my pull request that's something that I haven't actually looked at but it should show you let me see oh I'm on the wrong build here it should actually show you here in the pull request if I can get to that here we go so I'm opening up this pull request and you can actually see this little icon here it tells me that I have an inline comment and you can see that comment right here oh awesome okay great yeah and we have another question here any plans of adding features to enable azure boards to be used as a help desk ticketing system hmm so for like external party access interface to raise tickets built-in automated ticket creation via email or other sources I honestly I'm not sure that that's a question that's best posed for the the product team and I can take actually take this question back and figure that out and get back to you so that's that's no problem alright awesome yeah definitely let's see there's a lot of questions here let's see this one can we specify the version number of the release on azure devops or should we modify the CS Proj and something similar for release notes so this I'm actually not sure of to be completely honest I'm brand new to ASP.net stuff but I've been given permission to say reach out to Abel Wang it's Abel Squidhead on Twitter he can actually give you it's a great name yeah he can give you all the information Abel's an awesome guy who works for Microsoft as well okay sweet and oh look at this right here we have some people watching from Germany so that's pretty awesome and let's see what else we have let's see let's see here alright here's another it's another .net question but aside from writing custom text you know of a way to loop over a set of tasks during your deployment so deploy to several servers and for each server copy file stop an old version start new version yes you know the answer to that one yeah for sure so if you're going to deploy to several servers let me pull this up really quick because this is this is actually pretty cool we have this concept of deployment groups and I didn't get into this it's great for another video and there are actually videos that we've done on this before but you can create a deployment group that says here's my development or my production or whatever you want to call your deployment group you can build that out and you can create agents you put agents on your servers Windows or Linux that will allow you to deploy to those and you can deploy to them in parallel so two servers 10 servers 50 servers it doesn't matter you would want to use deployment groups for that okay sweet we have a couple more questions just real quick here's another one can I have an Azure DevOps deploy my Java artifacts to a Tomcat server yeah definitely and if if there's not a task that's already built I actually failed to mention that let me show that really quickly as well there's so much information and so many cool things you can do in here these tasks are just basically I mean they're just tasks these are first-party tasks that we built but you can add a task to your agent there are hundreds of built-in tasks that you can add but not only that if you can't find anything in here there's a marketplace with I think over like 1500 tasks but not only that it doesn't but yet wait there's more you can write your own task it's just no JS or PowerShell so yeah most definitely you can do that cool yeah and then any way to filter PRs by labels or tags I'm honestly not sure that's something that I'll have to check on and get back to you I imagine you can but I'll have to double check okay awesome so we're gonna go and use some commercials right now so thank you thanks again Zach thanks another clue for you this time from the folks at Nostas and they they say the answer dear developer is only two documents away start here and go where the clues lead you follow those clues find that secret password that secret passcode that you're looking for whisper your response to the .NET bot in the Visual Studio Twitch channel and you could be well on your way to the next step in our technical treasure hunt hello everyone and welcome to this series on ML.NET a machine learning framework for .NET developers my name is Pranav Rastogi and I'm a program manager on the .NET team focusing on making machine learning approachable to .NET developers in this series of videos we'll be looking in-depth at ML.NET let's start by understanding what is machine learning machine learning is all about programming the unprogrammable let's say in this case we want to write a function whether this picture is an image of a dog or not machine learning will help us figure out whether this image is a dog or a not some other examples of using machine learning are let's say I want to predict a price of a house a price of a house can depend on a variety of features such as how many rooms does the house have does the house have any special amenities like a pool how big is the yard and all these features will determine what the exact price of the house is now traditionally let's say we had to write a program to detect whether this is a dog or a not what we would have done is we would have looked at images of dogs and cats and we would have looked at certain characteristics like how large are the ears do they have a tongue how big the tongue is and we would write this program ourselves taking care of all the possibilities to figure out whether the image is of a dog or a cat or not these are some example images that I would have looked at to figure out how to make the program understand whether this image is a dog or a cat so I would be looking at cat pictures I'd be looking at dog pictures I'd be looking at different examples of all these images and trying to write a program by myself but with machine learning all of this becomes much more simpler machine learning allows a program to learn from a set of data to figure out what are all the characteristics of a particular problem so in this case what defines a dog what defines a cat the machine learning program we'll look at different images and see all right how big is the mouth how big is the tongue does it have claws does it have whiskers and as it trains on more and more data the machine learning program will become more smarter and smarter in terms of figuring out whether this image is of a dog or a cat or not and in the end what you would have is a program that you can call to figure out what type of animal is this so machine learning is really about programming the un- programmable what this allows to do is it allows you to write a function which trains on a set of data to figure out whether this picture is of a dog or a cat and the machine learning model that you get is trained on lots of these images where it learns about different features whether how big the mouth is whether the cat has claws or not whether the cat has whiskers and so you don't have to write all of these constructs yourself the machine learning program looks at all these images and learns and then it gives you a function which is a machine learning model that you can use in your application such advancement in machine learning has opened many possibilities where you can use machine learning to train machine learning models over data which is of different kinds you can train machine learning models to detect audio to recommend for example new music that you would like you can use machine learning on text based scenarios so you can do things like sentiment analysis sales forecasting movie recommendation anomaly detection you can use machine learning on images so you can classify images whether it's a cat or a dog you can detect objects in an image so you can effectively build a greater user experience for online cataloging and then machine learning can also be used to teach machines itself so they can be much more smarter in this video we looked at the basics of what is machine learning in the next video we will take a look at ml.net which is a framework for building machine learning models for dotnet developers hello everyone welcome to bringing big data analytics through patchy spark to dotnet I'm Bridget Murtaugh and I'm a program manager here at Microsoft on the dotnet team so let's start off with what is a patchy spark so big data means that there's an increasing volume velocity and variety of data so let's take for instance a factory there can be thousands of internet of things sensors in a factory each producing petabytes of data now while it's great to have that much data so we can understand how our factory is performing in ways to improve the equipment how can we actually process it all when we have that much and more than just that how can we process it all quickly and efficiently well welcome to the world of a patchy spark so what is a patchy spark a patchy spark is a general purpose distributed processing engine for analytics over large data sets typically terabytes or petabytes of data put a little bit more simply a patchy spark is a great tool we can use to analyze a large amount of data in a quick and easy to understand way so we don't have to be data science experts to understand or use it so there's quite a few different things that we can do with a patchy spark that are all super interesting and exciting but just to touch on a few of them one of them is spark sequel which means analyzing data that's structured in some way so maybe data from a csv or from a database there's also spark streaming which means analyzing data in real time as it's being produced so in our factory example it means analyzing data live as it's coming from those iot sensors so we can go and detect maybe if there's a malfunction in our data and we can go and address it right away there's also machine learning capabilities with a patchy spark so you can combine the powers of big data and ml to scale and to have faster more efficient training and prediction of machine learning algorithms so to understand how a patchy spark works there's only three main components that we really need to take a look at the first one is the driver so the driver consists of the user's program so for instance if you wrote a c-sharp console app that would be part of the driver the driver also consists of a spark session now what the spark session does is it takes that user's program so for instance it takes that c-sharp console app and it divides it into smaller pieces known as tasks now those tasks are divided amongst our second component which are the executors or the worker nodes and the executors or the workers are on something known as a cluster so each of those executors takes one small task so one small piece of our user's program and finishes executing it and the third component of our architecture is the cluster manager which helps with dividing up the tasks and allocating resources amongst our driver and our executors so how can I use a patchy spark it sounds super great super useful so how can I get started with it so there's quite a different there's different apis that we can use that are popular with spark and they're written in languages like Scala, Python, Java and R but up until this point there weren't any .NET APIs for spark so what if I wanted to use a patchy spark combined with my pre-existing .NET knowledge or extensive code base and business logic well we now have an awesome tool that we can all use and it's known as .NET for a patchy spark so .NET for a patchy spark is a free open source and cross-platform big data analytics framework it allows us to reuse the knowledge, skills and code we already have as .NET developers so anywhere that you maybe have an extensive C sharp or F sharp code base now you can go ahead and introduce big data analytics within it .NET for a patchy spark is also designed for high performance the overall goal for .NET for a patchy spark is to provide .NET developers a first-class experience when working with a patchy spark so we have had several customers express a lot of interest and actually see success with .NET for a patchy spark and one of them is the Microsoft search assistance and intelligence team who's working towards modernizing workspaces in office 365 their job is to work with different ML models on top of substrate data to infuse intelligence into office 365 products their data resides in ADLS and in turns gets fed into their models why they were looking towards .NET spark was because a lot of their business logic such as the different featurizers or tokenizers were all written in C sharp meaning it would be ideal to be able to use big data analytics still within the .NET ecosystem and so far their experience has been extremely promising, stable and they really love the vibrant open source big data analytics ecosystem within the .NET community the scale of their jobs has been about 50 terabytes so quite a bit of data and they've really started seeing success with it so now that we've seen a little bit about what .NET for a patchy spark is and why it's such an exciting new solution for us let's take a look at a few different scenarios that we can complete in some really exciting applications we can build using .NET for a patchy spark so one of the most fundamental big data apps is batch processing so what is batch processing or what is batch data batch data means that we're working with data that's already been stored so for instance we could be doing something called log processing which means looking at and gaining insights from logs from maybe a website or a server or a network of some sort so we can understand what actions our users are taking or what pages of our website are the most popular we can also do data warehousing which means taking in data maybe from a variety of different sources and then performing large scale analysis on it maybe that data is all stored in Azure Storage and then gaining different meaningful insights from it so in the example that we're going to be looking at today we're going to take a look at some GitHub projects data so you can see here in the snippet of that data that our projects data includes the URL of our projects the author a description what language it is things like that and we want to know on average how many forks does each language have and the number of times each project has been forked is represented by that column H there so let's go ahead and take a look at our first coding example with .NET for Apache Spark so I'm going to open up Visual Studio 2019 here and we can see here that I'm just dealing with a C-sharp console application that I've already created and I've already installed the Microsoft Spark NuGet package oh there it is cool and we can see that it's also installed because I have these great jar files over here in the solution explorer and at the top I'm using Microsoft Spark SQL and Microsoft Spark SQL functions because as I had mentioned Spark SQL helps us work with structured data so if I'm reading in GitHub projects data that data does have some sort of pattern or structure to it so I want to use Spark SQL so to start off with in my main method here the way that we start off any .NET for Apache Spark app is by creating a Spark session so that's what's dividing our program into the smaller tasks to be distributed amongst the executors so we can see I've created a Spark session called Spark and I went ahead and built the session and I just called my app GitHub and Spark Batch pretty appropriate name now after doing that the next step we typically want to do in our apps is to actually read in our data so I have our data stored in a CSV and we want to read that CSV into an object called a data frame so a data frame is going to be the basic object that we store our data in when we're working with structured data in Spark so if I open up this region here we can see that I'm working with a data frame here and I just called it ProjectsDF to stand for my projects data frame I go ahead and called the read method and then I also call schema which means that I'm working with whatever pattern my data has so for instance I know that my data has an ID column a URL and owner ID and I also know the type of data that's stored in there whether it's an int or a string or something like that and it's a rather long schema because I do have quite a few columns and then I can call .csv since I know that my data is stored in a comma separated values file and then another popular method that's good to use is .show which allows us to actually print that data frame to the screen so I continue on another popular step that we'll want to do when working with batch data is to do some data prep or data preparation and that means that we're kind of cleaning up our data so maybe if there's some null or missing values or if there's some extra values maybe like a few extra columns we don't need we can go ahead and remove those so that our data is easier to read and easier to work with so one of my first steps of data prep was working with the data frame and a functions and with that I chose to drop any values that are null so any role any rows that have missing or null values I chose to remove so that when I go and perform calculations later I'm not accidentally trying to perform calculations on a missing value also with my data prep I chose to drop a couple of columns that I don't think will be important for my final calculations so I dropped the ID the URL and the owner ID columns so after doing some data prep we can actually go ahead and perform the functionality that we wanted to which was finding on average which languages have been forked from the most often so the first thing I wanted to do was group my projects by language so what I've done here is I've created a new data frame that'll represent now my group to data and I called the group by method which allows me to choose which column of my data I want to organize by or to group by so I chose the language column and then whenever I do a group by I also need to call aggregate or this dot agg method and with aggregate it allows me to perform some sort of functionality across every row or every entry of my data so in my case I performed the average of the forked from column on each row of data so essentially I'm grouping by language and then finding on average how many times each language has been forked and then finally I don't want to just display my data as is I want to do one final step to make it a little easier to understand and read so I've chosen here to order my data frame in descending order so that way I have the top forked languages at the top of my data frame so I can see those first and then a final good step to do is to go ahead and stop our spark context so I went ahead and called spark.stop just to clean up resources and make sure everything finishes executing correctly okay so now I have a few steps here that I'll need to be able to build and run my program so one of the steps in working with the dotnet for Apache Spark app is to make sure that we have one of our environment variables set correctly so there is a dotnet assembly search paths variable and we'd want to make sure to set it to specifically my app so in this case batch and then the bin debug folder and then whatever version of net core app that you're using and then also one other thing you can check is the level of logging that you have in your output so I go ahead and open this up so there's a file called log4j.properties and here I've set the logging level or whatever is going to be output to my console to be the error level so rather than displaying maybe some extraneous warnings or info or debug messages I'm only going to display messages that are actually an error which will help make sure that my output isn't too confusing or crowded in my console so now it can actually be time to go ahead and build and run our program so fortunately I've already done that with for us here to save some time so I'm going to open up the terminal not that one that one will be later okay so here I moved into my batch directory using cd batch and then I just went ahead and built my project using .NET build we can see that build succeeded so now let's go ahead and see how we actually run a .NET for Apache Spark app we use something called spark submit or the spark submit command and at every time we use spark submit there's a few different components to it so we say spark dash submit and then we're also going to reference the .NET runner we're going to specifically reference one of those jar files in our case we're using Apache Spark version 2.4 and .NET for Apache Spark version 0.4.0 and then also we want to have a path to our apps DLL so it can actually build and run correctly so after running Spark submit let's see how our program did so first we're expecting just to see the data frame with our CSV data in it so just the raw github projects data so let's take a look all right so we can see it here we see that it has all the columns we expected but we can also see that the data is kind of overlapping with itself there's a few too many columns like updated at is all the way over here instead of continuing to the right and then there's also a lot of null and missing values so it seems like it was definitely a good idea to go ahead and do that data prep we did so if I scroll down now we can go ahead and look at our data prep result and so now this data frame is a lot easier to read and understand we can see the data doesn't overlap with itself and all the data actually exists there's no longer all those null values so it's a lot easier to work with so next we can go ahead and see the output of when we were trying to calculate the average number of times each language has been forked so let's take a look and so we can see we have a column here for language and we have a column here for the average number of times it's been forked and it all looks correct and we can see that it did sort in descending order because languages at the top have been forked on average more often than the languages down here and then it's also worth noting that for all of those data frames it's only showing the top 20 rows and so this is really useful because in case we're working with terabytes and petabytes of data we want we don't want to be stuck trying to show those data frames and then having it take forever or getting confused and too crowded on the console okay so we have successfully run our first .NET for Apache Spark app so let's go ahead and go back to our presentation already so we've already done that demo so let's move on to our next scenario which is combining machine learning with big data so when we combine machine learning with big data it means that we want to scale the training and prediction of machine learning algorithms one great framework we can use for the machine learning when we're combining ML with big data is ML.NET which is a free cross-platform open source machine learning framework in our example that we'll be looking at we're going to be performing sentiment analysis which means that if we're given a piece of text we want to determine if it represents something positive or something negative so in our case we're going to analyze a set of online reviews and we want to know which are positive and which are negative if we were given a review such as ilove.NET for Apache Spark that would be considered positive and we could maybe see either a true or a one depending if we're using a Boolean to represent positive or negative sentiment if we saw a statement like I hate running inefficient big data queries that would be considered a negative sentiment so let's go ahead and take a look at our sentiment analysis demo where we combined ml.NET and .NET for Apache Spark okay so I've opened up Visual Studio 2019 once again and in this case when I look at the NuGet packages I've installed I haven't only installed Microsoft Spark I've also installed Microsoft.ML which is the NuGet package we need to use ml.NET and then we can see at the top here I'm using statements both related to ml.NET and .NET for Apache Spark so we can see Microsoft.ML and .ML data we can also see Microsoft.Spark.SQL so if I scroll down here we can see that just like we had done in the batch example we start off by creating a Spark session for our program and I've just gone ahead and given my app a different name compared to the batch app next it's also going to be similar to our batch example since we are still technically working with batch data we're just taking it a step further by also performing machine learning so in our case we want to read our review data into a data frame so I have some Yelp reviews so I have it in a Yelp.csv file and I've also set a few options for my data frame here so for instance I know my data has a header and so the two different columns in my data which include the text and if it's a positive or negative review those columns are labeled so that's a header and I don't want Spark to treat that header as part of the data because it could throw off my results and then I just went ahead called show so I could see my raw review data as is before we go ahead and actually predict using ml.net so now it's time for the fun part where we can actually start combining machine learning with big data so how would we actually start calling the ml.net code so how we can do that is using something called a UDF or a user defined function and so UDFs are a popular solution so that we can perform some sort of function on let's say each row in our data frame so if I open this up here we can see that we create a new UDF by calling the UDF method and then register and within the angled brackets I have string to represent the input that I'm working with which is text or reviews and then boolean to represent what my output is going to be which is a truer false for negative or positive sentiment I've decided to call my UDF ml UDF and what I'm doing within this function is passing the text into a method called sentiment so we may be asking so what is the sentiment method where do we where do we create it what do we do within it so within sentiment if I scroll down here we can see that sentiment actually contains our machine learning code so the code that was generated from ml.net and I got this code and I actually also trained my sentiment analysis ml.net model by using something called model builder so model builder is a really useful UI tool that we can use within visual studio that helps us train and work with machine learning and a much easier and understand way so just to see what model builder looks like if I right click on my project and say add machine learning I can see that within here I can choose a scenario so I can choose things like issue classification sentiment analysis price prediction so in my case I would have chosen sentiment analysis and then I can just go ahead and choose my input file so I could choose my input review dataset to do some training on and then ml.net does all of the training for me and generates some really awesome code for me so if I go back here this was actually code generated from model builder using ml.net and what it's doing is essentially creating a way to start predicting so it calls the ml model that was trained and created and then it creates a prediction based on whatever strings I pass to it and then down here created classes to represent my review data since I do need to pass that or work with that when I'm using ml.net okay so now that I've gone ahead and created a function where I can call the ml.net code I want to actually call that function so what I've done here is there's this really neat functionality in .net for Apache Spark where we can actually execute SQL queries so if you're familiar with SQL syntax at all we can have those SQL queries within our code so in my case I've gone ahead and selected column one which represents my input review text and then past column one so past each review to my ml.net method and what I can do here is then just go ahead and print that out essentially and then I called show so that I can see the output of my operations and then similarly just like we had done using the batch app you'll want to make sure you set your environment variable correctly so that bin debug net core app folder and then we can go ahead and go into our apps directory and build and run it so let's take a look at how that came out okay so you can see here I had built my project and built succeeded and then I ran Spark submit using pretty much the same types of parameters just in this case it had to be to my current apps DLL so if I scroll down what we see here for the first data frame is that was just the raw review data so this is these are all the reviews so we're in my Yelp data set and this is the true answer if it's a negative or a positive sentiment so we can see when someone loved something that represented with a one so that means it was a positive sentiment and if someone said something was not good that was a zero so negative sentiment so now the next data frame that we're going to see is going to represent the prediction from our ML.net code so let's scroll down and see and we can see here we're dealing with the same reviews but now this is the predicted sentiment so you can see here that it looks like it was pretty accurate we can see when someone loved something it was predicted as true so positive and then again when something was not good it was false so negative sentiment so you can see here that we were successfully able to combine .net for Apache Spark and ML.net let's go back here so now that we've done that demo we have one final quick scenario to go through and this is with structured streaming or real-time data analysis so in structured streaming or real-time analysis we're working with live data so data that's maybe coming in from a sensor so like an IoT factory sensor or a phone or a network and structured streaming uses the principle of micro batch processing so essentially it takes our continuous stream of data and divides it into smaller little chunks so maybe every five seconds represents a new batch and then it can perform functionality on each of those smaller batches and then append the result essentially to a table that already exists so then if let's say another five seconds passes we'll have another batch perform functionality on it and append it another batch perform some functionality on it append it and so on and so forth as our stream still exists so in the quick demo that I'll show you here we can actually do live or real-time sentiment analysis so still using .net for Apache Spark with ML.net now we can see that if I type a string into a console let's say we can determine in real-time if it represents a positive or a negative sentiment so let's go ahead and take a quick look at that demo okay so I still have the Microsoft ML and Microsoft Spark Nuget packages installed I start off creating a Spark session but instead of reading into a data frame from a CSV or stored data now I'm doing something where I'm reading a stream and I have to set up the host important information my stream is coming from and then I still use ML.net with a UDF and I can still call the ML.net code in a very similar way and then finally as I'm like working with the data and displaying it I use something called a streaming query and I can go ahead and call write stream and determine that I want to write my stream to the console and instead of saying spark.stop we can do query.awaittermination so if I go over here I can see here that I've set up a quick netcat terminal so just an easy way to read to or write from a network connection and for instance I could write something like I love spark and then in my other tab over here I've already built and run my .net for Apache Spark app so if I scroll down you can see that I've been working with my different batches here so every time I hit enter it's considered a new batch and it determines in real time if my line was a positive or negative sentiment so you can see when I said I love spark it was considered true a positive sentiment so that's awesome we have real time streaming working okay so a couple quick steps for how you can get started with .net for Apache Spark we have if you go to the .net website so dot.net slash spark you can go ahead and read even more about .net for Apache Spark you can go through a really neat getting started tutorial we have where you can get up and running with .net spark on your local machine in 10 minutes or less and you can also visit our docs and see some other learning resources we have you can also visit our github so github.com slash .net slash spark so you can go ahead and view some of the documentation you can see how things are implemented you can participate in the open source community with spark so thank you so much and now I guess we'll turn to questions fantastic so that was an amazing presentation Bridget now help me out because I am a little dense spark isn't like a database is it is it where the data is stored or is it a medium for transferring data over help me out to set the context for these questions sure yeah so spark isn't a database so it's not where the data is stored so you'll already have your data stored in something like somewhere in azure so maybe an azure data like storage or in a blob or something like that so spark is actually kind of like the framework or the tools that we can use to start analyzing that data so it allows us to read it in and to process it more quickly and to make different calls to it so that we can gain meaningful insights from it amazing so it's like it's like the pipe then that takes data from any scenario and then moves it over is that right yeah yeah that's a good way to think of it fantastic and so you mentioned a lot of stuff with with dotnet we didn't have dotnet isms for spark when did this start and if you were to point because you pointed out a tons of cool things but if you were to tell people one thing look at this first and see why it's powerful what would you suggest to them okay so we started this project we first started it towards the beginning of this year so I would say about in April even though we did have a predecessor to this project a few years ago but yeah I would say as of this year is when we actually started having like these awesome dotnet bindings to Apache spark and for something really awesome I would say if you check out that landing page so dotnet slash spark you can see really that you can really start processing terabytes and petabytes of data at a manageable scale so you don't have to spend like days and weeks and months and years processing all this data you can actually start gaining insights from it and like a matter of hours that's pretty cool does dotnet for Apache spark support support using F sharp instead of C sharp yes I believe it does so dotnet ecosystem in general fantastic well this is amazing and thank you so much Bridget now here's a couple of things though before we go I want to remind everybody about I'm not finding it but the the actual tech challenges that are available and let me get my my handy notes out here because they're they're pretty good and if you have more questions or Bridget make sure you get them in make sure you participate in the technical treasure hunt it's happening all day tons of technical problems that you can solve maybe even do a little bit of code if you solve all of them you will get a ton of wonderful prizes it's pretty cool if you go to dotnet comp front slash party that's what we're gonna if you go to dotnet comp front slash party sorry they're talking in my ear you'll be able to see all the cool things and there's a ton of things happening today make sure you go to the Apache Spark coolness for dotnet which I think is pretty cool we're gonna go to a commercial break here in a second but and after that we're gonna have more servers less with Jeff Holland I was gonna talk about durable functions 2.0 serverless actors orchestrations and stateful functions all right let's go to Jeff actually right now I'm so excited that's the second time I'm way better than a commercial break like let's just start with the serverless functions why why even wait so I am thrilled to be here today my voice is gonna hold out for one more amazing session here at dotnet comp I'm getting over a little bit of a cold if you can hear to my voice but I'm so excited I will be just as durable as the functions that we're gonna talk about so last year at dotnet comp I did a session talking about durable functions and some of the patterns that you can do I'll do a slight refresher on that for those who might not have seen last year's one but what I really want to talk about today is durable functions 2.0 and some of the stateful patterns that you can now do for dotnet doing serverless compute in the cloud to let you do things like stateful entities actor like patterns orchestrations that unlock an entire new world of scenarios that you can start to get into so to start with as mentioned before I'm Jeff Holland I'm a program manager on Azure serverless focusing on Azure functions so today we're gonna start by doing a little bit of an overview of what durable functions is we're gonna talk about some of those new patterns specifically durable entities go over some examples and scenarios and if you have questions be sure to tweet hashtag dotnet comp and I'll answer those at the end as well so I'll make sure to keep time for questions but please participate ask questions as we go so that I can answer them here live so thinking about functions I apologize for those who might not be familiar with Azure functions already I'm gonna kind of make some assumptions that you're aware of what a serverless function is at least even if you haven't already used one and traditionally when you think about functions there's oftentimes paired with some qualifications about functions like oh they're stateless they're very short lived so if you want to do a pattern like what I'm showing here just a really simple an event happens like hey we add a customer whenever we add a customer we need to create a record for them in a CRM database and then we need to send them a welcome email and then we need to update some SQL database right you have like three tasks that need to happen the way that traditionally you'd have to build that is like what's showing behind me right this idea where you have function one drops it in a queue function two triggers does its little short processing drops it in a queue and then hits function three it's totally fine you can do it that way but it's a bit cumbersome as a developer or an operator to have to write this decoupled code as these kind of independent functions managing it, deploying it looking at how many customers I'm adding in the health of that pipeline can be challenging so what durable functions lets you do is this an extension to Azure functions it can be installed in as a NuGet package and it will enable you to write this in codeful ways using code to describe more stateful and long writing stuff so here this is an example of an orchestration it's the same logic I was showing you before where I'm going to call function one then I'm going to call function two then I'm going to call function three that's what I've described here in code but here rather than me having to manage the queues or mentally map how things might be happening I've actually been able to write this as code as a special type of function as a durable function now this entire orchestration might take 30 minutes it might take three days that's totally fine durable functions is going to do it all for me is this nice extension and let me describe it and monitor it and manage it as code so here I can absolutely see what's happening oh yeah function one function two function three if an exception happens you'll notice I even have things like a try and a catch block so that I can catch exceptions and handle them so it's this nice pattern that I'm able to do excuse me as I mentioned I'm going to be durable I'm going to make it through this all right so what are some of the patterns that you can do with durable functions and I mentioned before the kind of one I spent some time about last year was talking about orchestration so I have my orchestrator function it's calling into my activity functions these are other functions in the same app and I can chain them together but I can also do other patterns right so sequencing it's the one we've talked about you could do fan out and fan in with durable functions like imagine a scenario where hey every week there's going to be a report I'm going to get a batch report and for every single record in that report I want to go execute a function and rather than me having to kind of manually drop stuff in queues durable does it for me I can just describe this as like a for loop and say hey for each record call this function and durable functions is going to do that for you external events correlation kind of an example here I like to think about is imagine that you're hiring a new employee and there's three events that have to happen right they have to upload their driver's license they have to update they have to upload their social security information and maybe they have to upload some form and what I want to have happen is wait until all three of those things have happened and then continue maybe fire a third function that says hey you're done you're you've you've uploaded all you need to do with durable functions you can write in code away for a function that waits for those three external events waits for all of them to happen and when all three have happened we'll continue on also written in .net code just like the code I showed you earlier long running operations is a powerful pattern as well where maybe you actually want to monitor something I did a sample a few months ago which was pretty simple it's also in our durable functions docs which was hey tell me when the weather is going to be nice over the next six hours so you could kick off a function in every 10 minutes it's going to pull the weather and say like hey is the is it going to rain is it going to be sunny I live in Seattle so we we really need durable functions just to let us know when it's going to be sunny outside and so this function is going to monitor the weather for a few hours maybe a day and as soon as the weather is nice it sends me a text message so the idea where I have this kind of long running function where I'm monitoring the weather I can describe that as a durable function as well asynchronous work this is another powerful pattern where maybe I want an HTTP triggered function one that can be triggered on an HTTP request but maybe that HTTP request is going to take five 10 minutes to process its work and I don't really want to call the function and have the thing that's calling it keep that request alive for those five or 10 minutes right oftentimes like if it's from a mobile app it's very common that I'm going to have a hiccup in my connection it might disconnect after three or four minutes it's not a very scalable pattern so with durable functions I can say hey start the function fire it but then return back immediately with a status end point and be like hey I got your request check back in a few seconds so let me know what my progress is so you can kind of have like this progress API through durable functions where the function might take 10 minutes to process that HTTP request but my clients just check the status they're like hey are you done yet nope are you done yet nope are you done yet yep I'm done here's the result awesome great super seamless pattern just a few lines of durable function code and then finally human interaction maybe I have a approval right I submit a document I need to wait for Jeff to approve it I need to wait for Seth to approve it once both of them have approved it then you know submit it to the final result so these are just a few of the patterns that are more stateful in nature are more long-running in nature that if you're using just serverless out of the box or as your functions out of the box it might be like how do I solve these and durable makes it really trivial with just code samples and examples and in fact all of the patterns I've shown here if you go to the durable function documentation which I'll link to at the end of the presentation we have code samples and examples for doing all of these now how does durable functions work behind the scenes and I want to illustrate it with this slide so I have here and I apologize the colors a little bit hard to note in this gray box I have my durable function code and it's just a really simple durable function orchestrator it's just going to call the say hello function and pass in the value world now behind the scenes how durable functions is working as you just write this little bit of code here that gray box up top in durable functions this extension to your azure function is going to interact with a storage provider like azure storage to monitor and maintain the state for you it's going to keep what's called an execution history so that it knows what step it's at what step to do next still enabling you to do like scaling to zero so for example if I was doing an approval workflow and it's like hey I need to wait for Seth to approve a document before I can continue you're not paying for the two, three, four hours or four days where your function's not running and you're just waiting for approval your function can actually scale to zero and when Seth approves the document it wakes up and continues on so that's all happening because of the state management behind the scenes so let's walk through it now right let's say I trigger off this function I say hey start my orchestration and the function wakes up and it's going to start evaluate the first line of code so it's going to say all right create a new list outputs and it will get to the next line and durable functions is going to see this await word and when it sees the await word it knows that there's some activity some task that it needs to perform now as I mentioned because it might be resuming from a previous state it might have crashed from a previous state the first thing it's going to do is it's not actually going to evaluate this code it's going to go ask durable functions and it's going to say hey have I already done this have I already said hello to world so in this case the durable function asks the execution history and it's like hey have I already said hello to the world and the execution history is like no you haven't done this yet it's like okay cool I know that's what I need to do then so it's going to go ahead and schedule this work it's going to drop a message in a queue that's managed completely for you you're going to say hey we need to say hello to the world and after that your durable function stops it's done it's like hey I scheduled my task now I'm going to wait to get triggered again now at this point your activity function your function that's actually going to do the work your say hello function it had some work scheduled for it so it's going to wake up it's just been triggered it's got work scheduled for it so it wakes up it triggers it says hey my orchestrator wanted me to say hello to the world so the function is going to do its work it's going to update the execution history table you'll notice I visualized that here so hey I did my work I said hello to the world and then it shuts down now when that happens the orchestrator gets triggered again now here's the really important part to note when the orchestrator starts again it doesn't resume from the middle right there's not really a way to just start from line 52 so what's actually going to happen is the durable function is going to start from the top again it's been triggered it's going to first evaluate that first line of code right create a new list now it's going to get to the second line and as I mentioned it's going to say hey I need to await something I need to await saying hello to the world and it's going to make that same check it's going to say hey execution history have I already done this thing have I already said hello to the world and in this case I have right in the history table my activity function did its work it created its outputs and it's like yeah you actually said hello to the world the result was hello world so then the function's like great I'm going to go to the next line and in this case the next line is just return outputs but you could imagine if I call another function and another function this pattern kind of continues where I'm scheduling work the work gets scheduled I'm updating the results in the history table and then my function spins up again and starts again so all this happens for you behind the scenes you don't have to worry about this kind of execution history song and dance you just write that really simple code that I showed earlier that looks a little bit like this but behind the scenes that's what's happening it's using storage it's queuing scheduling work and it's replaying that orchestrator and rehydrating the state every time it plays now that's durable functions all up let's now talk about durable functions 2.0 and as the name implies 2.0 is better it's great it's new it's exciting durable functions 2.0 is currently in preview we just shipped the beta 2 package a few weeks ago so what are some of the improvements that are coming to durable functions well the first one that I'm the most excited about is this durable entities pattern that we're going to go into in just a second if you've done any actor programming before like aca.net or or leans or service fabric you might see some similarities in this durable entities pattern another one that we've shipped as part of durable 2.0 is the ability to make resilient HTTP requests from an orchestrator so an orchestrator being like hey call function one call function two call function three you can now say oh now make an HTTP request you can even add authentication to that HTTP request so maybe you have a durable function that's going to call a few azure apis you can do all those azure apis and use like a managed identity to authenticate those requests all within a durable function Plugable state providers so previously durable functions just worked on azure storage we now have a method to swap in different state providers maybe you don't want it to be azure storage maybe you actually want to be redis because you're going to be running these durable functions on premises or in kubernetes or you want it to be event hubs or Kafka we've created a new pattern so that you can plug in different state providers your code doesn't need to know about it but behind the scenes it can use some different state providers to take advantage of maybe better throughput disconnected environments etc we're shipping a roslin analyzer that will actually evaluate your code in visual studio or vs code as you write it to let you know of common pitfalls like hey the code you wrote here isn't deterministic and when it does a replay it might end up getting in a weird state our analyzer can detect that and do the little squiggly lines for you which is fantastic we've also just made some nice improvements around the interfaces and testability so that you can more easily write unit tests implement interfaces for your durable functions so this is some of the goodies that are there but let's actually spend the next few minutes diving into durable entities now what is a durable entity again traditionally you think about functions you think about stateless and short-lived these are stateful functions that can be long running in their state so let's take a very simple example a counter let's pretend that I'm creating the next Fitbit or Apple Watch everyone's going to get a device and I want to track the amount of steps that someone has taken so I really need some state for each user that's a counter now let's look at how you could write that using durable functions in this new entity pattern so this is an example of a durable entity this is an entire function app right here this is all the code that I would need for my function app and really it just looks like a class because that's kind of what it is it's a counter class and my class has properties I have the count property which is an integer which I'm going to set to zero initially I can increment the count I can decrement the count obviously for Fitbit you don't really reduce steps when you walk backwards but a counter can go backwards and here I'm just saying like hey when I increment increment count by one decrement count by one I could terminate an instance of a counter maybe I have Jeff's counter I have Chris's counter I have Seth's counter maybe I want to destroy one of those counters I don't want to keep the state anymore in fact if you've written functions before the only thing here that might look a little familiar is this line at the bottom which is like hey I have a function which I'm going to call counter but all it's saying is map this to a durable entity of class counter that's the only code I have to write here for a function app and Azure functions with durable functions will now turn this into a counter so let's check that out now I have here in Visual Studio Code an example of that counter this is the same counter we were just looking at the only thing I've added here is I've injected in a logger you can inject in bindings as well you can inject in your own custom services but here I'm just injecting in a logger but it's still that counter right this is the entire code for my function app right here on the screen now what's amazing here is just like any function app let's go ahead and start and debug this project again all it is is these 25 lines of a class definition saying hey I want you to keep track of a serverless counter so it's going to spin that up it's going to run the Azure functions runtime on my machine right now and because I have the durable functions extension installed in fact if I open my csproj file you can see here I pulled in that beta 2 package of the durable task extension as my function app spins up it's going to recognize that this is a durable entity this is a stateful function and it's going to let me interact with it now there is a durable SDK that I could use to interact with that counter inside of my code if I wanted to or durable entities exposes a direct REST API so I can perform operations on my entities get the state of my entities directly over HTTP without having to create like an HTTP trigger if I didn't want to so my function is now running and here I have some HTTP requests that I'm going to use to call this entity right so it's running on localhost 771 here's the path to that REST API I'm saying hey call durable task and an entity and here I have counter now why does it say counter here because that's the name of my class that's the name of the function that I created called counter in this part right here in the path this is where I put in the ID of the counter right if you think about this idea of a stateful function I might not just have Jeff's counter I might have Seth's counter and Chris's counter so here's where I can define the different counters that are going to be running each of these might have a different count step right different steps for each person so let's go ahead and try to get the steps for Jeff right now and when I call it it's going to process and actually right here what it's returning back is a 404 not found that's because this is a brand new function a brand new storage account I've never run it before I've never done an operation on Jeff he's never taken a step so it doesn't actually exist yet which is fine let's go ahead and do an operation on the Jeff counter let me move this out of the way so here I have a post request that I'm going to make and here I'm going to say increment the counter for Jeff now why is it say increment here and that's because if I come back here to my counter code it is because here I defined a method called increment right so it maps to the method that I defined so I'm going to say hey increment which does count plus plus so let's go ahead and send that request it says accepted let's send it a few more times let's take a few more steps send send send send I think I hit that four times maybe five times now let's do that first call again get the current state of Jeff and when I call that here I get back a 200 okay and you'll notice now it actually knows the count for Jeff is five now what's cool here is I could shut down my machine I could restart my machine I could close everything down I could spin it back up again make this same call and it's going to remember oh yeah I have the state for Jeff and the count is five I could publish this to the cloud running as an Azure function it's only going to run and bill me when it's actually being invoked but I could call this in three weeks time and it's going to remember the count for Jeff is five so this is a powerful pattern that lets me now represent state keep that state around manipulate that state and have some operations on that state completely serverless right so all the benefits of functions massive scale only pay for when it's running but in this case using durable functions in this new stateful entity pattern so where's some of the places that this might come in handy there's a lot I have another example I won't run into now which is like imagine that it's .NETconf then I have a bunch of sessions right I won't run the sample but I will show it because I think it's a good one to visualize imagine here that I have sessions so I have a session class like a session at .NETconf every session has attendees number of people who are viewing it maybe they can submit reviews or evaluations which is going to be a dictionary with the string and double string being the attendee name double being the score and I can also submit an evaluation which is a method to submit an eval here I'm going to pass in an evaluation which I've defined here it's just an attendee and a score as I mentioned I can add those together I can even get back in aggregation which is like hey give me back the average score for this session I can now deploy this class this durable entity as a function app have it processing and maintaining the state for every session happening at the conference maybe multiple sessions in parallel and durable entities is going to maintain the state for me storing all this in azure storage behind the scenes but I as a developer haven't had to worry about wiring that in fact I get nice guarantees here too where imagine that I tried to increment my counter 100 times at the exact same second I will get guaranteed single threaded for one instance of the counter so that my counter will increment 100 times it won't have race conditions as well so there's some cool stuff here the last pattern I want to show with durable entities this gets a little bit more advanced so hopefully you've been able to follow along so far it's actually a pattern that I've come up against a lot running serverless functions so let me walk you through this scenario here imagine I have a simple architecture like this I have azure event hubs that I'm sending thousands of events to every second those events are triggering a function and that function maybe needs to update some data in a database like Cosmos DB or SQL well behind the scenes as these thousands of events are coming in my function is actually probably going to scale right it's going to scale to many many instances and the problem comes in what happens if there's an outage or some issue with my database downstream what if my function is triggering this whole time it's trying to update these records in a database but those calls are failing and people can get nervous in this because your function keeps scaling it keeps triggering but it's just hitting failure after failure after failure after failure so what I wanted to implement is a circuit breaker pattern where ideally I have something that is monitoring the state and the health of my circuit so here it's the same architecture but you'll notice I've just added in the stop light here which is green right now which is supposed to be saying hey this is healthy and what I want to have happen is that if I start getting a bunch of exceptions like maybe a hundred exceptions I actually want to set this to red and stop triggering my function but how do I do that that can actually be complicated to solve for especially noting that my functions are going to be scaling across these concurrent instances well this is where durable entities comes in I'm going to deploy a durable entity which will be monitoring the state of my function circuit that stop light and whenever one of my functions hits an exception I want it to send a signal up to that entity and it's up to my circuit entity that stateful function to do some aggregation math to figure out is this healthy or not and if it notices that I get maybe a hundred exceptions in the same second it's up to the durable entity to stop the trigger to turn it off right so that's what I wanted to build and in fact there's a sample on github that I'll link to in a second that does exactly that where I have a durable entity that has the state of the circuit open or closed and you can add a failure to it any of my functions can say hey I hit an exception and I just have here some code I'm not going to dig into it right now where I'm saying you know what if I ever have more exceptions in my case it's like 50 exceptions within a 30 second window then I want to go ahead and break the circuit to turn it off and in that case I just have some code that disables this function app so let's actually test it out now the last thing I want to show here I have here running in the azure portal this is my event hub triggered function and right now it's running it's happy and let's go ahead and publish now a thousand poison events to this function so I'm going to send bad very bad events let's go ahead and publish now a thousand bad events so I know I'm going to hit my exception threshold let's pretend that these are all database failures and here if I come back here to my live metric stream we should see here in just a moment assuming that yep it's sending those messages my function is going to wake up and it's going to start triggering and it's going to hit exception after exception after exception and what's powerful here is that after I hit that threshold of exceptions my durable entity is actually going to fire and disable my function app now I'm refreshing and now it doesn't look like it's triggered I hope I've hooked up to the right oh there we go all right might have been some wi-fi hiccups there or wherever else so I'm now online I see some failures processing you actually notice actually right away my exception rate started to climb it's hitting a lot of exceptions here and normally this is where I'd get really nervous right if I had a thousand requests coming in every second this exception rate's just going to grow and grow but you'll notice it actually just dropped off pretty quickly and the reason it dropped off is because here I hit my thresholds of exception and it's actually disabled it stopped my function app so I had this durable entity that was keeping the state of this function monitoring the health of it it hit enough exceptions in that window that that stateful function was able to then go turn off my other function so kind of an advanced pattern here but just trying to give you the idea how you can use these stateful functions to unlock patterns that traditionally would be really hard that you want state for maybe an aggregation but with durable entities become super simple so before we move to questions these are just some resources for you to be aware of if you're interested in using durable 2.0 check out this link to check out the docs for durable functions 2.0 there's a number of samples like how you could use durable functions to create a Twitter service or a rideshare service that you can check out at the second link and finally that circuit breaker sample the code that I used to do that last example of disabling a function that's here as well if you have any questions reach out directly on Twitter as well more than happy to help but with that I'm going to see if there's any questions that have come in during this time so we'll turn it back over here to see if there's anything that's popped up yeah awesome thank you so much Jeff that was really really cool we have some questions so the first one is when is ASP.net core 3.0 when will it be available for Azure App Service yep so I I believe it should be there if not now very very soon I was on an email thread yesterday where once it went GA we have to go update kind of our entire fleet of machines and make sure that they have 3.0 I believe it should be there now obviously there's a few ways to run App Services so you can run App Services in a container which would just work out of the box but I believe now you can take a .net3 function app deploy it to App Services and it should work if it's not available now it should be imminent as I mentioned there's been some very chatty threads to make sure we're ready to go awesome and then here's another one so when where can people get your Azure Functions t-shirt isn't this amazing I love this is my favorite shirt I'll move my laptop so you can look at that it's the ASCII art for the function run time so I will tell you we are printing a bunch of them right now because it's a hot commodity if you can make it to Microsoft Ignite we're gonna have thousands of them so come to our booth there if you can't make it try to grab us at some other conference we'll make sure to bring them obviously .netconf is a digital conference so it's harder to distribute them through this live stream but they're coming and I'm glad you appreciate it I love the shirt yeah so here that everyone go to Ignite and that's where you'll get those t-shirts yeah and so we have another question what languages support the durable functions framework yep fantastic question so .net supports it obviously it's what I showed JavaScript is the other one that you can write these durable orchestrations in right now we're working on getting JavaScript to work with these new entity features I just showed so some of the 2.0 features I've been talking about are only exposed through the .net SDK right now JavaScript's being worked on right now as well but we're working on Python support I don't know if we've actually said that publicly before but we are working on Python support as well so stay tuned over the next few months for any updates and news around Python for these durable functions okay great and we have another question durable functions or logic apps when should I use what yeah that comes up very often if you've used logic apps before they also let you create these orchestrations specifically some of the big differences logic apps is a declarative visual designer so when you write a logic app you have these different connectors and you can have you know step one call step two call step three doing similar things that a durable function orchestration can do honestly what I think it comes down to for a lot of folks is personal preference some people want to describe these orchestrations in code some people like this declarative nature or the visual designer of logic apps so that's a big one there's a few other ones where I'd say it's a little bit easier if you want to leverage one of the over 200 connectors that logic apps has use logic apps if you're only orchestrating functions maybe durable is a little bit nicer for you there though logic apps can do it great as well some of these other patterns like we talked about stateful entities that's really going to be durable only so there definitely is some overlap personal preference is big there I'm a fan of both I'll use logic apps for some things durable for others it's kind of like hey do I want one of these connectors do I want this visual designer or am I just going to write some simple logic in code directly cool and here's another one from Simon when will it be possible to change the runtime of an azure app service or function service to .NET Core 3.0 yeah so this is slightly different from the first question in that you can write like an ASP.NET Core 3 app in deploy tab service but functions like when I showed you the function code it's its own kind of SDK it's almost like its own flavor of ASP.NET in some ways that does not support 3.0 yet we're underway working on it right now there's an announcement in our GitHub repo currently next month so October we'll have azure functions in .NET Core 3.0 available to try out and becoming generally available early next year so stay tuned for that as well as to be able to write these functions in .NET using .NET Core 3.0 app services as I mentioned if you're just deploying a web app using ASP.NET Core.0 that's much sooner but a function app using .NET Core 3.0 is next month for preview cool and I think we have time for one more question so the last one is how much data can you store in the state pool pattern is there a limit of how many users can I store the amount of steps for how long will this data get stored am I paying for this stored data so it's really up to the storage account behind the scenes for some of the limits there's no limits with the framework itself we'll just use your azure storage account you will be paying for that storage so by default we'll keep it around indefinitely if you have a bunch of data in there we have SDKs to help you kind of clean up old instances or old entities if you want to keep it clean but by default we'll stick them in an azure storage account as long as your azure storage account has the room for it you can keep your state there if you want kind of more state or you need higher throughput than azure storage is able to provide that's where I mentioned some of those pluggable providers will come in but you will be paying for the storage costs of all the states so like my counter example if I open my storage account right now there's going to be a blob that says like Jeff's counter the value is five I'm going to be paying some whatever one one hundredth of a cent for that state if I had bigger state I'd be paying more all right awesome thank you so much Jeff next up we have Beyond Copy and Paste creating interactive documentation with Maria Nagaga thank you so much Mika thanks everyone for staying tuned with .NETConf 2019 and thank you for listening to my talk so my name is Maria Nagaga I am a senior program manager on the Visual Studio and .NET team and I want to talk to you today about interactive documentation and how we think about that and how it's important for first-time developers as well as developers who are continuing to grow and build on our platform so let's talk about documentation documentation is how we build trust with our developers it's how we educate people it's how we sell our products and good documentation means that we are as invested in our product as much as you are it's important as we build our documentation from first-time developers to people who are building code every single day that we make sure that their on-ramp is as smooth and as effortless as possible so let's talk about documentation today for a few minutes with documentation today it's getting really good but there are still a few assumptions that we continue to make about our customers first is the assumption of knowledge sometimes when content creators are writing documentation they assume that the people coming to our documentation have prior knowledge of the framework and the languages being taught the assumption of tech as a content author myself I sometimes continually find myself thinking of my experience as the only experience I sometimes reference the operating system I'm using I sometimes reference a version of windows I always assume that someone has as good internet bandwidth as I do so a good example of this is providing links to certain specific downloads as well as screenshots that only reflect a particular operating system and the last one is the assumption of time we are all really guilty of doing that we assume that the people coming to read our content or use our videos or our documentation have more time than they do usually when people are learning things trying new things or testing something out they have a limited amount of time whether you are an educator a hobbyist or a seasoned developer you're probably doing this over your lunch time or just before you go to bed or just before you start work so we need to make sure we cater for that so when we look at documentation today majority of the documentation looks like this it's static code right and if we think about this from the perspective of a net new developer or brand new first timer they're often left wondering what does this do so we then go to stack overflow we copy and paste a bunch of code from here and there but then we still have for the challenge especially as first time developers what template do I use in visual studio what libraries do I need what do all these error messages mean we are telling people that for their first few lines of code there's a huge on-ramp or even just to run a sample for seasoned developers you're probably working really fast and you don't want to copy and paste in a copy and paste code in and out of your code base you just want to see if this is the best thing for you so we've noticed one thing as we begin to improve our documentation our expectations have changed and we expect more from the people building our content to do more video has done great work in this space and we just launched right now with dotnet videos on how we are investing in videos and how we are making sure that our developers have an interactive experience where they're able to listen pause and rewind but still we're assuming a bit of time on your side but it's really good content so please go and look it up another thing is interactive snippets online this has actually become a requirement for languages and frameworks when you can see the popular languages like javascript and python allowing people to test apis and syntax right within the browser but we're also seeing it in popularly emerging languages as well such as scholar and go where people are able to interact and test apis right within the browser but puzzle this is just a few pieces of the puzzles right so we have video on one side we also have syntax iteration online however people want to have experiences that feel as native to the experience that they would have in the browser we're seeing this in places like Microsoft learn where people are able to try and test things out which would be similar to what their local experience would be so when they do transition into an offline experience it feels vaguely familiar but then we also have the concept of trying now this is something I constantly do if I want to try out a new NuGet package I will create a throwaway package see if it's working I will delete it I will do it again but you're seeing places like mpn with the help of companies like RunKit creating these experiences online we should be able to try out our NuGet packages and see what they're like right within the comfort of our browser and what we're continuing to see here is a narrowing of the divide between documentation and code and the reason why we're seeing this is the landscape is continuously growing we have developers such as people who are watching this show writing blog posts every single day we have hobbyists and the hobbyist field just keeps on growing from makers to web developers mobile developers IoT from social media influencers where they're just constantly learning how to own their own online experience we have data researchers who are using and mining data and making these analytical choices to make more informed decisions we have educators both CS educators as well as non-technical educators where we're seeing in primary and secondary schools all around the world where non-technical teachers are given the task to unwrap the next generation to be comfortable in this new world of coding and finally we have our students who want to explore and learn as much as possible and we need to provide those opportunities for them so when we're creating these new experiences around documentation especially at Microsoft there are things that we wanted to make sure that we landed very comfortably with the customers we wanted to make sure that they had up-to-date documentation nice and fresh referencing articles that were from 2019 versus 2003 we wanted to make it engaging and engaging is not just about making it flashy and cool you want to make the navigation really easy you want someone to land on a documentation page and know where they need to go you also want the steps to be clear and quick and easy so if you go to dot.net right now and you go getting started you will see how to get rough and running in 10 minutes giving people the moment to feel empowered in 10 minutes or less and finally we wanted to create a friction-free learning experience we wanted someone to be able to go onto a webpage and learn about the language without having to install all the tools or know everything and in 2017 we launched an interactive online experience with a product that I build called try.net which allows people to experiment and try.net the language within the browser so let's talk about more about the try.net interactive experience and what we offer them we have our initial goals were in 2017 was to have an interactive documentation online bringing us up to speed with the other languages that had been providing this for their customers most importantly we wanted it to be login-free we wanted to make sure that someone didn't have to install everything on their machine in order to just write console dot write line hello world we wanted you to give that quick win and finally we wanted a fast on-ramp we wanted it so you could edit the code online click run and see the results we wanted you to feel that moment of success but we also noticed that try.net is growing and those are some of the wonderful things I want to show you with you today so when we first began in 2017 we wanted a friction-free online experience and we did that with try.net and you go to docs.microsoft.com you're able to run C-sharp code right within the browser but as we began to notice that there were certain difficulties first of all what happened if someone didn't have good internet access what if somebody wanted to do this locally on their machine how are we creating that experience for you also we wanted to make a cheaper alternative that allowed people to run things easily within their website and luckily in 2018 we also got blazer and it allowed us to pivot from running things in containers on azure container instances to running things on the client side with blazer and not only that because we created these experiences it also allowed us to create a local experience with the .net tri-global tool and if you look at my slide right now we have a student in South Africa who calls this one of the most influential things that he's used that allows him to go and share C-sharp experiences with his fellow students so we thank you and we hope that you continue to use us and then we have a special surprise that I think a lot of you didn't expect but we also have .net running in notebooks and I'll be sharing that demo with you later today so let's go and see some demos now okay so as I said see try.net started in the browser so if you go to any single sample on the docs.microsoft.com quick starts you notice that we have an editor right now you can copy the code over run it and you have the direct results you can also edit it easily right within the browser so you're not restricted by what is in the code and you run it again this is all running on blazer it's all running on the client side that allows us to create opportunities where people could possibly add this to their websites as well which we're hoping to enable in the future but I also talked about the offline experience if any of you have ever done a workshop or done a tutorial out there you've probably had to get people to download the tools clone the repo make sure then the right operating system and before you know it it's two three hours into the workshop and nobody has done anything we wanted to make sure that people could be just successful with the .net SDK and the .net tribal global tool and get things up and running so I want to give you a quick demo of that so we have this repo it's our samples repo you can go to .net try slash samples on github and you'll see four clear instructions instructions where we'll tell you to install the .net try global tool which is available when you get today clone this repo then once you have this repo clone I want you to go into the directory and type .net try so as someone who prepares for demos ahead of time I did the first three steps ahead of time so I'm going to go right into here type .net try hit run and what this is going to do using kestrel is going to start up my browser and it's going to give me an interactive markdown experience if you look at the top this is an md file so I'm going to continue into introduction to programming with C sharp and you'll notice that you have a list of instructions it's like an interactive book let's go ahead and run this code sometimes the first run can take a few seconds but bear with me you have hello world I can go in change it again and I will put in my name run it again and I see the results this gives people the flexibility to learn and experiment within the browser giving you that nice interactive experience so I hope that you'll give it a try for the next workshop that you're doing or if you just want to give it a just try it out but the big question here is how are we doing this how are we able to have this mix of interactive code C sharp code with a markdown file so I'm just going to go over to visual studio code and show you some of the magic that we're running so I'm just going to close up the server here so this looks like markdown that you've probably written in the past if you've done anything with a readme file and if you add any sort of language language features within your markdown you usually have to use a flag so you notice that we have something called ccs which is the C sharp we're pointing to a specific region right so this is general C sharp regions called intro we're pointing to a source file and we're pointing to a program.cs in my app so let's see what this is if I go over to my program.cs you will notice that I have a couple of regions that already have a bunch of switch case statements and I have a region called intro so if I edited this and I said hello.net.com and I saved this file and let's just go ahead and run this again .net try I go back into my introduction to C sharp and I've edited it right so there's a seamless difference but another thing that we have to be careful with is that if anyone's written documentation sometimes it gets out of sync like how do we support our backing project as well as what we're putting in the documentation and we wanted to make sure that we supported that so let's make some quick edits like how do we verify code so I'm going to go over to VS code again and I'm just going to make some clumsy mistakes over here I am going to remove the semicolon save that I am going to change this from intros from intro to intros I'm going to save that again and I want to show you a new addition we added called .net verify right so what it's saying sorry it's .net try verify okay so this is going through and it's actually checking your markdown and checking your backing project to make sure that everything's going okay and you'll notice that it says hey you're missing some things here you're missing a semicolon and we also haven't found the intros region so we wanted to make sure that before you hit push into github you're able to actually see any issues that might pop out okay and we're allowed we enable you to do that if you're someone who would prefer to see this in a UI format it's also supported on the server on the UI side as well so I'm just going to click do this do .net try it's going to launch the local host again and if I go over to the introductions it will tell me that the region hasn't been found so on both sides you have this experience where users are easily able to catch what their mistakes are so let's go on since we've seen that if you want to look at this more you can go ahead to our github repo and please give it a try so I want to show you a little bit more and other experiences that we've been creating so I showed you the .net try global tool and I showed you .net try running in the browser but I also wanted to show you something that we just did this week and I'm really looking forward to hearing your feedback if you go to our github repo and you do .net slash try and you scroll to the bottom which is pretty long you can notice that we have a lot of files in there you'll notice that we have the .net try enable back but we also have launch to binder now binder is a project an open source project where it's able to point to a github repo and take out all the notebook files and run them in the browser so they spin up a nice container and you're able to look at it right within the browser over here I already got this started this is c-sharp notebooks oh sorry let me start that again that's launch binder this is going to take a few minutes because it's configuring a container for us and the beauty of like live demos is that this will happen as the circle spins around but what we wanted to show you here is that we want you to be able to try the .net notebook right within the browser we wanted you to play around with it let me make this into c-sharp we're going to go into samples and I have an housing ml sample right here so let's walk through this experience you can install new get packages right so this allows you to customize it add any new get packages that you'd like I'm going to hit shift enter what this is doing is it going to new get it's installing those packages for me this will take a few minutes but as we want you to know that if you are using this on your side you can install as many packages as you would like you can use where you can notice that we're using the ml package we're using auto ml and we're also pulling the data frames new get package as well but as that's installing let's look through the rest of the code so I can run through it we're able to use our packages in the next cell as some of you might know notebooks have cell by cell execution we also wanted to make sure that people had graphs being able to plot there so we wanted to make sure that people were able to display graphs scatter plots right within the new get packages right within the notebook wanted to make sure that we made this feel authentic to people who are coming from the python notebook space but we also wanted to make sure that our customers who are regular dot who are regular dotnet developers but this also felt authentic and natural to them so I'm going to hit run the next browser maybe sorry next cell shift enter all right and as you can see we have a nice table that has been delayed we've actually been able to display table of the housing data we can also plot some graphs which I think would be the cool thing so let's start looking at some cool stuff all right let's run that again all right so I'm going to go over to docs samples and housing let's pull in some packages bear with me I am so sorry but this should take a faster time the next time around we've installed our packages we're waiting for just one more which has been successfully installed let's run this the housing data all right so what we wanted people to be able to do was see the graphs and customize these graphs authentically I don't know okay so let's give it a moment and what we should see in a bit is a histogram that shows us a trend of all the housing data across California well while we're doing that okay let's give it one more time think the third yes there we go it just needed one more time if you hit it hard enough it will happen so what we can see is that we have a histogram that shows all the data if you're someone coming from the notebook space we also have support so you can zoom in and see these things in more detail we also wanted to make sure that you're able to do more interesting graphs like scatter plots so let's run this give in a moment all right and as you can see we have a scatter plot and guess which state this is California sorry I don't have a live audience it's California as we can see the pricing is pretty high but let's say I wanted to zoom in a little more I can do this I can zoom in on some of the hot spots what this will do is I will actually cancel out everything else so we wanted that rich interactive experience that people have come to expect and we're looking forward to your feedback so if you have any questions on how to get started with the .NET kernel that would come at a rounding night time we won't have anything for people to try at the moment however we do have the mind binder experiences available right now so if you go over to our github page and you'll be able to launch it right there from launching launch my grinder so we have a couple of minutes for questions I believe when we have a chance and we can give it a go are we ready for questions we are ready for questions fantastic well hopefully you can see us here I brought my brand new phone hello that was really awkward well you know the first thing that's kind of cool is yeah this one right here Mika how do you feel about what she just showed us I think it's awesome have you ever tried have you ever tried try .NET you're gonna love this I'm reading upside down I'm gonna read it looks like a fairly simple way to learn and write some C sharp code inside your browser without having to first create a visual studio solution plus lots of sample code aims at new learners check it out you have a fan yay you really do and there's a there's a there's a gif and I'm gonna say gif for all of you out there listening I'm not I will not say gif it's not peanut butter okay of the the guy the Australian guy going like this two thumbs up all right what else do we have over here let's see wish this had been around when I was working on Biff frost by frost by frost a few years back looks really impressive for .NET open source projects like I'm wondering if this guy's Thor I think you might be okay I think you might be um because I'm worth hi yeah oh yeah of course hi for me too yeah we'll say hi all right here's another one from John great to see the improvements Microsoft has made in language platform documentation I still remember the huge stacko books from c6.0 that's a long time ago should have included a back brace with the product this is pretty cool I love I love the idea of being able to learn and read as you go I'm personally a fan of notebooks I'm so glad C sharp is coming to it and the try .NET stuff is really cool so if you could give people one takeaway from your session what would it be it would be number one can it only be one or can I give two can you you could give as many as you want okay this is your session number one please go and try the .NET try global tone give it a try make sure using it for your next workshop we are looking forward to hearing how you're doing with it we've had people try it with workshops that are pulling from azure functions so I would love to see more workshops with that also if you want to give it give the binder experience to try it let me walk through that experience one more time so people can look at it because I had some technical issues because you know that's the world so let's do that so if you go to our github repo which is .NET slash try you scroll down all our code base you'll notice launch my binder right so when you launch my binder what this is doing is that it is spinning up a container for you and you're able to actually start running and writing that code right within the browser so it's pulling in the .NET core SDK and all that kind of stuff now for it to even look nicer look at it in the lab format which I just think is always like a nicer way to look at this experience I'm a fan it's really cool I also want to point out we do have F sharp support I don't know if people saw that is that because Philip's next Philip is next and I just felt I almost I almost didn't say it I didn't say it that's right we do have F sharp support so if you weren't there you go to docs there's an output there is a bug which I can fix right now hit run but this has all the nice F sharp expectations that people will have and my team will continue to work on that fantastic if you look at C sharp as well let's go up one look at C sharp you will find two different samples you'll have one which is the housing sample and just to give reference to this housing sample is literally pulled out of a data science book and Eric did a side by side and was able to replicate this entire experience right within the browser and we also have a repo one which I should have run to show you how we are actively keeping track on the issues that you're doing and we are actively trying to close them fantastic yeah and then wait for ignite so you can start installing the bits on your machine all right nice we have another question is it possible to integrate try.net with docfx documentation try.net and docfx not at the moment now okay okay and I think there's one more is it this one yeah can I take a subset of the try.net code and use it to incorporate C sharp scripts within existing applications ooh Jeremy good question yes you can just look at our repo and ask us questions and here's another one with another also that's GIF Yoda wise one it says so do what you can as there is no try try.net.net like I love the dot net dot net the cool with jupiter notebooks look at that so like what was the pic again I'm trying to like parse it this is really good stuff okay it says so do what you can as there is no try try.net the cool with jupiter notebooks.net com I will I will decide for that right think is a try.net is cool and we're also excited about the jupiter notebooks experience oh my goodness she is so good are we ready to go to the next session yeah we have what's new in f sharp with philip so philip now is it philip or phil or is it like do I have to say it with a British accent philip so you could say his majesty philip of course like I do normal like that yeah well welcome all right king seth thank you hi my name is philip carter I'll look in different cameras and I'm here to talk today about what's new with f sharp because I work on f sharp and other dot net stuff on the f sharp and dot net team so yeah I want to give a little bit of an overview first the first is I want to give a slight recap of f sharp 4.6 which we released earlier this year and we've been making some improvements on sort of leading up to the f sharp 4.7 release so I think it's good to sort of talk about that sort of stuff you know right before talking about the brand new stuff I then want to talk about brand new stuff with f sharp 4.7 and then I want to talk about brand new new stuff like even newer than the brand new stuff and f sharp preview bits which were actually shipping alongside f sharp 4.7 this is actually the first time that we're doing this so it's pretty radical so f sharp 4.6 this was released earlier this year with visual studio 2019 however we've been making incremental improvements especially to the tools since that release so f sharp 4.6 wasn't really kind of this thing that came out and you know now it's done it's something that's been continually improved upon and really the big pieces there were just performance so what you see here are two issues on our github repository that are related to tooling performance and interestingly enough this tooling work is not necessarily in the tools so much as it is in the compiler and so what I mean by that is the f sharp compiler has been around for a while and it's very well optimized for you know compiling code right you take some code you run the compiler against it you get an assembly you can run that assembly it's very good at doing that sort of stuff however what some people may not necessarily know is that the f sharp compiler that we use to actually compile your code is also the same compiler that's hosted inside of visual studio inside of visual studio code and v s for mac that sort of stuff so you know the same code paths that we have internally that take your code in a minute assembly are you know the ones that are run when you're asking for things like IntelliSense or tool tips or things like that and one of the problems that we identified was things that were very highly optimized for you know just a single pass compilation produce an assembly were not necessarily optimized in a long like a a long live process sort of like a server process you can imagine inside of tooling and so as you can see there's a whole bunch of problems that were here that that are all checked off because they're all issues that were fixed and the end result is just massive performance improvements in all of your tooling especially if you have really large solutions so this is something that came out with f sharp 4.6 but it's also been continually improving and so I like to think of f sharp 4.6 as this thing that you know over the course of multiple releases have just has just gotten a lot better leading up to the f sharp 4.7 release so the other thing that I that was sort of mentioned there with f sharp 4.6 was the anonymous records feature and I want to show that in visual studio code just a little bit before I get into the new stuff so moving over here into visual studio code which I will point out is using the official f sharp plugin known as ionide which has about 1.4 million downloads now it's running f sharp 4.6 it's actually the f sharp 4.7 compiler but I'm just showing f sharp 4.6 right now and I'm going to show you a little bit about anonymous records so for f sharp programmers out there who are familiar with records you know them very well as these types that you can declare up front they're just you know really neat little data holders and you know you can do a whole bunch of different stuff with them and then a lot of f sharp programmers are very used to tuples where you can just sort of ad hoc kind of on the fly when you need it group some stuff together and then you know do whatever you want to do with it but where the problem with tuples is you know you don't you don't get you know as good a tooling support as you do with records right you can't rename labels it does it's not able to track things as well and that's just sort of inherent with you know tuples being a bit more of a lightweight thing and records kind of being this okay well I declare a type now I'm gonna instantiate this type I'm gonna use it in this particular way and a lot of people want something in between they want some of the tooling support that you get with records however they also want sort of that ad hoc you know hey on the fly I just want to construct a few things and do some stuff with it and then later on they may actually decide hey that ad hoc stuff that I constructed I want to pull that out into a real type declaration and you can't really do that with tuples today so that's one of the primary reasons why anonymous records exist so walking through the code here we've got this function it's called get circle stats takes in a radius which is a float and you'll you'll notice if I hover over here there's there's kind of a big tool tip here saying get circle stats given a radius produces you know this little bracket thingy and that's an anonymous record type that's that's uh you know you notice there's the little bracket in the bar regular records don't have the the bar anonymous records do that's sort of the main way that you distinguish them in syntax and so I get the area the diameter the circumference just normal mass stuff and then I construct some stats about that about the circle that was that is defined by the radius that I was given right it's got a diameter it's got an area of the circle and it's got a circumference and so when I actually call that code I can get you know my little radius value this case it's 3.0 I get the circle stats and then I can print the values out so if this were a tuple right if I were to do something like this you know there's there's nothing stopping me from doing something like this right just sort of returning a tuple and and then decomposing the tuple at the call site and then calling it there but you know I have to construct the names at the at the call site every time to get access to stuff and especially if I have like a lot of a lot of stuff that that you know has like meaningful names that I want to change over time you know maybe I don't like the name I want to refactor it a little bit I can't really do that with tuples and in fact now if I want to refactor this I can just go ahead and do that right here I can go rename and I'll just call that area because area of the circle is a bit redundant and boom it automatically changes it I don't have to go and find the name that I constructed from the tuple that I got back and then also rename that I can just do it on the fly so this is you know pretty much what you can already do with record types like I could have defined a circle stats type as a record up front and then constructed an instance one of those but what if I wanted to sort of ad hoc group the radius value with these other values that I have here well you know again that sort of thing I could do something like this I could go you know let the group is you know I could tuple I could go radius and I could go circle stats and there we go this is sort of a typical thing that you would do in f-sharp but you know again what if I want it but I want like you know an actual radius value that I could then refactor over time that's where anonymous records really shine here so I'll call this more circle stats and I'm going to take my circle stats value that I have here and I'm going to use copy and update syntax that you would normally have with regular record however instead of just copying the record into a new you know with a new value I'm going to throw a new field on there so I'm going to say circle stats with radius equals radius and now I could print this out I could go more circle stats dot radius and there we go I have that and that sort of gives you the power of being able to ad hoc group things up like you would with tuples but also get some of the niceness that you have with records now there's a little bit more that you can do with anonymous records I want to show just sort of briefly if you're doing type declarations there's a bit of code here but so you may have something like a discriminated union type you know an employee could either be an engineer a manager or an executive and so you know but I may want to have a bunch of data associated with each of those types now a very common way to do that sort of thing is to do something like this right I could have a manager type here manager there we go I didn't spell it correctly and so I may want to have a record that holds the data and have you know that sort of grow over time but you know if I want to group things up in a way that's convenient I need to use recursive type declarations which that's nice if you want to sound like you're really fancy to your coworkers or something but what it actually means you have to write more code and you have to sort of declare something as like a big old unit together now I could tuple these up I could have you know like a name is a string and then I could say you know reports is an employee list but then that's a tuple instead of a record type and what if I want to have a record type well now I have to actually make it you know the name manager well with anonymous records you don't have to do that at all there's you'll notice there's less code here there's no need for a recursive type declaration and that's because you know I've just sort of in line to the record here so again you get sort of the benefit of both worlds here of you know having sort of an ad hoc grouping of values but in this case in a type declaration and that's pretty powerful for anonymous records so moving on F sharp 4.6 it's great we released it we made some improvements some improvements are actually shipping in the vs 16.3 release but the new stuff is f sharp 4.7 and the f sharp preview that we shipped alongside it now this I think I'm a little bit more excited about mostly because we just shipped it yesterday it includes a few things mainly language versioning in the compiler itself which I'll talk about a bit implicit yields and some relaxed syntax which is I'll go over that a little bit the high-level bit here is it just makes your code easier to write sort of less surprises things are a bit more consistent with other things in the language and then f sharp preview has some some new features that I'll show off here so I'm going to show off some of this stuff but instead of vs code I'm going to hop over to visual studio here the old big IDE and we'll get going so I have a console project here named it f sharp 4.7 this is donna core project and I want to sort of demonstrate what implicit yields mean by taking you from a compile error to working code so as you may have noticed there's a red squiggle here right I can generate a sequence with a range expression I can go okay give me from one to ten that's a new sequence awesome cool well what if I just want a sequence comprised of one two and three right well now it says invalid object sequence or record expression that's what that's that's that's that's pretty weird now you can actually do this in lists and arrays but you can't do it with sequences which is kind of weird in fact you have to sprinkle this keyword everywhere this yield keyword and you know especially if you're a beginner to the language this is not very fun it's it's not very discoverable but the error message doesn't tell you anything about it and you know we could improve the error message but you know we figured we might as well improve the language instead of you know fix the root problem not necessarily just make the the diagnostics a little bit better we also have this function called get days of week that produces a list and the same problem actually shows itself in things that are not sequences if you decide to start conditionally generating things so in this case I want to generate Monday Tuesday Wednesday Thursday Friday but if include weekend is true I also want to give back Saturday and Sunday now there's just a bunch of stuff here this is a horrible error message frankly now again I could put in the yield and yes it turns out I have to put yields in absolutely every single spot and that's the only way to get rid of that error message at least that's the way that things were up until F sharp 4.7 now if I open up my project file you'll notice that I have this lang version property up here and I've explicitly set it to 4.6 which is the the older the well I shouldn't say older the one that I just talked about here so I'm just going to comment that out because this is a new project and so new projects implicitly use the latest lang version so you don't have to always set it yourself and if I go back to this file voila all of the error messages are gone because all of these yields can now be made implicit now granted I can if I'm really in love with these yields I can add them all back and the compiler's totally fine with that so this is backwards compatible you know there's no issue with doing that the old way but we think that a lot of people are going to like doing this you know the new way once they're in F sharp 4.7 so speaking of doing things a little bit better we got a wonderful feature that was contributed by by one of our community members his name is Gustavo Leon and there's a couple things I want to point out here so first you can declare you know this is how you declare an object in F sharp and we require an explicit this pointer for members you know I can name this anything I want I can name it this or self or something like that this is just sort of a convention of the language now you'll notice this is grayed out and that's because I'm not actually using self I'm not really doing anything you know recursively with this class so what typical F sharp programmers would do is they'd say okay well you know I'm just going to put an underbar there that indicates that you know that it doesn't really matter the this pointer but you had to do a double underbar and that's because what you could perhaps be a viewed and as a bug in the parser sort of had this little weird quirk where you had to put a double underbar instead of a single underbar whereas in pretty much everywhere else in the language if you want to just discard something or say I don't really care what the name is you can just have a single underbar so this was fixed by Gustavo Leon and it's a wonderful little change it's just kind of one of those things that you know it's these little paper cuts that can get you sometimes when you're working in a language especially if it's a new language and you're not quite familiar with its idioms and this is just one of those things that cleans up some of those paper cuts and the little code fixer here knows to prefix it oh well in this case it actually prefix it with underscore that's one of the options that you have the code fixer will also actually do the same there so the tooling is also up to date with that particular feature speaking of relaxations this part of the demo is actually it's really nothing it's just looking at the code and the reason why I think that's important is because if you've been using f-sharp prior to f-sharp 4.7 you know that you would not be able to write this code today you would have to tab everything over like this you would have to align this b and this d with this a and that was the only way that you could get the compiler to actually accept this particular declaration of the constructor that you have here and frankly that's just kind of annoying so we just made it so you got to indent over one and the same thing applies to static methods in this case so again before you had to move all of these over so that they were perfectly aligned with the first parameter that you laid out now they don't have to be they just need to have one indentation level over so that the compiler can understand that these are referring to the method that you're declaring right here so that's kind of you know aside from a whole bunch of bug fixes and more perfect performance improvements that's kind of what's going on for fsharp 4.7 but let's talk a little bit about fsharp preview because that's where things start to get a little bit fancy here so i'm going to go back to my project file and i'm going to uncomment out this lang version flag because this is something i'm going to have to actually do now if i want to use preview features i'm going to clear out 4.6 i'm going to type preview so if i save that now i can open up this file called name of and you'll notice that there's no red squiggles and that's because we've sort of activated the preview mode so internally the way that we do things in the compiler is whenever there's a feature that's implemented now it's associated with a feature flag and then that feature flag is associated with a given release of the language so in this case name of has the name of feature flag and that feature flag is associated with the preview release of the f-sharp compiler so what that actually means is if you set your lang version to be preview you will get everything that's associated with that internally one of them being name of so going back to the code here this is just sort of some basic usage that's you could it's pretty self-explanatory right i have a function it's called combine lengths i take two strings str1 and str2 and i want to dot and get the length of both of them and combine them pretty straightforward i just want to make sure that they're not null before i actually do that and in this case i'm going to raise an argument null exception and then i want to pass the name of the parameter there so in this case before i would have to do this or you know there we go i would have to do something like that and if i change the name of the parameter i would have to know to go back into the string literal and also change it that you don't have to do if you're on the f-sharp preview anymore you can just take the name of everything that you're working with and that's pretty great this is you know this has been around in c-sharp for a while and this is something that's been highly requested by the f-sharp community for a number of years it's extremely powerful if you're doing a lot of logging of parameters and different values and you want to sort of log you know okay this thing which was you know nested in this thing and nested in this thing and you want to lay it all out and get it into strings you can refactor with ease and know that you don't have to actually update anything else from there so just to show a little bit more of what you can do with name of I have a module with a function and then I I have the system namespace up there so I'm actually taking the name of the namespace so you can do that if you'd like I'm taking the name of a module that I declared and I'm taking the name of an explicitly a qualified function you know m.f that's the name of the actual function that'll take the name and just for kicks I can go let name of name of and I can take name of name of itself now this is probably not very useful for anyone but you know it just happened to be something that was enabled by the feature and so there's kind of no reason not to keep it so we have it and it's fun so the next one the next feature that's shipping in the f-sharp preview is opening of static classes so let me go up right here so a static class is you know this just got a bunch of static methods on it or static members or maybe some constants things like that one of the best examples of a static class is the system.math class and historically if you're in f-sharp you would have to go math. you know you would have to explicitly qualify math. whatever you want to use to be able to actually use it but now you can just actually open this thing and you know if you were to do this in f-sharp 4.7 or f-sharp 4.6 you did not have the preview turned on you would actually get an error saying that there is no namespace called system.math and that's because it's a class it's not a namespace and so what that means is I could just call sign of pi rather than math.sign of math.pi it's the sort of thing that is really handy if you're working with the math namespace and other libraries that do this sort of thing where they put this kind of functionality behind static classes and this is also helpful for f-sharp programmers who want to create DSLs that use method overloads just like just like you can do a little bit in c-sharp and you can actually declare those in f-sharp today because as it turns out a static class is it's not really like a real thing it's an abstract sealed class in .NET and so you just create a type that is both abstract and sealed and you give it some static members in this case I gave it l m n o and p and you know then you can open this class when you have the feature enabled and you can just call them like that I don't have to explicitly specify mystaticclass.l of mystaticclass.m of mystaticclass you know and so on this is something that we're pretty excited about especially with some of the focus on working with machine learning frameworks that we've been doing lately because a lot of these frameworks for .NET are using static classes to sort of pack these method overloads behind there but you know have it be sort of a functional interface and this will play very nicely with that sort of stuff in the future so that just about rounds out f-sharp 4.7 and the f-sharp preview so as a quick summary here f-sharp 4.6 we shipped anonymous records we've made improvements to those and the tooling for them over time works pretty much everywhere and there's been tons of performance improvements in the compiler and the tools since it was released all the way up until now and also including this release with f-sharp 4.7 f-sharp 4.7 once I fix the spelling error here I like to think of it it just sort of makes things easier for you as an f-sharp programmer it cleans up a lot of little things and especially if you're using you know these yields a lot like if you're you know writing web sharper or fable code which uses lists and as sort of like an html style dsl something like that this makes it a lot easier and then the lang version support allows you to sort of bump up to a preview try some stuff out give us a lot of feedback get access to those features wait earlier before they actually ship and then f-sharp preview is all about features right now we're just going to keep building features and shipping features starting now pretty much all the way until the middle of next year before we start stabilizing for the .NET 5 release so if you want to get started with f-sharp 4.7 there's just a single link you got to go to you just go to aka.ms slash f-sharp home this takes us to the f-sharp home page on the .NET website and if you go there there's just a big old button that says get started it'll take you to download the latest .NET SDK and you can do that you'll have f-sharp 4.7 already available and then you'll be able to get off and go running with it so all right is it time for questions I believe it is so um as I came in Mika thought you know because it's my turn it's like hey I'm gonna I'm gonna write down some some cool f-sharp jokes and I'm just gonna read them in the order they were given okay you let me know if they're funny actually sorry Seth I have to pause you it's not pronounced f-sharp it's pronounced f-octothorp or foctothorp for short there you go so that was f-sharping fantastic ooh what the f-sharp is f-sharp like I like the courtesy lap Mika we're only getting courtesy laughs on this one just fyi next one knock knock who's there f f who f-sharp I didn't see that one coming I know I mean it's really good stuff here's the first one by the way from Jeffrey Huntley from California uh-huh overheard I think the C.A. is Canada or it could be California what do you think only Jeffrey can tell us Jeffrey Huntley from California or Canada I mean it could be I'm gonna I'm gonna get the pencil out of the way here for you overheard Ionite project has millions of downloads yes indeed nice what's the Ionite project the Ionite project is it's I like to say it's the f-sharp that's sort of the official f-sharp plugin for Visual Studio Code it's built by the community but it's something we've also worked with them a lot to make a lot better because you know frankly a lot of people use it and so are we coordinating with them especially in some of those performance improvements that I talked about fantastic so here is from Heisenberg himself why is f-sharp so complicated there is a myth that f-sharp is complicated what say you Phillip I don't think it's particularly complicated there's a lot less syntax that I need to do to actually get my work done you know as C-sharp is a wonderful language but I kind of get lost in the Curlies a lot and so yeah you know I will say that as soon as you think functionally it changes the way you write your code everywhere else except my first functional language I'm gonna go way back was 2007 it was f-sharp before it was even released I wrote a blog post on my little blog it was like the first one I had ever written and guess who commented on my code Santa Claus it was Don Sine who is the f-sharp Santa Claus he's like this is really nice you could make your code better by doing this it was pretty good so thank you so much Phillip absolutely we have coming up next tips and tricks on moving to .NET Core with Kathleen Dollar but before that we're gonna go to just a tiny commercial break let's take you to that right now hey there treasure hunters our friends at Preemptive have your next clue provide the secret key to unlock the treasure the landing page will guide you go to this URL to find that secret key figure out what it is whisper your response to the .NET bot in the Visual Studio Twitch channel and you could be well on your way to the next step in our technical treasure hunt in this video we're going to talk about how to get involved with .NET and the whole community in general so I brought Scott Hanselman along who's kind of an expert at this I don't know about that but I want everyone to feel as welcome as possible and we have such a great community and so many great resources I'm excited to sit here with you and share them with everyone awesome so we actually have a website completely devoted to the .NET community you can go to .NET.Microsoft.com and just hit this community tab and first off we can talk about meetups so we have an awesome meetup site for .NET events happening all around the world you can find something local in your area or if there's nothing local in your area make a meetup right we've got meetups everywhere there's hundreds and hundreds of meetups out there lots of groups but maybe the meetup is too far away maybe you should make one we'll actually help you make a meetup we'll give you a section on the site here we've even got presentations and sample code for you to start giving your first talks at your new meetup that you will make in your town definitely so next up we are pretty active on Stack Overflow Twitter and GitHub especially Twitter we're always talking about the latest and greatest stuff we have about so if you want to follow any of our Twitter accounts they're all listed there GitHub is often where I hang out again so much of our development is open source so we directly interact with you our users on a regular basis so it's a good way to immediately engage with our development teams but these aren't the only places that we hang out there's a lot more so if you keep scrolling down .NET and the .NET community is everywhere that you want to be so if you're not comfortable on Twitter or GitHub or on Facebook we also have places where you can talk to us and interact with us in a video or a podcast format we've got regular shows and regular podcasts as well as a community stand up where we just kind of talk about the community and we'll interact live with you on YouTube chat yeah and that's every week next up so we do have very a lot of blogs coming out as well as Gitter and Discord channels if you want to hop immediately on a chat we have channels in there for beginners as well as people who really want to just talk about C-sharp designs and all of the various things we could do with the language another thing that I want to point out if you don't mind scrolling up a little bit is the .NET Foundation website we could open that up in another tab .NET Foundation has got a bunch of resources for you to dive into projects but if you scroll down a little bit there's a section on yeah these are all the projects look how big the community is isn't that great yeah we're down here and a little bit farther down you see Jasmine and there's find a meet up and then a little bit farther down we've got keep going resources build your own event look at that browsing resources free workshop code free presentations this is a way for you to jumpstart your own community all of these things are available to you but it all started at the .NET Community website so check out the .NET Community website to figure out how to get more involved thank you so much for watching the Visual Studio intro series we have tons of other videos coming out on C-sharp and .NET Core ASP.NET be sure to check those out welcome back treasure hunters I have your next clue from our friends at Twilio and they have this to say sometimes a song in a moment becomes so intertwined it becomes impossible to distinguish the two one such song one that created one such moment is the answer to this puzzle but can you roll with the punches and discover the song the answer lies at the end or maybe the beginning of your Twilio quest go to this URL to get started and find that answer whisper your response to the .NET bot in the Visual Studio channel and you could be well on your way to the next step in your technical treasure hunt hi this is Kathleen Dollar from the .NET Core team at Microsoft and I'm here today with Rich Lander to talk about some tips for moving to .NET Core how you doing today great so the way I kind of think about this talk is I often meet with these big customers who come to campus and ask us for guidance and I'm like pushing .NET Core and they're like Rich don't lie to me you know tell me the truth tell me how it really is so this is supposed to be the how it really is talk for moving to .NET Core right we're certainly we're certainly aiming that direction and we're so we're going to be going into a few places you might not really expect us to go including spending some time on making that decision about whether to go to .NET Core and when to do it so let's start out and no lying we're not going to lie to you we're going to try really hard not to lie to you okay so we're going to start out like I said with should you do it in the first place should you pour it to .NET Core how are you going to prepare for it and then some tips about porting it but that's actually not the biggest part of the talk the biggest part is the setting up which I think is going to be the experience you have as well kind of like how to make the plan how to make the plan how to carry how to detail that down to being able to carry it out so before we do that I think we should start with why do it in the first place what's good about .NET Core because then we're going to talk about some pain points and I don't want to do that without first saying why bother and so these are some of the benefits for .NET Core we think for a lot of people the side by side installation which is that's installation of the runtime that also can be one of the pain points and but it's a benefit in that you can have two applications on the same in the same space two applications on the same VM or the same machine and they're each running their own copy of the runtime which and don't interfere with one another at all not at all all right it's also faster it's cross platform and open source and it will be getting new features while .NET framework is now stabilized yeah it's faster though it's one thing we actually forgot to say it's faster and uses less memory it does and that's super important because when you actually measure just one little piece of code you can see the speed of that but what's much much harder to get a handle on is how the allocations going on in the background are increasing your load for GC and then you wind up with GC pressure and kicking in a GC so allocations are super important for a couple of reasons that's the main but yeah the simplest thing is if you have a hosted environment with servers you can pack more apps onto the same machine right all right let's go all right so you can find out more about the .NET Core 3 features at this blog post which did great blog post so since Rich wrote it he's pretty excited about that so should you move big question all right we're going to look at a couple of considerations and we're just going to walk through each of these yeah and there's just one tiny bit is you know I've been on you know talking to customers on campus but also I've been to customer sites I think mostly in the United States but maybe in other countries too definitely in other countries and you know this question is very real because you know different companies work different ways but a lot of times you have like a higher level manager who's resistant to change and they're like you know show me why we should really do this and is the risk that is it low yeah so this is some of the things you can do to establish specifics about what it's going to take and where you're going to get get value from it we definitely encourage you to go if you can find the value and that's why the benefit slide is super important and I hope that when you come back and consider this you'll you'll will explore the great things about .NET Core but not in isolation oh you want to look at those alongside the the cost so before we go there can I just say one more thing which is yeah yeah back to these managers that are resistant that you kind of have to prove this to I was at this one customer let's say I think it was in last spring and we did this project with them and the the management was was kind of resistant and we did this prototype we spent like a day upgrading their app we're actually able to give them real numbers if they were like whoa this actually looks pretty good and this was with that real was it performance numbers yeah it was performance okay this is back in like preview three yeah and not .NET Core yeah well now we ship too yeah it's great okay so uh before we get into some of those specifics I do want to look at some other concerns that are kind of things that aren't the right reasons to make a decision so let's take a quick look at these and so the first thing is yeah if you're worried about .NET Framework not being supported that's that's not in and of itself a good reason to move so it will be supported for a very long time yeah I agree I understand that in response to that you might say hey but there was this thing whichever thing it is that you that comes to mind and .NET Framework is actually really different that anything that's been out there before that's gone undergone a similar change and the first reason is that it's a Windows component and so it's a critical it's part of Windows Windows can't Windows needs it it's literally on the Windows DVD if we still have those the DVDs for those of you that remember what a DVD is yeah so uh then also it's used heavily within Microsoft and it's in fact Visual Studio yes that's an example Visual Studio is a .NET Framework application right now so and then the biggest reason I think is that this is not something this change to .NET Core and .NET Framework splitting a bit here it's not only to freeze up to do great things in the future with .NET Core it is definitely to do that but it's also to say there are oh we don't even have a good estimate of how many apps they're out in the wild millions and those that's that's working it's working and it's getting things done for people and so stabilizing that aspect of our ecosystem is important to us and important to being able to set it for the future with this base of existing apps being solid where they are so I think it's super important to think about there's great reasons to go to .NET Core being afraid that we're going to pull the plug on .NET Framework isn't one of them it's not one of them yeah couple other things you need NT services cool we can do that sorry oh and then licensing so if you're concerned about our license we are MIT and we think that that is a good license for business and if you want to hear more about that let us know and we'll get rich to write write a blog post yeah I'll just say one tiny thing about that and this is where I've talked to several customers some of them very very large so our source is MIT which is the part that's friendly to business but a lot of customers want to hear from us that they're still installing Microsoft provided software and when you actually go download .NET Core from the website that's actually like a Microsoft build and it's a if you want to think of it as a Microsoft proprietary product feel free it is built from open source but it's you know supported by Microsoft and it is a Microsoft product so there's nothing scary there at all so if you want to use the word open source you can some people really love that and it's true if you want to use the word like you know Microsoft certified and supported you can use that word too and it's also true it's both true right it's both true we sign it we also provide the source code for people like Red Hat to build it separately so we are we we've worked really hard to be on both sides of this we're kind of doing all the things we think it's great to be both at once and we think we're hitting that so Microsoft is still you know we're still nobody's going to be think crazy we're still a commercial we're watching it very closely we approve every commit we're watching it very closely it's very safe at the same time we do take commits from the community we're thrilled to do that and I think it's worked out really well okay so let's get into those specific questions and the first one is is your application in active development because if you only open your application occasionally and it's to do very small things like change what the current year is you're just not going to gain a lot the new features well there's the other side of it is maybe it's an enormous app that has a very slow rate of change that's probably the one that you most want to think about is if you only have this one developer left who's working on this mega app then you would that may not be the best thing to move to Dynacore it has to be under active development and you kind of want to have it some kind of team and I want to kind of clarify that it's because the active moving will put it under active development and so if that's sensible hey then that's great that's actually a perfect way to put it yeah it's it's going to force it so we'll talk a little bit more about thinking about that the frameworks we have some stuff that's not going to be there most things are there WinForms and WPF there now in 3.0 and then there's the Windows compatibility pack will bring some more things in so there's a number of things that are actually there but there's some important ones that aren't going to be there I think a couple of things of app domains are there aren't there or is that completely no so the app domain type is there and some of the basic functionality like for example getting the list of assemblies is there but the fundamental concept of app domains is definitely not there right so it it doesn't make sense to do things in a particular way on .NET Core for some of these things and so they're just not there so that's if you're in if your web forms you're looking at a pretty deep reconsideration of your application can I say one more thing about the last slide you could always say one more thing Rich so one of the things we've been doing over the last years last few years is it's like okay we're going to bring more functionality into .NET Core that you used in .NET Framework and kind of our and we definitely did that in .NET Core 3.0 we brought Windows Forms and WPF and those were obviously very big projects that is the end of that journey of bringing more .NET Framework functionality into .NET Core so we feel like we did a great job we took a ton of customer feedback we added like if you look at between .NET Core 1.0 and .NET Core 2.1 we added 40,000 APIs and that's not even including what we did with Windows Forms and WPF so we feel really good but what we did but this is the end of that particular phase so there are these all these things on the right hand side those are not the next candidates we're going to bring back though those are going to remain on on that list on the right and now we're going to go do other things but not not more .NET Framework functionality right so waiting to see if web forms or WCF exactly sorry it's just not in the cards so and there's some good reasons for these none of this was arbitrary it was all we took a very deep look at all of these things how it would impact .NET Core and where we felt that it was was not going to come forward with enough compatibility without being inconsistent with .NET Core it went on this list so it's yeah all right so next thing is to talk about support policy doesn't that's not exciting yeah I remember when I first before you worked here I was telling you about the support policy do you remember that that's the MVP Summit yeah and I was like I was talking to you and Julie yeah so the support policy is different for .NET Framework and .NET Core so I'm gonna talk here for a minute about the .NET Core support policy and in we a year ago in December not quite a year ago we released 2.2 and then 3.0 we released like right now we just released it yesterday that's where we are so let's look at the schedule going forward because we've announced the schedule and we think that's a great idea so you know what it's gonna be so first of all in November we're going to have 3.1 and we're calling that LTS which is long term support and I'll explain what that means coming up after that we're gonna have a major release every year and every other year it's gonna be LTS so this LTS thing is is pretty important so you can think of it like a second train and along that second train track we have LTS versions and one of the reasons this visualization is kind of important is that it's hard to jump across the track in between so for example if you're on .NET 5.0 and you want to get back to 3.1 because you want to jump across halfway through you have to go back to 3.1 which may not be an easy thing to do so your best bet is to pick one of these tracks and then be able to commit to it that's the best way to go about it so let's talk about the specific support policy and here's a link to it it's you can go read it and everything here is a visualization of that this is it's true this is my picture so first of all what does LTS look like the current LTS today is 2.1 and we have announced a special date for it which is August 21st of 20 it was released 2018 so it will go out of support August 21st I think that may be 23rd there I may have a typo on this slide of 2021 that's a minimum yeah it depends on when yeah it depends on when we ship 3.1 but I guess I guess that will be the date actually yeah yes yes it will it is a special date for that one because it was we were settling on the final policy right then had been discussed for a while before that but that's when we committed to the policy so there's kind of a special date on that one all of these are minimums we could extend support further it hasn't been our pattern so I certainly don't think you want to count on any of these extending beyond these dates it might happen but so 3.1 it's three years from the date of release it's actually three years from the date of the release unless we run late on the next release and then we expect to go a year past that but the easiest way to think about it is three years that's the easiest way to think about it so what's the current then that's what LTS does current track is 2.2 will go out of support on December 23rd of this year Detonacore 3.0 which is releasing today will go out three months after 3.1 ships go out of support go out of support sorry yes go out of support at three months after 3.1 ships we don't know exactly what the pattern will be around 5.0 and the reason is that we don't really anticipate point releases at this point in the 3.1 timeframe we don't really expect meaning a 3.2 a 3.2 exactly we don't we don't have any plans on that there's no plans for 3.2 or 3.3 we don't know what our plans will be for 5.0 so we could see a 5.1 or a 5.2 we just don't know yet so that's what we can look forward to so you can see that the support is significantly smaller and this is not to scale the stuff on the left is a bit more spread out than the stuff on the right yeah so the thing I'd like to add on this is if we look at say 3.0 to 3.1 in particular the level of kind of migration cost between those should be extremely low absolutely so you know in terms like the thing that I would be doing if I was trying to interpret this like if I had a team building an application I would just always stay on tip I would just stay on the latest version and then my team would get all the benefit of all the latest features and I know that the Microsoft team is trying to make those as compatible as possible and you know probably my server costs are going to be lower than someone else's who doesn't stay on tip yeah this is absolutely true because it not only are you going to be getting the new features so nullability is you would get that if you are on 3.0 right now if you're in the LTS 2.1 you don't get nullability you don't get async streams all the great stuff you're hearing about you don't get F sharp 4.7 all the great stuff that we're doing you don't get that or all the new docker limits support that we added in 3.0 or like the much smaller SDK that's in 3.0 right performance yeah a ton of performance there's a lot of reasons to stay on the tip however we feel like it's important for it to be your choice absolutely not our choice so this is why we offer this alternative commitment that occasionally once every couple of years we'll mark one and say we'll support it longer so if switching versions is a problem for an individual project this isn't a company-wide decision it's per project if that's the right thing to do go for it right we are running a little bit behind so we're going to have to kick it up a bit I just want to say that one more thing real quick is the .NET framework the error just goes right across it just goes it keeps going okay so let's we are going to kick it up because I realize that we're running a bit short on time Rich is talking too much yeah we are I'm talking too much too so one of the things is that you're going to be managing your own security updates for .NET core and in .NET framework the security updates are part of Windows updates we're not going to go deep into this the reason it's sometimes on you deploying is that you had to make sure there was the right .NET framework on that machine that you were deploying out to but you always have to do that make sure it's there and it won't be there from Windows Windows update from Windows update Windows it's just not part of Windows and there's good reasons for that so that we can change it and we can move forward third-party dependencies ask how do we ask today we go to search engine go for it third parties mostly have a statement now let's prepare so preparing to .NET core is going to have a couple of steps we'll walk through these again the first one though you just want to move to a recent version if you're back on 4.5 or even before oh my gosh any problems you have moving forward settle that first right because there were there were a few points in the .NET framework journey where we made significant changes breaking changes and you need to kind of make sure you've gotten through all of those those waves of changes because like 4.72 and later are the most similar to .NET core so that's really why it's so valuable to validate that your app runs successfully on 4.72 or 4.8 yep and then you want to know how you're going to validate success what does that look like test coverage is one great number here but so performance metrics is going to be important too we expect it to get better but checking that's always a good idea yeah so back to those stories that I told earlier so those those developers that I talked to they had performance tests which they ran on the old stuff and the new stuff and then they were you know then they just did basic arithmetic to figure out which one was faster but if you don't have those things then you're kind of just a finger in the wind to set up which is not really science yeah you definitely don't want to be there so evaluating architectural changes there's a couple things here we're going to bounce through this because I think the slide to come back to it this is deep consideration on your part we're throwing this out there and then you can come back to the slide and say yeah I want to spend more time on that topic so first of all if you have a library that can target .NET standard 2.0 you absolutely want to do that that's what's supported on .NET framework you want to limit architecture framework changes during the port because if you say oh I'm going to change a bunch of stuff and port at the same time you've really made your the whole effort is going to be uh crazy it's going to be hard and then it won't be obvious to everyone why this why the build is breaking is it because of my migration or is it because I actually made some bad plans or it just can be a mess but before you move you might want to look at a couple of things and one of which is the isolation of concerns so if you're using WCF and only once you know for one task but it's spread all over your application start by taking all that into one library so that you can replace WCF in just one place that's what we mean by isolation of concerns and then there's something called the .NET portability analyzer and uh we're I'm going to walk through this just real quickly it's a visual studio download you can get at that link it's a uh it's an extension to visual studio and after you run it you get a spreadsheet and I'm going to start with a portability summary and I did two these are both just standard .NET framework applications for win forms and web this is a web MVC and let's look at the difference right here this number 34 percent that says we're in trouble ASP .NET MVC you don't just do a straight port on it it's different work we'll talk about that in a second but you can see that number if you look at get it back here if you look at win forms you see 77 point 77 percent which is still a little bit low but you can immediately go and find out what you've got and I think that I just don't have the right SDK here and that there's some the work that I can do that's going to move that over the way that you define windows forms itself changes the way the project file looks between framework and core and I think that's what causes this because yeah you can see almost all that stuff it's supported actually all of yeah all of that's supported so this this one was probably pretty close to 100 percent actually it would have been except that we changed from a dependency to the SDK and that's what caused the problem I see so this isn't quite so so I'm showing you this because we want to again show you where you might trip a little bit and when you see this don't panic and think you're not going to be able to move win forms it's just that the way that we define it isn't this tool doesn't handle really well all right so portability analyzer yes all right so we did a little demo of that and going back to porting your app what do you actually want to do yeah this is the active phase and we are updating these apps today docks docks docks docks I'm sorry we are updating the docks today right now there's a PR we don't know the state of the PR at the moment right but within the next 24 hours it should be merged so the right content will be at that link right so you want to choose the project to port we recommend that you look at the ones with least dependencies and test projects early on and then you'll change project files and code differently test projects early is that obvious if you move early with them it's going to be life will be better actually so I don't think it is obvious so yeah this helps this helps shine the light on what the heck it is you're doing so I think this is great advice all right project files project files is going to be a big headache for you we'll just tell you that up front it's going to be a little bit headache on this so right now they actually showed something in the keynote that I just want to mention in passing Olia showed a tool and there wasn't much background given on that and what I want to clarify is that's a prototype that is really got it's going to work in some easy cases and so we're trying to understand how you perceive that process of moving your project file so we have normal channels that you can give us feedback on that which is the upper right give feedback in visual studio or if you don't have to go to githubribo.net.core be a great .net github.net slash core .core slash core slash core sorry all right so you want to create a new project file and then allow globbing to bring in your actual files .net standard libraries are ready to go WPF WinForms console class library they should be pretty straightforward ASP.net is going to be a little bit harder you're going to need to replace certain aspects of that and the IS integration cases yeah and you're not just going to want to try to make this a straight port this is going to be taking the new ASP.net core which is vastly improved it's a fantastic piece of work you're going to want to take that and then move your old code into it I realize now that we've made the slide slightly incorrect it shouldn't say plan to replace IS integration ASP.net core also has IS integration it's just a little slightly different it's so integration only in that where you are counting on these features then they're going to be different and we still you're still going to use IIS you're right we had a we had a poor and we have one more slide and then we're going to get to try to take some questions we ran a little bit over here so web forms we suggest that you look at Blazor and the reason for that is that Blazor is an event model similar to the way web forms is an event model and so if you go to Blazor it's going to be easier for you to take your ideas forward so should we move to questions I think we should move to questions yeah yeah yeah are we at that time all right okay so moving to questions so Rich I thought this one would make you smile doesn't look like a question to me Rich Lander Rocks so looks like you have a fan wow the first one let's see okay so let's look at real questions now okay let's see what's a good one is .NET standard going to move to v5 when we get .NET 5 I don't think we know well I think the first answer is that's unlikely because we have a different numbering scheme for the two so I mean the num do you mean will there be a .NET standard do you mean what the number what the it just is whatever the question was I don't think it'll be v5 and we haven't figured out our .NET standard plan going forward okay let's move on to the next one from Bill so in addition to the releases on their product plan can we expect bug fixes and other updates on a fairly frequent basis yes it's basically monthly yes monthly great that's easy I like that question let's see this one's from Simon hi would you recommend to move from a ASP .NET website on .NET framework to .NET core other question could you provide a download link for the try convert .exe would be great so first of all it all depends on whether you should move and a part of that is going to be we as the improved performance a simpler pipeline model and a more consistency between web API and MVC if you're doing MVC that's MVC world if you want to use Blazor yes you're going to go to .NET core so maybe depending on the future of your app and how active you expect to be in it ASP .NET core is a fantastic piece of work this is where I talked about prototype the try convert application that global tool which was talked about in the keynote is actually not available today and whether we put that out for the limited usage that it would actually be successful in I don't think we've decided yet so there may be that will let people know but right now what we need to know if that's important we would like to do it right and that tool works in well constrained boxes it does not work across everything that you're doing and so we would like your feedback about that particular tool and idea and what you need on that do we have another question yeah there's another one from Sean any major changes to .NET standard and or the recommendations of using .NET standard do you want to take that a few more to sure there's no real changes so .NET standard 2.1 is the latest one and that's the first one not to support .NET framework so if you want .NET framework you just stay on 2.0 but that's that's about it okay we have some more questions how much effort is required to move an ASP .NET NVC core 2.2 to core 3.0 is it automatic it's not automatic we actually me and two other people ported the .NET core website sorry the .NET marketing website so that's the one that's at .NET.Microsoft.com it was actually fairly straightforward but it is work the only thing that we ran into that was weird was the way that ASP.NET core handles localization we ran into some challenges there but everything else was pretty straightforward it wasn't much work okay awesome here's another one what about SSRS web forms render on .NET core 3 yeah so that stands for SQL Server Reporting Services that will not be supported because it's a web forms thing okay let's see okay we have time for one more what about moving C++ slash CLI projects to .NET core that'll be supported in .NET core 3.1 okay and we're very very proud of that that's a that's a great piece that we've we've got in there we're happy to do that okay awesome so next we have azure app configuration making centralized configuration easy with Jimmy Campbell Jimmy take it away awesome so my name is Jimmy Campbell I am a developer on the azure app configuration team I'm excited to be here today to talk about our service and also to celebrate .NET core 3.0 I've been a .NET core developer since beta 8 and definitely a lot of change since then and I think that azure app configuration is a great tool for a .NET core developer to add to their arsenal whether they're developing modern global cloud applications microservices or maybe just sticking in a DevOps pipeline whatever configuration is all across the stack so a centralized configuration service really makes a lot of sense so what ended up happening was we saw a lot of problems with configuration the way applications are moving today some examples of some of these problems might be how do I centralize application centralize configuration when I'm running on an azure function I'm also running in Kubernetes I'm running on some VMs that I own and I kind of need to share settings between them or maybe something like I'm running apps in North America and I'm running in them in Europe I need to share settings but I also need them slightly nuanced because the application just needs to behave differently in North America or Europe to more advanced use cases like wherever I'm getting my configuration from how do I dynamically update it during runtime and so configuration is a very fundamental piece and there's some common problems we saw people trying to develop their own solutions that comes with the cost we also saw things like people tried to use things that weren't necessarily meant for configuration and then they would eventually get to a point where they got stuck because the solution they were using just wasn't designed for that so it really made sense to make this service azure app configuration which is been in preview now since April yes April and we got on this and now it exists so a centralized configuration service for .NET Core developers specifically we offer things like a configuration provider simple similar to the json file provider in .NET Core things we have a SDK a configuration client where you can write read settings but I think first of all what I should do is get started saying what is azure app configuration it's an azure resource what happens when I create it what do I actually get when I start using it and so we'll kind of do like a getting started right now so I'm going to go into my command line and get started with azure app configuration from the CLI .NET Core has a pretty good CLI and we're all developers here so I think we can kind of enjoy the automation opportunities that come with the CLI so I'll go ahead and get started creating my first azure app configuration so I'm using the azure CLI now as denoted by az and then app config is our command group and I'm going to create an azure app configuration .NET com demo my resource group is going to be Jimmy CA config one I already have configured and I'm going to have a location of central us so what am I getting when I create azure app configuration so it's an azure resource and I'm going to get a place where I can store settings settings and our model are stored as key value pairs so you may have a message which is hello world or something like that just a simple key value and that's really what we store at the foundation we do offer metadata on top of that so you're storing your settings and they're available to you through a web endpoint so if you look on the config that app configuration instance that I just created my endpoint that has been allocated to me is hdps.net conf demo that az config.io so now I have a REST API listening on this endpoint that was allocated just for me where I can start creating settings in a central manner start consuming them in all my applications my DevOps anything that really speaks of REST API can start writing and reading settings from this app configuration instance and of course the CLI is one of the things that can do this we can go ahead and create our first setting here now that I just booted this up az app config kv for key value set I want to set a key value so the name of my store is .net conf demo I have a key I want to create color pretty typical setting name and a value of blue all right so now we just use the CLI the azure CLI to create an app configuration instance and create our first setting all right this kind of shows some of the automation with the service so you can kind of run these things in a script or whatnot but now we're going to go into the portal and we can show the UI for this thing and we can kind of get the best of both worlds so I'm going to go into the portal here let me refresh the page I'm going to see this .net conf demo now everything I've done in the CLI can be done through the portal and also the things that I do in the portal can be done through the CLI we look for feature parity across both and so if I wanted to create my app configuration through the portal I could have created it through create a resource and I create settings through configuration explorer all right so here we see the setting that I created color and then blue simple key value pair to represent a setting and then we see some metadata on top of it label last modified content type the one I actually do want to mention before we get too deep here is is label so key value are definitely important because you need those to have a setting but label is something important to our service because it can be used when you're querying settings and it gives you a way to add a new dimension to your configuration for example I may have an application that runs a premium and a standard skew and I might want the color to be green and standard and I might want it to be red and premium or something like that and so I can kind of model this with label it's not just a metadata it's not just like a tag that when you get it it's actually used in queries so when you query configuration you can say give me all the settings for the standard label or give me all the settings for the premium label so this is kind of what I talked about before where I have nuanced configuration maybe like a West US or North America and Europe stuff like that so label is something important for our service layer so now we have the ability to create settings we know what it kind of means to have an app configuration instance how I can create settings for it I want to go a little bit further into the portal here before we leave it just kind of get the coverage we see some other things down here in operations such as feature manager feature manager is a value on top of just simple configuration I can probably go into that into another time but we also have some configuration utilities down here we are storing configuration and we're a configuration service so it makes sense for us to have utilities like for example I need to restore my configuration to what it was yesterday because it worked yesterday but it doesn't work now you can do that through the restore tab so you can select a day of what my what I want my configuration to look like for example on September 11th I didn't have any keys so it's saying hey do you want to delete these keys I can compare settings I can compare across app configuration stores I can compare across labels so like I said I have a premium and a standard app I want to compare these things I can see oh red and green and I can also do import and export import and export is really valuable it's actually my favorite thing because especially when you're bootstrapping app configuration from a .NET core developer point of view you probably have app settings.json something along those lines and we support the ability to come in from a configuration file import settings we also allow export of settings to a JSON file and this can also be done through the CLI that's that feature parody I talked about all right so that is kind of the background for app configuration the portal CLI interacting with it and now that we know how the settings are represented and how we can kind of get started it makes sense to move into a .NET core app that's actually utilizing this and so before I do that let me go ahead and use to another app move to another app configuration that I already allocated this one doesn't have any settings yet but I'm gonna show the import I talked about from a configuration file I'm gonna import some settings appconfigwebdemo.json I'll actually show that file it's just like an app settings json file if you will and I imported it into my configuration store and now you can see I have all these settings here they all start with webdemo colon that's kind of a prefixing practice I may have multiple apps configuration sets stored in my single app configuration and one way to separate them is by namespacing them so all these are from my webdemo app and they all start with webdemo and now I have these settings here I can start consuming them na.NET core application so let's move into an ASP.NET core 3 application that I have this is a ASP.NET core 3 razor pages application it's doing very little actually the main point to get out of this app is that it's pulling the configuration from app configuration and the way we're doing that is we're binding our configuration to a model called settings and you can see there's kind of a one-to-one mapping here refresh rate languages these uh these all map to settings here and we're binding them to that model and we're using those properties in our razor view so essentially we have like a one page app pulling configuration and just using those settings to show what we're seeing on the web page the very simple way to demo the configuration now the typical practice and .NET core for configuration is to use a configuration provider .NET core comes with a few very common ones like json file configuration provider environment variable configuration provider command line etc we offer a configuration provider it's the azure app configuration configuration provider and so that is what's going to be showing right now on my program cs on top of the one on top of the environment variable and json file providers that come by default and default builder I'm wiring up azure app configuration and so it's these lines right here this api add azure app configuration is exposed by the nougat package right here microsoft.azure.appconfiguration.asp.net core so I just need to add a reference to this to my esp.net core project and then I can go ahead and start using this api okay so I go in I call add azure app configuration and then I need to do a little bit of configuring to actually set up the app to pull the settings from my app configuration instance the most important thing is I need to connect now what I'm doing right here is called connect with managed identity this is a feature that we utilize on azure platforms that are running applications that support managed identity these identities can be assigned to these azure platforms in this case I'm running an app service so I assigned an identity to my app service and I granted that identity access to my app configuration instance so I can actually go into my app configuration instance and I can look at the role assignments and I say oh I granted access to my app service and so using this flow allows me to short circuit the other way of connecting that I'm going to get to it allows me to well I can short circuit connection string basically and I can take advantage of the fact I'm running an app service I'm running my .net core up there but if you don't want to do that that's perfectly fine you can just use connect and you pass a connection string the connection string comes from our portal or our CLI you can list it there and then you would just provide it in the bootstrapper app but since I am running this app for the demo in app services I can utilize this way of connecting and one of the great things about this is I don't need any configuration to bootstrap my configuration because as you can see I'm not using a connection string all I'm doing is specifying the endpoint of my app configuration instance okay moving on to some other options used in this we have a little bit of filtering here this use is just specifying a key filter because I mentioned that I kind of wanted to segment my applications and in this case I have them all namespaced by a web demo column all right and so I'm selecting only those then finally we have this configure refresh and this links back to what I talked about before where we have a notion of wanting to dynamically update configuration during the runtime of our application because some application designs depend on this behavior and so before I go into configure refresh I actually want to talk about where the refresh is triggered and so I'm going to go into program or start up cs and we see this use azure app configuration this is the only other place where any azure app configuration code is found in the application and what this does is it wires up a middleware inside of your asp.net core app that uses requests to actually trigger a refresh of the configuration if you are using our configuration provider previously you may have been aware that we were using a polling model before and now we switch to a middleware model and the reason for this is that when you're polling for configuration especially in a microservice world you end up maybe just using a little bit of unnecessary resources if you're doing that continuously even if the application is dormant with a middleware based approach we can be smart about when we want to refresh our configuration if you have 10 apps maybe not all of them are always getting requests your load balancing or something like that only the ones that are getting requests need to really be triggering configuration refreshes when the other ones start getting requests then it makes sense for them to start triggering refresh as well and so that's what this does right here request based refreshes now we can go back to where we're actually configuring the refresh because we know that refreshes are being triggered but what actually what does it mean to trigger refresh and that's what we're configuring right here essentially what we're saying is what do we want to keep up to date what's setting so we want to refresh every setting maybe one or two settings that are really important that need to be dynamically updated during the app that's what's configured right here in this case I'm watching a setting called web demo sentinel and not only am I watching that setting I'm specifying something called refresh all which means when that setting changes when I notice a change in that setting I want to refresh my entire configuration just like I did when the application started up so I want to go back to app configuration and just get everything again that's what's happening right here and so with that that's the full setup of app configuration in my .NET Core app now I can actually see it in action so I have this application right here it's blank right now because I didn't have any settings before but I uploaded some JSON settings and if I refresh the page you'll actually see that I have some configuration from Azure App or some settings some data it came from the settings it came from my Azure App configuration this came because I uploaded that JSON file but to kind of give a better view of that we can go in and edit some more things right now let me show the values for these let's change the background color to green maybe increase the font size just kind of do what we can to make the changes very apparent and also make a better message so now what actually happens if I refresh the application now nothing is going to change because we're only watching that sentinel value like I mentioned but as soon as I update the sentinel value I just need to change it I don't really it doesn't matter what I change it to the application can start picking up the changes to all the settings that I updated so we're going to start seeing the change to the green color high .NET Conf bigger font and so this kind of just shows dynamically updating settings during the runtime of the application so to get started all you really need to do pull in the NuGet package Microsoft to azure.appconfiguration.asp.core that's if you want to build an ASP.NET Core app if you're just building a .NET Core app ASP.NET Core is involved we also have another package called Microsoft.extensions.configuration.azure.configuration it uses that common configuration provider namespace that one doesn't pull any ASP.NET Core stuff into it so if you're just building a console app or maybe a hosted service it makes sense to use that it's still going to give you the ability to do refreshes it just doesn't give you the request-based refresh middleware but you can refresh the configuration yourself on demand all right so that's the .NET Core scene but for .NET Core developer just developing applications isn't the whole picture there's also you need to build and you need to be able to release your applications so we've been seeing a lot of mention of azure devops for this these kind of needs and we actually have a devops build and release task it is on the devops marketplace you can go look for azure app configuration and you can add it right now to your organization or project to start using it and what this does is it utilizes all the settings we put in our app configuration and it injects them as variables into our build into our release so I can actually go ahead and create a new build pipeline to kind of show off using this so create a new build pipeline here delete all the steps just to add in azure app configuration my subscription my configuration instance name so now with this task every setting that's present here is going to be available to my build pipeline and if I use it in other builds it's going to be available in those build pipelines so I can share my settings across builds now very easily if I'm centralizing them in my app configuration and I can also put my app settings there and so it kind of makes it easy to manage them in one place and have one interface that you're working with for settings one set of pools one CLI one form of automation and now to demo this I will add in a power shell task right here and I'm just going to echo a setting from azure app configuration message I don't have that yet but I can create it message hello devops cool and now when I run when I save and run this build I don't want to commit to master but I'll save and run this build and then what we'll see is it's going to pull very quickly pull the settings put them in as build variables and then say hello devops and we'll kind of have that and like I said what this allows us is we can easily have one interface for managing our settings for the applications we're building we can share these settings across all these builds all these releases just make sure to bring them in through this one build task and then we can kind of keep with the semantics of how we want to add dimensions to our configuration with the label things of that nature uh and I even want to go a little bit deeper into the devops interactability with app configuration I mean configuration is really all across the stack so applications using configuration devops is using it and there's even more room to talk about it here because as your devops is very easy to interact with the azure cli you can spin up very quickly a azure cli inline script to start doing something and so this kind of ties in to a scenario where you may have an application and you can't afford to pull settings at the runtime of your application you can't make a htp request to pull settings you can't talk to the service possibly as a requirement well if you still want to use azure app configuration it's perfectly reasonable to have those settings pulled at build time or release time package them in an app settings json file and deploy them with your application so i can go ahead and show kind of what that might look like right here and also show using the azure cli to talk to app configuration so let's hook up the azure cli task let's do a inline script and we're going to use a functionality you saw import on the portal but now let's do an export on the cli we're going to do an export all the settings in our app configuration to a json file so that's what we have in this right here app config kv export we're saying to a file we give the file path app settings.azureappconfiguration.json it's a json file the separator we want to use and the config store comes from finally let me go ahead and publish these artifacts so that we can see them at the end of the build and it demonstrates as I mentioned you want to pull settings during build you don't want to pull them during the runtime your application you want to kind of have that very consistent or it's just a requirement for when you're running our apps so let me run this build and then so this will take just a second for the azure cli to log in that's probably the longest part of using the azure cli in this build but it will produce the azure diappconfigure.azureappsettings.azureappconfiguration.json file and if you were doing this in a real scenario you would just put that right next to your app settings.json and then bam you now have dynamic settings but they came from during build time so that's pretty much all I have right now for azureappconfiguration centralized configuration management solution we have utilities managing your configuration a way to share your configuration across all kinds of different platforms devops it doesn't matter where in the stack you are azureappconfiguration can help out provide the configuration there and I guess real quick I do just want to show the build artifacts of this I did say publish build artifacts okay well there was supposed to be a json file there I maybe typed something wrong in the build pipeline but I think the idea is there it basically produces the exact same file as this and it would be present in the build artifacts I must have just typed something but yeah that's pretty much it for me all right this has been a pretty amazing Jimmy like look and I'm going to tell you this because Matthews I think you said if I say it wrong I'm so sorry I thought this presentation was going to be about app settings.json azureappconfiguration is amazing it's cool to have this other place to put that stuff and manage it it was about app settings.json kind of kind of and then the other one which was interesting which you answered there at the end but I'd love for you to reiterate what's the best way to do a fall back to offline settings you kind of showed this a little bit in your demo why don't you see what maybe he's going to tell me how to say his name I'll say Matthew American nice so how do you do a fall back to offline settings that's a good point so there are multiple different considerations when you're talking about fall back to offline settings there's what I just talked about about putting your settings there during build time and release time so you don't have to make a query during runtime so I just demoed that that's exactly how you do it I don't know like I said I probably mistyped something in the build pipeline but there would have been a json file there that could have been used as app settings json another aspect would be something that we have in our configuration provider which is called an offline file cache which if you're running on the same VM or something and maybe one time when your app is starting out it doesn't have network connection you can use an offline file cache in our configuration provider library and it will pull the last retrieved settings they write them to a file encrypt them and it will pull them in case it doesn't have a network connection so kind of two different practices for offline so probably not the first one but the second one is there as well that's right that's cool because I thought maybe you just pull it at build but then you also have a cache to fall back on as well that's cool is azure app configuration recommended for secrets like connection strings another good question all right so azure app configuration is a completely secure way to store any key value and encrypting things I mean there's no worries there authentication authorization all good however there is another service named key vault which is which is better for management or management of secrets they have things like if you're managing things like certificates auto renewal of certificates or if you have things like connection string they'll expire connection string and they have very granular access policies so they are the one like the best place to store a secret so there's nothing wrong per se with storing a connection string and app configuration but ultimately for secrets that's exactly what key vault was designed for whereas we were designed for just configuration extensive querying mechanisms things of that nature and one of the things that we're actually going to be coming out with soon is a way to reference key vault secrets in the .NET Core configuration provider so we'll go through to key vault for you in your app it kind of abstracts key vault but your secrets can still live there and that's cool because Nick had the same sort of question what's the difference between this new app config and key vault so key vault is for secrets app config is for how would you finish that sentence yeah key vault is 100% designed for secrets as your app configuration is done designed for configuration there's nothing limiting you from putting anything you want an app configuration but ultimately the like as we have configuration management utilities key vault is going to have secret management utilities the expiration secret rotation or certificate rotation things like that so those are values that we're not going to be able to give because that's not what we were designed for that's awesome does this configuration service integrate directly into azure functions so I don't need to manage the config there okay so two things our .NET Core configuration provider is net standard you can use that in an app function and pull it right when your app function starts off the second thing is I exported something to a jason file in the last presentation you can export it to an app service through the cli through the portal and so other app other platforms within azure we want to integrate with to be able to push our stuff there at azure function aks you name it on our roadmap is the ability to do this automatically via sync tasks and to just have your configuration live there but you can still manage it centrally in app configuration amazing last question is there an app configuration new get package for the .NET Framework so there is yes there is net the one I just mentioned is net standard so you could use it in the .NET Framework also we do have a configuration builders new get package the configuration builders was introduced I believe in four seven and it's kind of a net framework way to do configuration well built into the framework there and we do ship something for that so it's an agile configuration specific .NET Framework configuration builder amazing thank you so much Jimmy we have some feedback coming in on may I say their Mika's jokes that I was asked to read okay the jokes on .NET Conf I I told her that they may not work but she was adamant so maybe we should have a talk with her afterwards up next app services every .NET developer needs to know with Tim Heuer and Angelus Petropoulos did I say it right perfect off we go awesome thanks everybody good morning good evening good afternoon wherever you're watching from I'm Tim this is my esteemed colleague Angelus we're here to talk to you about Azure services that every .NET developer should know and get excited about using your apps so first I want to set the stage Angelus and just make sure everybody we're going to we're going to throw out some terms about Azure so we should probably make sure everyone knows what those terms are in Azure there's a lot of different things that we'll talk about but just a level set so we're going to say things like accounts and subscriptions and accounts is something that represents you and me our actual identities that's how we authenticate with the service a subscription is something that we can share together right that's kind of a billable unit you'll also hear us talk throughout this session about resources and resource groups a resource represents an individual unit of any service that's created in Azure and so like I have an app service is an actual which is one of the things we'll talk about today is an actual resource a resource group is things that we can group together perform some more security on establish some you know more boundaries of what can be in those services and configuration around there so we'll talk about those two things quite a bit most explicitly today we're going to talk about two things right Angelus we're going to talk about hosting and services right and the way that we think about these things hosting is you're going to provide the code and Azure is going to run it for you and the services that we're going to talk about is more you're going to provide the data and Azure is going to these Azure services are going to take some action on the data so specifically during this session we're going to focus on those two aspects of hosting and service and to do that Angelus has built a very simple application to allow us to walk through that so we have a we're going to we're going to show an image gallery right and so worth millions it's worth millions yeah we we're going to IPO at the end of this you'll want to get in at the bottom here so I think we should just like dive right in and get started and let's so throughout this we're going to cover roughly five services that are really kind of table stakes at dotnet developer dotnet core developer should want to know everybody should be aware yeah so tell us about this this site and show us the first demo here let's jump straight in because we have a lot to cover so I have the simple ASP.NET Core MVC application working here already running locally a local host it's called core image gallery I can register a new user and log in so I'm going to go ahead and log in with my demo account this is so as you're logging in yeah so what what are you using for this authentication here yeah this is powered by ASP.NET Core identity so go sets for that if you want to know more about it but the whole register with different accounts social and all of that comes kind of for free and you basically configure it and it just works and it's all taken core care of for you yeah when you do the initial configuration right that's right so now I've logged in I'm going to click upload image I can pick one from my local machine to upload it to our gallery it's going to take a little while to upload it it's telling me it did some file processing and the file will be available shortly in the gallery and I can just click return to gallery and here's the picture I uploaded and I'll open it up to show you that the processing we're talking about is just a little whatever a copyright so that we protect our millions oh yeah yeah this is nobody will steal this now yeah all right so very simple application let me stop it from working let's go back to the code and check out what I just showed you simple solution a couple of projects I'll start with image gallery dot model nothing but a class library nothing interesting here really just a class with some properties that's what we use in the page that shows you the confirmation after the upload so just showing you there's no tricks so nothing really interesting there the main project ASP.NET Core MVC I'll show you startup.cs real quickly classic stuff like we said we're using ASP.NET Core Identity we're using MVC but the thing I want to draw your attention to is we have a service an interface called I store at service and in the implementation of it with file store at service so let's start with the interface let's check that out it's pretty simple just a couple of operations on it gate get images async that's so we can populate the gallery and add image async it's just when you do another upload so nothing too crazy here close that down actually I want to show you the I wanted to show you the implementation as well yeah the one we're currently using yeah so let's go and take a look at the class that implements I store at service and this is giving away the secrets immediately you'll see here there's going to be a folder called user images we're going to put it under ww root and that's where all the pictures we upload go into it's the local store for the server nothing really interesting in the constructor add image async I have a little helper method here to get some properties out of the image so I can show the confirmation page later we just get the path here for the destination we create a stream we use a little watermarking class to add the watermark I'll just show you that real quick just you know curious I don't really know what it's doing but it works all right and then finally we just record the upload and you get to see the screen that says go back to the gallery so it's a standard ASP.NET Core web application uses mvc yeah nothing nothing special that's any cloud specific or binding us to any decisions at this point so let's but now we've only been running at local yeah this is all local and I forgot to mention that ASP.NET Core Identity uses local db so we have a dependency on SQL server right now but yeah it's a local instance of it that's right yeah so let's take this application which is a typical application it's deployed to Azure and then slowly we'll try to modernize it and make it a bit more cloud native let's do it all right so I'm gonna right click on the project and I'm gonna click publish now the one thing that we've already done is we've already created that account in subscription that we talked about yeah it's because we don't want to waste too much time now in the demo that's pretty easy to look up and you can do via the CLI through the portal it's all pretty easy here so here when I right click published I'm picking Azure App Service and because you're nice and you've already provisioned the resources for me I'm just gonna select existing and go find them I try to add value by provisioning resource groups all day that's fantastic yeah so here it's gonna access my subscription and then it's gonna go look for all the resource groups under that subscription so like you said a resource group is just a folder it's basically a nice way to organize your stuff so you can go find it easily and you can have more than one subscription and in fact that's what took it a little bit long because you do have a lot of subscriptions seven sorry yeah all right so here's my demo resource group and I'm picking my existing instance of App Service I'm clicking okay and now Visual Studio will talk to that instance capture some information and all I have to do now is hit publish but before I do that I have to make sure my ASP.NET core identity data and schema makes it up to the new instance of SQL Server you've created for me right because we were using the local DB right and now we want to use an Azure SQL provider in fact Azure Azure SQL itself but you did all the provisioning so I'm not really sure what you did there but thankfully Visual Studio will let me do everything through its options so if I just edit the publish profile so I can access settings you will see here at the bottom of the dialogue we're discovering data contexts what that means is Visual Studio is now hitting the up service instance up selected and it's asking it if it has any SQL Server connection strings because if you've already done the work I might as well benefit from it yeah so now that the spinner is done and it's real time this is real time this is real time yeah this is the communicating with our our subscription and I've already done the provisioning of Azure SQL for you and provided a connection string for you so why should I bother with that again right all that is there I can just pick it check a box that will apply entity framework data migrations as soon as I publish so all I have to do is save hit publish now what's going to happen is Visual Studio of course will build a project we'll talk to the up service instance upload all of the content then it's going to go and check SQL Server run entity framework migrations and we try to give you you know visual clues what's going on you can always go to the output window and get more verbose information about what's happening here so why are we using app service and not a VM right so VMs are great in fact if you go and create a VM to the Azure portal we even have a very nice template where it will set up IIS and MS deploy and then you can just come into Visual Studio like I did now right click publish to the VM it's all great but this is a talk about you know services of Azure that you should know about and app service should really be your go to hosting option in Azure at the very least you're getting a fully managed instance so you don't have to worry about patches and security fixes and frameworks and all that kind of stuff it can very easily scale out and scale back based on just setting some metrics and some options up it can make sure that you can keep your site running even when you're deploying into the same instance by taking advantage of a future call deployment slots like a staging and production there's many many good reasons it's your go to and don't be all these features if you don't necessarily need them don't think that it's superfluous there is different cues and tiers so there is different pricing and features for dev tests than production so maybe you don't need everything and I think one thing that I like about app services which you mentioned is you know VMs are great but there's still some configuration you have to do to kind of bootstrap them or as apps app service as we just saw you know deploying even directly from an IDE or from dev ops you know it's it's taking care of a lot of that configuration for us we know we're just telling hey we have a .NET core framework and here's my bits right yeah great okay so we deployed look the URL doesn't say local host anymore right so this is live success running in Azure right now awesome fantastic yeah so let's let's go back to the slides real quick and just kind of review those first two things so we said we're going to cover hopefully cover five services here the first two things we just were able to show is talking about two services app service which kind of is that hosting platform here app service is really great for web apps and APIs as Angelos mentioned it's a fully managed environment so you get the OS patching high availability and high scale by default with you able to kind of provide the throttling mechanisms as well within that and it's it's first-class tooling across Visual Studio family of products as well as you saw here we're using Visual Studio for Windows but we also have similar experiences in VS for Mac and code and then the second thing because we were using ASP nets identity integration we were using a local DB SQL server instance and so we were able to use any framework migration scripts to put that into Azure SQL so now our app that you know was running on Prem basically Prem being your box here is now hosted in Azure and our identity is also in Azure but we've got a couple more bits there right so we were uploading images were those images in SQL no okay let's take care of that yeah probably bad so yeah the app is running in Azure but we can do a bit better because if we want to take advantage of app service and its ability to scale out for example you will notice or you'll remember that the images are being stored under www root yeah the file storage provider that you had right so a new instance is provisioned then the folder will be empty if traffic goes to that server the gallery will look empty yeah RedX we don't like RedX images no all right let's solve that so we can go back to the demo and all right so what I'm gonna do here is I'm gonna introduce the third Azure service called Azure storage basically common thing apps have to do Azure has a service for it so what I'm gonna go do here is show you a new implementation of I storage service the same interface we saw before some simple strings and variables here we'll talk about those it's nothing to worry about but let's go back to the add image async and compare it to the previous one so here we have get image properties like before we have an upload container and we just get a reference to it this is basically a stream we can write into we then create a memory stream before we were creating a file stream because we're writing locally here I want to do the watermarking so I'm gonna do it in memory and then image blob which is a reference to Azure storage we're just gonna copy the stream into it and now the picture is uploaded now those two APIs that you're calling there the get block blob reference and the upload from stream those aren't things that you wrote right no no that's that's that's Azure that's a library that I get for free and so because we're making the decision we're using Azure storage and blob storage in this case we have an SDK available to us that allows us as .NET developers and C sharp at developers in this case to work in the language we love get all the productivity and visual studio that we like and have kind of this strongly typed interface with the service not have to worry about rest and all that that type of thing perfect so now what I have here is the app will work just as before but now it's gonna take the pictures and upload them into storage so even if new instances are fired up then they will just talk to the same instance of storage so I'm good but we can do even better when you're in the cloud and you're migrating applications it's a great opportunity to optimize and get efficiencies and modernize an application yeah and when you're on prem they typically tasks like things firing off on timers and scheduled events and triggers that trigger workflows and multiple operations and typically those things are achieved with let's say a window service running somewhere some demon or cron job or something like that but how do you do that in app service you can't really do whatever you want on that box so Azure offers you a service called Azure functions which I'm gonna use now to take the watermarking process out of the main app and just do the watermarking after the picture has been put into storage with some sort of background task great so we're identified an area where it's not mission critical to us exactly has someone's uploading and we're kind of almost like async workflow in nature to offload this little microservice that you're going to create here yeah I mean it doesn't really matter if the image takes a second or two to get what I'm asking we may lose one dollar in our IPL well I think we've got about nine hundred nine thousand something nine nine it's good we're good what we lose will make up foreign savings on azure they tell me all right so back on the project so I have a new project here in my solution called image gallery dot az functions how did I get this in here I did right click add new project and I picked azure functions because I had picked it before or I can just search for azure functions up here and I create the project now inside it I have my watermarker classroom before I just moved it over here it's the same code same code now I still don't I still don't know what it does yeah image uploaded so that's my first azure function I'm going to right click and I'm going to show you how I did that I click add new azure function you get to name it whatever you like you click add and here's where I talked before about you know you probably want to have some sort of trigger or timer so here we have the list of possible ways you can execute your azure function very commonly you have http triggers maybe you do something on the website and the website calls the function this is like get and post and correct actions here and but I also have what I want here to use in this case which is the blob trigger so as soon as the picture gets uploaded to blob storage I'm going to get told that just happened yeah so I just gave it a connection string and that's how I got it in there so let's take a look at the code there's not a lot to it I have my watermark up here I have an attribute telling me that this is actually going to be a natural function and the name can be you know whatever I want it it can be different than the name of the method and I'm going to look at my first parameter called input blob that's basically whenever the picture gets uploaded because the annotator says it's a block trigger exactly the name of the container is going to be called images and then whatever the file name is it's going to go into this variable called name so I have a string name here and I can reference it conveniently through here and then I have a second variable parameter which is basically my output so after I do my watermarking I'm going to put the contents in here and it's going to get written where into a new folder container called images-watermarked and that's also an azure storage blob container yeah in the blob container you can create as many of these groups as you'd like got it so all this will do is be notified do the watermark and then move the picture but since I'm creating these two groups and I'm moving pictures from one to the other what I want to do is also clean up after myself so I want to go and delete the original image that was uploaded so what I'm going to do is go to delete original image that's just another azure function again with a blob trigger so keep in mind you can have more than one per project sometimes it's often easy to miss more than one more than one function per project yeah okay and here what I'm doing is I'm showing you that you can even access configuration values in the definition ah so before where we had kind of you had the hard-coded blob name now you're pulling it from ASP.NET config exactly so just showing you that both are possible the other one was just easier to read got it so here what we're going to do is we're going to be told when the image lands inside the watermark container so that's after the first function has worked and what I'm going to do is I'm going to know to go and delete original one now all right so I have this working and I think it's going to work but I want to make sure it works locally before I put it into Azure and even though I'm using Azure functions something that is native to Azure I can still run my project locally including Azure storage what I have to do is fire off the Azure storage emulator this is a good point so this is another set of tools that are allowing you to do cloud development that's right but have a faster interloop development you know F5 debug kind of life cycle and the emulator you have to start it on your own because it's kind of really hard for Visual Studio to know exactly when you're going to access it and by then it might be too late okay but for Azure functions all I have to do is right click set it as the startup project and why don't I put a break point see what happens so we've started the storage emulator and now you're starting the Azure function this is going to run on the cloud now or this is also another emulator this is now the emulator being fired up by Visual Studio because it's clever enough to know that's exactly what you need and so this is a local instance of the Azure functions runtime that's running that's right and you'll notice this is the 64 bit which we added support for recently nice so VS has detected the runtime is up it deployed my function and acquired a lock to it and now the function should be working now two ways so now the function's there it's ready to listen it's yeah it's ready for the trigger all right exactly okay and since we're on the topic of working locally I also wanted to show you the Azure Storage Explorer that's a kind of cross-platform app that you can download separately similar functionality exist in VS if you go to Cloud Explorer so look that up but Azure Storage Explorer lets me interact with Azure Storage whether the instance is in the cloud or locally so here I can actually go and look at my storage account locally I can look at my emulator running I can look at my blob containers and I can actually see the two containers I had before images in images watermarked so if I really wanted to execute my Azure function locally I can literally just drag drop a file using this tool and it's going to kick it off but let's do the full thing I'm going to come back to Visual Studio and I'm going to fire up the website and now we got to run the the app itself for us yeah I'm going to run that locally and just exercise the full end to end so now what we have here as this is spinning up we're running our local process that's that's using the storage SDKs using serverless functions but running both of those basically in a in a local interloop that's exactly right we haven't published anything to our Azure yet everything is local right now local host so I'm going to do the same thing now upload an image pick a different one this time so file is being processed blah blah blah it will be available so oh that's our breakpoint breakpoint here all right so on that if I go here put a breakpoint on my delete one if I go back to upload I'll just let it go come back to my website oh didn't have enough chance my second trigger has fired off everything is happening synchronously all right it's all good I'm going to continue this now when I'm going to hit return to gallery the image will already be there and it's already watermarked that's awesome so now we can go ahead and republish these republish our app to Azure at that point exactly so what I want you to see here is if I want to take this Azure function and publish it to the cloud right click publish exactly the same experience as before I already had the profile there create so like existing same configuration the same as before not going to bore you with the same stuff awesome so now we've got we're using app service to host Azure SQL in the cloud that's right blob storage for our files and serverless for some lightweight functions that kind of asynchronous in nature we've got like four services we're running on top of the app itself so how are we going to feel good about the health of the app here okay so feedback we get from customers a lot is running things in the cloud feels like maybe they're far away from the diagnostics a little bit yeah that's not true that's not true let me show you how all right so let's go back close all this down I don't need anything local running I'm going to go to my production cluster I'm going to go to my production resource group so this is my website running in production right now and I have a report that if you try to upload an image without logging in first something happens to the app so let's go check it out we'll go and upload the image pick one scott fund check that one all right so we've got a we've got a crash here effectively this is the dreaded you know something went wrong but you're not in a development mode and you can't really get the call stack and now you're probably going to be worried about well how do I get access to logs and this is annoying it was so much nicer when I was local well right let me just show you something called Azure Monitor so now what we're going is we're logging into the portal I'm going to go back to the portal and you know how we said that resource groups are a nice way to organize your resources what I'm going to go do here is I'm going to go to my resource groups scroll down until I find my production resource group and here I get a list of all the services this resource group has provisioned and you were kind enough when you provisioned our app service instance to actually attach it to Azure Monitor what you get by just attaching it to Azure Monitor is diagnostics so all I'm doing is navigating to the instance and oh look there is a chart there for failed requests well that's exactly what I needed so I'm going to click that see where it takes me okay it was okay so there's an action post upload yep that sounds like what I just did and it lets me drill into because I'm going to keep clicking until I get to a call stack here yeah so we're able to go to the portal now and see this is almost real-time diagnostics as well of what happened and get basically to our core exception here and then so this has an end-to-end transaction it has automatically recorded for me without me doing anything special if I keep going I will eventually get to the call stack this is what we all wanted to see and we can figure out the exception there at this point all right so this says core image gallery extensions upload okay so without somebody to do something without authorization yeah I I mean it's kind of obvious I shouldn't let you upload the picture without sending in first but the point was getting to the call stack right so now I can go back to my code and see that get image properties is assuming I'm authenticated basically that's awesome so let's go back to the slides and review that what we've seen here so what Angelus was able to show is we had a typical ASP.NET core application fairly simple one at this point that was doing a couple different things and we basically moved it all to the cloud not having to worry about managing our own box and infrastructure we got hosting out of app service we've got data storage in two ways actually using Azure SQL which you know if we needed relational database needs on top of our identity we could still use that as well we're using blob storage as kind of our durable storage for objects and things like that a serverless function that is just kind of asynchronous and actually by the way we only pay for that when we call it that's right so it's not this long-running process and then we have really rich insights and monitoring into our app so there's a ton more in Azure that we could do as well we didn't even talk about containers and things but that's kind of like the next level that I think you know an enterprise little application might look at is you know how do we do container orchestration and Azure has Kubernetes services that we can do there as well as other services that you know there's data services with Cosmos DB Active Directory another service bus and SQL managed instance and everything like that so I think it's a really quick overview of kind of some key services that .NET developers should know here's some resources for you we want you to kind of go get the tools and SDKs .NET Core 3 release getting Visual Studio and both the core SDK and then as well that second link if you want to learn more about Azure and actually walk through some of the same tutorials of the services and get those SDKs that make it easier for a .NET developer that's the place to go and if you haven't tried Azure yet you can get a free subscription that gives you free services some forever and some for a 12 month period and I think the good thing about the you know we didn't there's a lot more richness in the monitoring and diagnostics and I think a good thing is the session right after this Sirabh and is going to go over some more of what we've done more and .NET Core 3 and for those type of things so thanks Angelosa it was good good primer and I encourage everyone to take a look at this Mika all right thank you Tim and Angelos for those of you who don't know Tim is actually my boss so how are you doing Tim I'm doing well you're doing a fantastic job thank you so yeah we have a few questions that we can go over right now let's see this one's for Tim good to see Tim presenting brings back buttersweet memories of Silverlight do you have anything to say about that probably not allowed to say anything let's see the next one can app services run Blazor can app service yes and if you're into Blazor into app service also check out the Azure Signal service if you need more info let me know yeah Dan Roth gave two presentations earlier today but also yesterday kind of how that kind of all works together as well with Blazor okay awesome here's another one this one's from John will VS generate the EF scripts if you just saved the publish profile instead of clicking publish clicking publish actually deploys the app and then executes the migration scripts I had already set up before so I just didn't type you know create migration but you have to do that first and then publish will execute it for you so creating the profile doesn't create a migration script for you it does it does on the server yeah yeah but but locally it doesn't yeah locally yeah okay great thank you so much guys again next we have let's see we have a diagnostics improvements in .NET Core 3.0 and this is with Surab and John take it away you guys were good today yeah all right everyone so John and I here are going to be talking about diagnostics improvements in .NET Core 3.0 so I'm John Salem I'm an engineer on the .NET runtime team and I work on diagnostics and I'm Surab Shirhati I'm a program manager on the .NET team so let's go ahead and get started so this is what we're going to be covering today we're going to talk about new features in the runtime which is the new diagnostic server that allows us to egress this rich diagnostics information and the IPC protocol it speaks we'll also cover the new diagnostic tools that we've built which will allow you to consume this information I'm going to go over .NET counters for metrics .NET trace for collecting traces we're also going to visualize sample CPU stacks using speed scope that we collected with .NET trace and we're also going to look at .NET dump as a way of collecting and analyzing process dumps for .NET applications and then finally we'll just recap and tell you how to acquire these tools so you can do what we showed you today during the course of our talk so for the 3.0 release we've added a diagnostic server into the .NET runtime itself so it speaks across a transport protocol depending on which platform it's going to be a named pipe on windows or unix domain sockets on non-windows now it speaks a custom IPC protocol and we've built some tools on top of that protocol that are capable of like Surab said creating dumps on Linux attaching to the event pipe as well as attaching profilers so if I understand correctly you've prepared a demo for us today it's an image processing app that's had a few performance issues that you ran into as you were building it yep so we're going to run through the tools and we're going to solve your issues and everyone can see how we use these tools to solve your issue so can we jump over to John's computer right now oh perfect yeah so you see here the beginning of a basic little console app all it's doing is taking an input image in this case the headshot for the .NETConf and outputting what we call a PPM file now this is a classic image format it's very very simple it's just a couple ASCII characters as a header indicating what it is followed by every pixel written out an ASCII plain text delimited by some white space very easy classic CS-101 type you know assignment to generate these files so can we go and have a look at your app run yeah so let's go ahead and run it so John's just running his application and he's going to start it up with his the image that he just showed you as you can see he has a couple of transforms that he can run and he's going to run the aptly name PPM slow transform because well it's a little slow and as you can see no matter how long I talk this thing is still processing just one image so John how do I get more visibility into what's going on so you know this is like my 10,000 foot view of the world I first want to know that there's something wrong so how do I get these metrics when your application is running so we already know it's slow but the runtime produces a whole bunch of other interesting data that we can take a look at using one of our new tools .NET counters so John's just going to go over in another terminal window he's running .NET counters and he's going to pass it the process ID of his already running application so once it loads up you can see that he's out of process connected to his existing application and he's getting live updates to event counters and when he goes ahead and runs his application you can see these counters just light up you can see it's pegging his CPU it's about 22% he has a lot of GC collections happening allocation rate is really high like if I were to look into this just the allocation rate number should make me suspicious so why are you allocating that my John I don't know can we look at your app let me see what's going on yeah let's go ahead and take a look so if we scroll on down you'll see we're doing a whole bunch of stuff we're loading the image we're mutating things we're appending to a string it's really hard for me to tell from this point of view like what exactly is going wrong so how about we leak out what we learned about metrics and then we'll look at if there are other tools available that can give us more detailed information on what was happening while your application was running so I'm hoping my screen's back up and then let's go ahead and talk about metrics all right so the .NET runtime and ASP.NET Core both emit event counters and you can customize custom event counters using the event counter API these event counters can be consumed both in process and out of process in process we have the event listener API and that's like that's in fact what the application insights SDK uses to give you counters in .NET Core 3.0 and out of process you can talk to the diagnostic server that's exactly what you did with the .NET counters tool our tool only showed you the live values for those metrics but the runtime actually computes additional stats so you can get count min max for all the metrics that are emitted and you can think of event counters as the successor to perf counters so they work everywhere that .NET Core does so unlike perf counters which are windows only event counters work on linux and macOS and unlike perf counters they are usable in low privilege environments so you can use it in xcopy deploy and you do not need administrative privileges to actually get access to those counters so this was a good you know we got a view into what's happening in the runtime we know we're allocating a lot so if I were investigating this further I'd be like can I see what was actually on the stack can we see what's taking up CPU time can we see what's actually causing those allocations so if we switch back over to John's computer John's got his application back up and running and are you going to introduce us to the new tool yeah so I'm going to go ahead and run .NET Trace and we're going to rerun that slow transform again and that's going to actually give us a view just like you're asking for of what was on the stack at a given point in time so John's going ahead and running .NET Trace as he's pointing it to the process ID of his existing already running application and this is going to do a couple things so as he goes ahead and hits enter you can see one of the providers enabled by default is the sample CPU stack profiler so what's happening right now is the runtime suspends all running threads every one millisecond walks all your stacks and generates the CPU stacks in addition to the sample CPU profiler you can enable additional profilers so we ran it with the default argument so we didn't do anything like that but if you're used to using ETW and collecting other events from the runtime you can just pass them as parameters it's the same keywords and same filtering that you would for ETW events so John I see the output file was this .NET Trace file so can you tell me what the .NET Trace file is and how will we consume it so we send events across the event pipe using a format known as .NET Trace now if you're on Windows and you're running Visual Studio or Perfew you can just open up that file that has a ton of information like you said most things you can send across ETW you can send into these files now because I'm not on Windows I need another way of opening this file and so for now we have a way of converting these files into other formats so right now we have Speedscope which is what I'm going to go ahead and do right now so we're converting it to Speedscope for the purposes of using it and visualizing CPU stacks in Speedscope if you were on Visual Studio you could open it there if you were in Windows you could also open it in Perfew and get detailed activity view event counts and all the other things you're used to doing when you do ETW with Windows so John's gone ahead and he's opened this collected CPU Trace in this application Speedscope so John just tell us more about Speedscope and how do I get it Speedscope is an open source application you can find it on GitHub the author also has it hosted up at a website at www.speedscope.app I actually have it installed locally here on my laptop using the new chromium based edge so it's installed here locally on my box as a PWA so this is running right here so now we're at the part of the exercise where I got to see a bunch of color lines on your screen and figure out what's wrong with your app so I'm kind of going to ask you questions and hopefully you will point me at what's needed to get to the root cause this problem so I'm just reading from left to right I'm seeing a bunch of things I see this unmanaged code time what is that so because it's the runtime tracing itself we don't have insight into the native code so most things that are after a transition into native code you'll see unmanaged code time so in this case that's the top of the stack for a console redline so waiting for some kind of IO interop or something like that right okay so that makes sense so we know your app is slow we know the part we don't care about is waiting for you to type because that's just you being slow right so how do I filter out the only the parts I care about where do I get to the meat of what was happening in your application so this is what we refer to as an icicle graph if you're familiar with a flame graph it's the same thing just inverted so the bottom frame here is the top of the stack at a given point in time this is the time order view which means we're going to read it from left to right so if something's on the stack for a really really long time chances are we're going to see a very consistent bar across and in fact we do if you take a look here you'll see that we have a convert to ppm slow that's been on the stack for it's a 78% of the time of the trace so if I double click on that we can scope into just what was happening during that call so that's interesting you were able to now we're in the region of interest we were able to filter out the stuff that we don't care about and if I recall correctly we said we're processing an image so I assume there's a lot of you repeating the same operation over and over again on every pixel which is which probably also explains why we have so many of those word icicles is there a way for me to view the cumulative impact of these operations can I stitch these stacks together to see what's really eating up the most time yeah so like you said we're seeing a whole bunch of fragmentation here this is this is a sampled set of stacks which means we're going to have a little bit of noise in terms of timing right so we get a sense of what sat on the stack for a really long time but for a lot of these really small chunks these are probably a bunch of repeated calls that were happening quickly in succession so we can't really get a sense of what took the most time we just know that it was there a long time so if we take a look at this you'll see from the left to the right we've got that image load which didn't actually take much time but if we go and take a look at this left heavy view like you were asking for this gives us a nice aggregate view so all of those discrete samples get aggregated into a single sample so in this case we can see again there's our nice long frame for convert to ppm slow and if we zoom in on that we can take a look at exactly what was happening during the whole time that that was on the stack so can we go back to your code so if I'm looking at what you're showing me I see some string concatenation some stuff that seems vaguely familiar from when we saw your code so do you think this is enough for us to go fix the problem in hand I think this is enough for me to identify what happened so if we go back to the code you'll see here here's that image load that didn't take too much time here's some basic IO and then here's that mutate that was only on the stack for a fraction of a second but like I pointed out before we see a whole bunch of string concatenation and then here's a whole bunch of string concatenation happening inside of a tight loop and I think that's going to be our culprit so just explain to me why is that plus equal to there a bad thing so in this case I'm actually taking a single string and then concatenating to it over and over and over again and this is going to cause a lot of churn because it's going to be creating a whole new string every time I append to it which means there's a whole bunch of junk strings that are getting thrown out which is why we saw my allocation rate spike and the GC rate spike so I actually already have a solution written up so if we scroll back up here it's quite a simple solution you just have to use a string builder this is exactly what it was made for and if I replace all of those plus equals and concat calls with sb.append and we switch back to the app and run the regular ppm you'll see that it takes less than 0.2 seconds to do the exact same computation that 200 times faster yeah just about so we were able to use metrics to figure out that there was something wrong and then we knew what to go look at by collecting a trace right so let's just recap what we've learned about tracing so we introduced you to the dotnet trace tool that allows you to collect event source events including sample CPU stacks you can obviously collect other providers both those present in the runtime and custom providers as well we are working on adding support for GC heap dumps so we can give you object counts of what's on the heap that you can collect out of process in this manner and we have tools for visualizing CPU stacks in speedscope in visual studio and perfume and we're looking at adding other tools to visualize this data you know we have a prototype for chrome dev tools and we're looking at other stuff as well so this was great but I suspect this is not going to solve all our problems right what if I want to look at all the objects in the heap like looking at CPU stacks isn't quite going to get me richer fidelity of information so do we have something else we can look at today to get more information on what's going on in your application yeah if you're looking for something that's more descriptive of a precise moment in time of the entire world of your application you're going to want a crash dump so if we switch on back to my box we can take a look at a bug that I've been hitting with one of the transforms so whenever I've been running the grayscale transform I'm actually hitting an issue where I throw an unhandled exception and my whole process dies okay so I could go and load up a few different dumping tools including our new .NET .NET dump tool but it's happening a little bit faster than I'm capable of hitting the keys so let's go ahead and run my grayscale transform and it's pretty instantaneous but luckily there's a command line or environment variable that you can set that tells the .NET runtime that if it encounters an unhandled exception and it's dying to take a crash dump of itself so in this case you can actually see that as it was dying it went and wrote a core file for me so if I understood correctly I can use the .NET dump tool to collect a process dump on like when desired or I can have the runtime set itself up to collect a dump when it's about to crash due to unhandled exception yes so that's great now I have a core dump how do I analyze this dump how do I actually introspect what was in memory at that time and what is possibly the cause of my error so .NET dump has another command sub command on it called analyze now if I run that and point it at the dump that we just collected you'll see we get this nice little REPL environment so let's take a look at what we can run here now if you're familiar with .NET diagnostics from the past you might recognize pretty much all of these commands these are the commands from SOS the REPL that I'm getting here in the .NET analyze sub command is actually a hosted version of SOS that's reading my dump that I just took and was placed in that directory earlier so for folks who aren't familiar SOS is a set of debugger extensions that we shipped allows you to introspect .NET structures and memory and reason about it initially is shipped in framework is shipped as an extension to WinDBG but now we've hosted it inside a console application because we have a WinPE reader and we have an ELF reader we can read these memory dump files ourselves introspect the memory and give you more like rich information about it so can you find out the exception that occurred John? Yeah I can use the good old print exception command here and if I just type PE it'll go ahead and show me that we hit a system overflow exception that I was doing some kind of arithmetic expression that resulted in an overflow it even tells me that it happened inside of the convert to gray scale function so let's go ahead and take a look at what might be the offender and John just showed you running PE but you can run dump pubs or dump heap or the newly added SOS command for dump async that can actually walk the heap and stitch together async stacks definitely recommend you try that out lots to explore in that tool so if we take a look here part of converting an image to gray scale is taking weighted averages of all the various color channels so in this case I was taking 30% of the red channel 59% of the green channel and accidentally 111% of the blue channel which means that I'm definitely going to be overflowing if there's any blue there so it's quite an easy fix and if we go ahead and replace the code and rerun my process and rerun the transform and go ahead and see we get our nice little gray scale image so this is great but what if I was running in a Linux container would that work because you know we spoke about debuggers and because I know there are difficulties even building LLDB say if I were running in an Alpine container will this work in an Alpine container I actually ran that entire demo from inside a container using the new dev container experience in VS Code and Visual Studio so does something do you need to do something special to run in a container to get this to work yes so when you're running inside of a container and you want to take crash dumps this is going to be the same regardless of how you're running your container you need to enable a couple capabilities namely the sys ptrace capability as well as setting the security options set comp undefined okay so let's go ahead and recap what we just learned about capturing and analyzing memory dumps so right now we don't have any dump collection or analysis on macOS but it's fully supported on Windows and Linux including arm64 and musul based distributions like Alpine it does not require pseudo privileges on Linux to capture a dump but you do need a sys ptrace sorry and you do need to turn off sec comp so you can actually collect the process dump the collected dumps aren't portable so you need to analyze it on the same os architecture at least the same architecture and libc version like set of native dependencies so that you can analyze it so that was the ability to collect dumps and analyze them without using a debugger yep all right so the obvious next question after we've introduced people to all these tools is how do we acquire these tools so these tools ship as .NET global tools global tools if you haven't heard of before or just packages on NuGet that have an executable and the .NET SDK knows how to extract them and place them on your path so you can run them so once you've acquired all these tools you can so once you do .NET tool install you should just be able to do .NET space counters just like how John ran them on his machine in addition to the tools we mentioned we have a couple other tools we have .NET symbol which is a tool to download all the files necessary for debugging that includes symbols modules sos the DAC and it works for ELF and WinP like we said macOS and macodumps aren't supported quite yet and we have .NET sos which so we spoke about how you don't need a debugger to analyze memory dumps but there are cases where you might want to drop in you might need a native debugger say to look at native stacks or look at like managed to native stack transitions like this assembly things that aren't possible with just our hosted version of the tool and for those scenarios we have a global tool that allows you to configure lldb and load sos on windows it's even easier because we ship sos as part of the WinDBG extension on the gallery so you should just open a process dump and be good to go just make sure you have a new enough version of WinDBG and with all those tools covered I think we're ready to take questions from people thank you guys so let's see if we have any questions up here um we have like a try.net jupiter notebooks question yeah it doesn't seem like we have too many questions but is there anything else you want to add let's see the talks I think let's let's recap so there were a lot of capabilities we covered yeah so let's just we have this big scary slide that we were you know you're hoping to use for one of the questions but we talked about things that we've added so we've added stuff in the runtime so the runtime now synthesizes counters we have runtime counters and ASPnet counters we're looking at adding new like ADO EF counters these are emitted via event counters and these can be consumed via the event pipe which has which can be consumed in process via the event listener or an IPC stream these can also be collected via your OS native eventing mechanisms so we have support for ETW on windows we also have support for LTTNG and that's something that was there previously as well will continue to be there one of the things we've also done is if you're using ASPnet or other app models that make use of iLogger we actually pump all the logs to iLogger through the through event source so you can connect out of process to your running application and egress say ASPnet logs without having like you know and you can change the verbosity and the fly do things like that we've also added the ability to capture process dump and analyze it cool we actually do have one question real quick event source dump like event viewer stuffs or something else crash dump is this something like blue screen crash dump and we have to use crash analyzer to open those files is the question so event source is a class inside of the runtime that allows you to essentially write your own eventing into your application so it's more akin to being able to call an event and see that in you know a lot of rich detailed information you can feed objects into it you can feed additional metadata into it and it's a lightweight infrastructure for egressing that out of your application crash dumps are state of the world when you hit a certain point in time so you mentioned sis internals there are tools like proc dump that enable you to take crash dumps there are lots of other ways of collecting crash dumps as well right clicking in task manager on windows using lldb or gdb directly when you are working on non-windows platforms as well great thank you so much guys we're gonna actually run to some commercials right now so we'll be right back hey there treasure hunters here's the next clue for your hunt your journey and it comes to us from our friends at dev express and they riddle you this we love helping developers solve their tasks whether that's helping them write code faster in visual studio or integrating powerful ui controls into their windforms wpf asp.net javascript or .net core applications our loyal customers love us too and there's a special number that shows just how much follow the clues to find it and continue on the treasure hunt at this address head out there now follow their clues and respond to the .net bot in the visual studio twitch channel whisper that response that magic number and you could be well on your way to the next step in the technical treasure hunt we are in the exciting and ever changing age of big data the volume velocity and variety of data has been increasing multi-fold in recent years take for instance a factory there could be thousands of iot sensors or internet of things sensors in a factory each producing petabytes of data and now it's great to have that much data so you can understand how our machinery is functioning and places for improvement how can we actually process it all when we have that much and more than just that how can we process it all quickly and efficiently well welcome to the world of Apache spark hi I'm Bridget Murtaugh and I'm a program manager on the dotnet team here at Microsoft in this series of dotnet for Apache spark 101 videos we're going to be diving into the exciting world of big data analytics within the dotnet ecosystem so what is Apache spark Apache spark is a general purpose distributed processing engine for analytics over large data sets typically petabytes or terabytes of data put maybe a little bit more simply Apache spark is a great tool we can use to analyze a lot of data in a quick and easy to understand way so you don't have to be a data science expert to user understand it so there's quite a few useful things that we can do with Apache spark for instance there's spark sequel which allows us to analyze structured data such as data stored in a csv or in a database of some sort there's spark streaming which allows us to analyze and gain insights from data live as it's being produced so in our factory example we could gain meaningful insights from our data live as it's coming from our iot sensors so if there is some sort of malfunction in the equipment we could detect it and go address it there's also machine learning capabilities with apache spark so that we can combine the powers of big data and machine learning to get faster training or prediction there's also visualization opportunities so that we can gain meaningful insights into our data through graphs or plotting or other visual means so in order to understand how apache spark works there's only three main components that we need to discuss the first one is the driver so the driver consists of the user's program so for instance that could be a c-sharp console application that you've written and it also consists of the spark session so the job of the spark session is to take the user's program so to take that c-sharp console app and to divide it into smaller pieces which can be known as tasks those tasks will be divided among our second component which are the executors or the worker nodes so each worker node is going to get its own task and with that it'll be able to execute a small part of our user's program the third component of our architecture is the cluster manager which helps manage allocation of resources and how our program overall gets divided and then executed in the end so now that we know how apache spark works it sounds great I want to be able to use it to analyze all of my data all of my terabytes and petabytes of data but up until now the popular apis for spark were written in languages like r and python and scala but what if I want to use apache spark with my pre-existing dotnet code or knowledge well we now have a great solution and it's known as dotnet for apache spark so if I go to the dotnet website which is just dot net I can scroll down and find the machine learning section because we've combined the machine learning and big data sections together so I'll go past ml.net for now and I'll see dotnet for apache spark so dotnet for apache spark is a free open source and cross platform big data analytics framework like some of the scenarios we had mentioned earlier like spark sequel and streaming and machine learning we can use dotnet for apache spark for all of those applications the dotnet bindings for spark are written on the spark interop layer designed to provide high performance for multiple languages it's also compliant with dotnet standard meaning anywhere that you already have c-sharp or f-sharp code you'll be able to use dotnet for apache spark meaning you can finally use big data analytics in any of your dotnet code bases and as we had mentioned dotnet for apache spark is open source so you can go ahead and check out the github to learn more and to contribute to the open source community there thanks for joining me in this video where we learned all about apache spark and the exciting new tool known as dotnet for apache spark stay tuned to the other one-on-one dotnet for apache spark videos to learn about all the exciting applications we can start building and running using big data analytics in the dotnet ecosystem what's up everyone welcome back today i'm going to be talking about unity my name is christos matchgas i am a product marketing manager for unity and mobile and i have really great interest in this product you probably have had a lot of announcements throughout the two days so far so dotnet core visual studio and visual studio for mac so today what i want to show you and why i wanted to pick up this session is because i wanted to showcase that with dotnet you can build some amazing things including games right our agenda for today is very simple i'm going to introduce unity to you just to let you know what it is and what you can build with it and then i'll show you how to get started if you've never done unity gaming before like i haven't so it's a great experience to see how you can set up your machine then i will show you why you want to use visual studio or visual studio for mac to write your games we'll do a few demos just to showcase the capabilities and finally we'll talk about why visual studio is so well aligned with unity and what makes it such a great product for debugging and writing your games or your 3d real time applications and hopefully at the end we'll leave you with some learning materials and set you up for the next few sessions of the day so getting started unity of course is a is a the most widely used real time 3d framework right it started as a game engine but now they're targeting different industries so the their goal there is to give you the tools to create applications for not just games but 3d real time applications they're the most widely known engine and it's build on dot net so if you are a dot net developer there's nothing stopping you from writing games starting today and the nice thing about unity is that you don't just have one platform but you have over 25 different platforms whether you want to develop games for xbox whether you want to build solutions for that run on windows or mac os obviously mobile is very big mobile games are fantastic these days and many people monetize on that so if you want to build things for that then that's also there tv os that the platform is insane so taking your dot net skills with unity and our ids means that you can build almost anything for any platform out there and getting started obviously the first thing that you need to do and you need to be aware of is that ever since 2019.2 version of unity things have changed quite a bit on how you install unity so there are two ways to get started with unity one is you go to the unity website and you download the installer and it allows you to actually go and get the bits that you need so it's a unity first experience and many many developers that know unity will start from there but if you're already a visual studio developer there's a way for you to add the unity workload to allow you to to get started so we'll we'll see how you do both so if you're inside visual studio you select the game development with unity and that will download the unity dependencies for you and the other way around if you're already on unity then you can go and add the components that you need so if you are on v on macOS then it will download the visual studio for mac components if you're on windows it's clever enough to let you know that you need download visual studio so I already have both the installers here so if you're in visual studio installer you're just going to modify it kicks off the modification of the latest version that you're using today we're using 16.3 which is the latest and greatest and if I scroll down here you'll find I already have selected the game development with unity if you don't have it selected you add that and will bring down all the necessary dependencies so I can close that off and if I go to the unity hub up until this point that didn't exist so you would download directly unity and get started but now they have a unity hub like the visual studio installer and allows you to add multiple versions of unity because certain things may not be working with the latest version of unity especially their component engine so here you just come to install you add your installation and then from here you can also add modules so in this instance you'll notice that we already have the unity game development checked in because we went from the visual studio workflow first but if you don't have it if you start with unity then that's the way you get started and that's all you need as soon as you do that if we jump back the slides you'll notice that there are certain things both inside unity and the visual studio installer that show you that everything has been configured correctly so we're ready to go with these ones and what this one is telling here for the external tools is that if you are working with unity and you are on windows it has already recognized visual studio 2019 as present and I've already checked in the editor attaching because one of the big things that you want to do is as you write your code for your games you want to make sure that you can debug the code right and you want to do it in visual studio because it's the best editor out there so so next we're going to look at why would you want to use visual studio or visual studio for mac or versay notepad or one note or whatever there are if you if you've been developing for a long time with visual studio you probably know some of these capabilities but if you're not if you're new to to visual studio or if you're just focused on unity then I would like to highlight some of the big features here obviously refactoring is big as your code grows you want to be able to quickly jump into the code and change things move them around clear your code and what have you so you can always use the mouse and right click on a line or you can instantiate the command by using control or command dot and you can go straight to definitions I will show this in a demo very quickly you can navigate to decompile assemblies you can get suggestions for variable names the ID guides you to through a lot of good practices and would try to give you the tools that you need to build good code so if you're creating method that you want to duplicate for example then we can quickly do that in the code there are a lot of tools there to make you more productive with the scripting in your games multi cursor mode editing we got global search that's very big because if you have a big code base as your code base grows you want to be able to quickly search and find different components in your code going to enclosing block if you have big blocks of code and finally whether you're working on Visual Studio or Visual Studio for Mac and you'd like a specific set of bindings then we also give you the ability to actually switch the bindings around around so if you're in Visual Studio for Mac there's a setting there that tells you I want to use my Visual Studio key bindings and since I have both machines as well I like to have that consistency across the two IDs so you can do that as well next one we have in telecode some people may already know IntelliSense and IntelliCode is the next level it's the AI guided IntelliSense that you get inside your code and it's always context aware as well I will do a demo on how IntelliCode works and how you can improve your game coding in Visual Studio Live Sir this is a life-changing experience because up until this point you maybe have been developing in teams or developing in isolation and you always get stuck right there's always the internet but there's nothing as somebody out there that can help you out so using LiveSir you can actually set up a session to serve your existing coding environment with somebody else so there could be somebody sitting three hours away from you watching TV on their on their you know on the surface go and then you call them and say I'm stuck with this solution here on my game I don't know what to do can you help me out you can actually spin up a session inside Visual Studio they could be sitting on their sofa playing with their Visual Studio Code doing some web development they don't need to have the exact same setup you'll be setting your environment so LiveSir allows you to unblock it allows you to serve your environment and find solutions to problems sometimes you can use that for as a learning experience as well so that's really important I will show you how to spin up a LiveSir session if you want to we have built-in source control obviously if you're using Git and most people these days tend to use Git and we do have built-in ID support there we have real-time code analysis that's very important as you write your code you want to have real-time feedback you don't want to have to write your code save it and then build it only to find out that something is not as you like it to be that also includes some of the things that I'll be talking later like roles and analyzers and getting immediate feedback about the quality or the the errors in your code Editor config is very big lots of people talk throughout the conference so far about Editor config and how it ties very well with Visual Studio or Visual Studio for Mac and for those people that have not used Editor config before it's a way to actually define a code how the code should look and behave how you want your variables to be declared how you want your spaces and tabs to be declaring your code if you want to go down that route and because it's a file that is checked into your solution it follows the code everywhere you go so if a new developer joins the team then Editor config allows them to pick up the exact same code habits if you want and apply them to their code base as they code CodeLens gives you a very quick glance about how your code has changed over the times and over the years how many check-ins you had for a specific method and what have you and then some other capabilities is obviously if you're changing across machines if you work at at the office and then you come home and you pick up the work you can actually synchronize your settings for the IDs across those devices and across those environments so you can have a consistent Windows layout you can have a very consistent look and feel so if you prefer dark themes then that's how it works and then we have custom screen layouts which you can save as well and then take them with you and if you didn't know we already support light and dark themes on your ID to make it look and feel as you would like to so next I'm going to jump to a couple of demos and we're going to talk about some of the things I have shown you already so moving back to my code and we have talked about refactoring so usually when you are sitting in your ID you can control dot and then you get intelligence and says we can remove those usings and make sure that you don't have them anymore you can also fix on all document all projects and all solutions so if you're brave enough you can apply that setting across the whole solution so let's do the document over here you'll see it says I can preview your changes and then you can apply them we have things like let me do another one you can see here again we have fixes we talked about the multi-carat editing so if I were to say add new methods I could do control alt dot and then select multiple locations or control shift dot sorry control alt select one two that seems to be not working okay I'll move on but we can also do multi-line editing so if you're here and you want to change from private to public you can go public and automatically applies again we do support multi-carat editing across the files but let me change that back to private we don't want to break our code okay so this one I did talk about editor config and they just way to showcase these is if I jump into my files let me just see desktop and I can I already have an editor config this is where to get started I find is if you jump to the roseline repo on github they have already an editor config that is pretty well tweaked so far so as soon as we drop the editor config there you'll see we have all these different settings obviously you can also change them to fit your team's needs and that means that if you want to break or if you want to go from a warning to an error then it allows you to go that so you can see here the severity set the suggestion but you can change it to error and then that will cause everybody to actually go and fix their issues but if I go back up I'll pick up something that is very well debated and a heated conversation so if I go with tab and save that saving it's thinking about it there you go so if I switch back to my code you'll notice that right now I have four spaces everywhere but if I do control K and control D automatically applies the editor config settings to my code that means that as soon as you add your editor config you can go back and apply those settings to your files which is fantastic that means that your team can have a consistent code base there so let me just don't save that one obviously let me just go back and revert that because I'm pretty sure my team will be upset about the tabs space save that and again that applies I did say I did mention about live sir so if never use live sir it's available on vvis studio and vvis studio code you don't have to have the exact same environment on the target machine the one that you're sharing with but you can go into live sir it's already kicked off a sharing session I don't have anyone right now to share with but if I go into more info you'll notice that it says just copy this url send somebody else and with that they can actually join your session and say exactly what you see here which is fantastic especially if you're in games developing you're new and you need support throughout the your coding session so I'm just gonna stop that live sir in case anybody wants to join and I'll go back to some of the other things I talked so let's see here what else do we have code lens we are building source control yeah let me just show you this one so with source control again it will automatically pick up I was using git locally here so you'll notice that there's a lot of files that have changed throughout my editing you can also use an exclude so get ignore to exclude some of the files because obviously you don't want to check in everything on your source code and like in dark themes with the settings if you didn't know you can create custom settings as well so if you want to have a very specific layout for your games development you want to ignore your debug you want to ignore other things and that are not relevant to you or windows that are not like toolbox then you can come here create your session and your your layout and then you can apply it I know where you are these settings do carry with you as soon as you log into Visual Studio with your account so if I were to change to a web layout you will ask me whether I want to do that and then it does it there you go it's very different right I want to go back to my default one because I don't like this one I should have created one for Unity obviously but it's fine so I'll go back to my default layouts there you go applying this one fantastic anything else we want to highlight here and in telecode I will show you in a bit and now I will explain why real-time analyzers we have Roslin if you don't know about Roslin you can download and install Roslin analyzers the ID also comes with some default analyzers so here as I type it might come with a suggestion saying you're missing an underscore prefix or you could make this field read only so straight away it actually tries to make me a better developer by providing some suggestions for my code and Roslin analyzers are very powerful because they run at real time as you type your code so you don't have to again again save and build before you find out that there are some warnings against your your code right moving on I want to highlight why Visual Studio is so important with with Unity and why when you use them together they said your code on fire right you become a lot more efficient obviously Intel Code now has been designed to work with most of the C-SARP default projects but our team is working to bring the Unity API messages into Intel Code which means that we're scanning our code bases out there to make sure that we pick up the best skills for your for your Unity games and Intel Code goes one step above intelligence because as I said earlier on it's context sensitive it knows exactly where you are and what you're doing and we'll provide you with the best ideas as you type Visual Studio does come with superior debugging we have the ability to set up trace points and break points and really dig through the code there have been already sessions that show advanced tips and tricks on how to debug using Visual Studio so I would urge you to go and see these and we also added a Unity Project Explorer which makes your experience slightly better so if I switch back to my Visual Studio you'll notice that I don't have it down here but if I search for Unity you'll notice that it has Unity API Reference and Unity Project Explorer so that brings up it gives you a more simplified version or a look and feel of your files and your assets so you don't have to go through the standard solution Explorer so we have an optimized experience for you Attach and play going back to the ID up until this point we only had Attach so you had to spin up the game and so you had to spin up the the Visual Studio Attach to Unity and then you had to go back to the Unity Editor and spin up the game and then set break points here in order to be able to Attach but now lo and behold we have Attach to Unity and play straight away so you will kick off your game end to end so if I were to try this one and we can also put a breakpoint over here we'll kick off my awesome game it's not it's not awesome but I did spend an afternoon writing this game so I wanted to prove to myself that as a .NET developer I can write something in Unity in and not a lot of time so within one afternoon let's say four or five hours I was able to put this thing together so let's see if it's already kicked off the breakpoint is there if I'll go to my game trying to switch now maybe all right let me stop that one bring it back to focus I think it's right something something resolution something okay so that's my game it's a very basic game I created a car and I put some obstacles on the road and what I'm trying to do is circumnavigate around them so I had no knowledge of that I've used some ready-made components so Unity makes it very easy to actually create a whole world out of ready-made assets so all you have to do literally is write the experience or the behavior around these objects and how you want them to behave right now before even starting coding anything these were just dumb objects sitting on our scene so what I did is actually add user controls to be able to navigate around the car and then I wanted to also add the behavior of moving the camera behind the car so it follows the car as it goes through and later in the game or in my talk we're gonna add one behavior which is exploding crates because there's no fun if there's no explosion right so I wanted to make sure that if you touch the crate it just explodes so right now we're here you see it actually has kicked off the game so I can see I think there you go we can navigate around the space it's very basic I saw them to my daughters and they were not very impressed because you know they play Xbox and then when I saw them this I was really excited but the excitement not really pan out with them so as you can see I can already control it and the code that I needed to write to make this happen was literally a few lines of code so in this instance we have four lines of code that control the forward and backward and the sideways movement and then one more line of code that actually allows us to control the camera now I did speak about IntelliCode and how it works for us so if I were to do transform here and then do a dot you'll notice that we do have position local scale parent local position and rotation it's the IntelliCode here it tells us the code that you might want to use these first because these are the most common ones in the context of the update so maybe you want to pick these ones up rather than try to find through the API as you can see it's a it's a massive API here I have no idea what I need to do so IntelliCode really helps me focus on the things that really matter and the nice thing about that is that if you go into an if statement then it will actually change the whole experience so let's say if I go down here and say if and then transform and dot you'll notice that it's changed slightly so it gives us the root which was not there before it also gives us a child object so it looks for like if transform has child objects you might want to do something so IntelliCode hones in into those those parts of the API that do make sense to you right I did talk about IntelliCode yes and one more thing about IntelliCode right we already have the automatic IntelliCode which does a lot of things out of the box for us but you can take it one step further by training IntelliCode to apply specifically to your code base so if you search for IntelliCode up here IntelliCode you'll notice that there's a IntelliCode model management and what this does it allows you to submit your code to our IntelliCode engine to create the model that you need to apply to your machine and that makes it very specific to your code base you can also share that with the rest of the team and that makes everybody more efficient so if you have a large code base with a lot of classes that you want to be able to quickly bring to the surface then IntelliCode allows you to do that and you also have a custom model for Unity to allow you to even be more efficient right by jumping back into our Unity last thing I want to do is obviously show you some of the the good things in Visual Studio we do have the ability now to create C-SARP files Seder files and Inam files directly in the Unity project in the Explorer faster project reloading so we want to make sure that as you change your code from Unity then the project reloads much faster especially if you add a lot of assets we want to have reduced time for debugging so no not many delays the team has really focused on better performance we also want to support more unsafe code debugging options and we have Unity specific analyzers and diagnostics inside Visual Studio to make you look better and have better code and finally we're suppressing non-applicable C-SARP diagnostics so with that I wanted to go back to our game and just add the explosion because as I said I promised you explosions so we'll see some explosions this time I'm going to go via Unity so here you'll notice I have an obstacle which I'm actually using to create lots of obstacles in our game because we have about six of them it doesn't have any behavior or code so what I'm going to do now is add a component and in this instance we're going to add some C-SARP files so a new script we'll call it collision detection because it's actually colliding with something collision helper there you go a new script collision helper create an add so this will add it to our obstacle now because everything else in our code base inherits from that base obstacle all I need to do now is go into our where did that go oh it's still loading right okay still fixing it adding it there you go so the collision helper here now that file is here let's tidy up a little bit we won't have a nice tidy solution and I'm going to jump into my collision helper this will open inside Visual Studio I'm going to delete these ones because I don't need them and I'm going to add my snippet so what we're doing here very basic took me probably two hours to figure it out four lines of code and there you go what we're doing is we're getting the game object we need to make sure that it's only the vehicle that collides with our with our crate right because if everything else collides then we don't really need to know about that then we grab the particle system that actually throws the explosion we make sure that we have a handle on that in fact I've used the curly brackets that mad stocked on the first date to check whether it's new or not and then we need to make sure there's not playing right now and then kick off that destroyment so I'm going to kick off the game now let's save this one then kick off the game blow something up and then we can move into questions there you go it's going to take a couple of seconds explosion right that's it four lines of code then you have an explosive crate right last slide for me for today is all about what you can do next so if you are if you are keen on learning what you can do next we just go and download Visual Studio at the Unity we recently launched some amazing learning tutorials with Unity in collaboration so go there we have more than six hours of learning materials and then we also have how to build your first game our PM John Miller wrote this one it goes through step by step on how to use Visual Studio for Mac and build your own tic-tac-toe game so thank you very much thank you very much for joining me today fantastic we have one question for you my friend it is what UI controls are compatible with Unity from yeah from UI controls so there's there's a lot of components out there you can get a lot of assets from the Unity store you can get a lot of assets from third-party suppliers so I think it's as much as your your budget can afford oh fantastic that's amazing well thank you so much for your time my friend that was amazing we have a short commercial break and after that we have building amazing cloud-connected apps with Xamarin Azure and AppCenter with my dear friend and colleague Matt Succo let's go to the commercial right now hey there treasure hunters your next clue is courtesy of our friends at DocuSign and they want you to use the landing page to guide you in poking around DocuSign's C-sharp tools to find the solution code go to this URL poke around there find that secret code whisper the response that you found back to the .NET bot in the Visual Studio Twitch channel let it know and you could be well on your way to the next step in our technical treasure hunt hey friends let's talk about a Hello World app now we did a video on a Hello World app yeah did it from the perspective of C-sharp we looked at the namespace and the using commands and things like that in fact we did a whole video series and we ran the application we hit control F5 to start without debugging but we never really looked and found like the thing we made did we yeah we were really code focused and for me it's not really concrete until I see where it exists on my computer's disk so let's take a look at project heights so what we're looking at right here is exactly where we left off at the end of the C-sharp video series we were making a little banking application it's a console app so it's on a windows app that pops up and has buttons and things it runs at the command line and over here on the right hand side we've got this solution explorer are those my files is that a representation of what's happening on the disk right so what you see in the file explorer isn't exactly what you see in the solution explorer so here you have a bin folder and an object folder you have .csproj files none of that you see in the solution explorer because that isn't exactly what you need right now in your coding are they kind of hiding that from me because it's really not the point right now the point is my code right okay but we were building stuff we were running stuff we spent a whole bunch of videos learning C-sharp I was running my application by pressing control f5 or start without debugging or f5 to debug but I never really saw the thing like where's my thing I made right so the output of your app is actually in the bin folder why don't you double click on that bin and in debug debug and in netcore app 3.0 so now we can see the .exe which is the output application of what we built okay so that's the stuff I made my super bank exe and my super bank dll and then there's some other kind of peripheral stuff that came along for the ride right can I run that yeah okay so if I run that well that wasn't exciting it just kind of let me do that again maybe I did it wrong it just came and went you didn't do it wrong so that's basically what console apps look like if we don't add like a console.readline or it doesn't wait for feedback why don't we run that from the command prompt okay so I'll go out to my command prompt I'm using the windows terminal and you'll notice that I'm in the same folder right I'm in the exact same folder and I can compare these two folders in debug, netcore app like I actually right clicked here in explore and I said copy and I came down to the command line and I said cd and I pasted it in that's how I got here and if I type dir that's the same stuff right so you said I can run that so my super bank I'm gonna hit tab remember tabs are friend in visual studio and it's our friend at the command line so hit enter aha that's what I was seeing yesterday when we were doing C sharp videos okay so that's the app that we wrote yesterday which is great so the super bank exe and the stuff around it is my app can I just take that and give that to my family and they can run it too yeah if you're they're running it on the same operating system if you want to publish it out to different operating systems you can run different commands but we'll cover that in a different video yep we're gonna go through publishing and the difference between running on windows or running on Mac running Ubuntu a little bit later and the idea of a dotnet runtime and how that runtime is needed and all those things in the publishing video but that's a hello world like that's the the anatomy of a dotnet hello world application using visual studio 2019 stick with us for more dotnet core videos coming up next hello friends my name is matt soakup and I'm a senior cloud advocate here at Microsoft and for the next 30 minutes I'm going to show you how to build a mobile app using Xamarin connect it to the cloud with Azure and make it amazing with app center so let's jump right into it and show you what we're building today so what I have here is you may have seen this app use a couple of times yesterday and during the keynote and today it's the pretty weather app and it looks pretty good all right we have the weather conditions so we're in Seattle we have the temperature we have the current date but the world doesn't revolve around Seattle all right don't tell anybody that here but there's more cities involved and so what we're going to do is we're going to make this app fully functional and by that we're going to hit the three little icons in the bottom and then we're going to be able to sign in the Chrome say no thanks and actually be able to sign into our app so I'm going to enter my email address and my favorite password of all time a b c d one two three four with an exclamation point sign in and what this is going to allow me to do then is save cities that I want to be able to view the weather with hit a plus button and I can now add other cities other than Seattle around enter Honolulu probably has a little bit better weather than Seattle and now I can be able to see the current weather conditions then in Honolulu so what I did is in addition to the current weather conditions added a little magic to be able to sign in and have data follow me around the different locations or different devices so let's see how we did all of that we're going to be using to build all this three things Xamarin for the mobile app functions to be our compute in the cloud and then app center mobile back in as a service that do auth and data which wraps around Azure B2C and Azure Cosmos DB so first up Xamarin so a quick overview of what Xamarin is Xamarin is Microsoft's framework for building performance iOS and Android apps but it's so much more than that you can build macOS apps you can be able to watch OS apps you can build TVOS apps you can even build apps for Samsung's Tizen operating system so it's much more than just iOS and Android apps and how this is done is that you've used the great power of .NET and C sharp so we have let's say an iOS UI an Android UI and a C sharp UI for Windows so we're going to build a UI for each one of those out separately we're using C sharp we're using .NET we have full access to the platform but we're building those UIs separately but we're building an app that one app is still going to perform the same thing although we have to build it for each platform so when we call it to that web service when we go get our our weather information it's going to be done the same way so we may as well use a shared C sharp logic layer and that's where the power Xamarin comes in that we can write our shared logic just once and have it use across multiple platforms at the same time but we can do better and that's where Xamarin forms pops in so what Xamarin forms does it gives us an abstraction of the user interface layer so let's say iOS has a button Android has a button and UWP has a button so what we're going to do then is Xamarin forms gives us an API that lets us program against a button and then forms takes care of emitting a natural native button for us so now we're sharing C sharp logic for our application logic we have shared logic for our UI logic and we have more and more shared code this is great so then in the nutshell is what Xamarin is the next thing I wanted to talk about is the compute layer or Azure functions and so this is a quick diagram of what we're going to call the cloud native compute or how we're going to architect our app so way back in the day we had the cloud on premise architecture and so what that was was essentially that was the old data or the computer underneath your desk right where you had every to take care of everything yourself the machine make sure the operating system was good you had to install all the software yourself but as we moved along we started moving to the cloud so you had infrastructure as a service so you no longer had to take care of the hardware you then you moved to platform as a service so you didn't have to really worry about the operating system and now we're at functions as a service or serverless or only worried about writing our code and so our answer to that is Azure functions where it's events being tied to code and then we have functions and so what are some of the events that we can write that we functions run off of think of having a blob being written to blob storage or something being written to the Azure queue so that in itself will actually kick off an Azure function and have our code start running the secret sauce though comes in with the bindings and so what a binding means is that we can have something let's say from Cosmos DB be bound to an Azure function and then like a document can be sent into our function as a variable so the same thing can happen with a Azure storage table or a file it automatically gets sent in or we can write it out as well so this gives us a really powerful mechanism to write some really cool code with a little bit of lines so some scenarios to demonstrate this so let's say we had a timer going off every 15 minutes that's our event the function then kicks off it will then find and maybe clean some invalid data from a table and then we are resulting with a clean table afterwards another event could be a file a CSV file let's say gets added to blob storage we have a function then that takes it in transforms that CSV file into data rows and then from there we can display a Power BI chart graphic or our scenario that we're dealing with today is our mobile app it needs a forecast it sends off an HTTP get request to a function that function then is going to call off to a third party weather service get the data back and then it's going to massage that data into a version that the app can deal with send it back down to the app and then the app displays the data so let's see how we can use compute with Azure functions and add that in to our mobile Xamarin application so this is what the function looks like it's called get current conditions and it's running as an HTTP trigger so that means that as soon as a HTTP get request comes in it's going to trigger off this function and it's going to start running and then it has various requests queries that I can get a latitude and a longitude and then it runs through so actually let's kick this off and run it so it's going to compile and I'm going to run this all locally and then as that fires up I'm going to actually call it out through postman through this local host 7071 and here I have postman setup and I'm going to be passing in a latitude and a longitude of Seattle so I send it off and it comes in here and hits so now what I can do here is step through so I get my latitude and longitude out of the query string and then these next ones I'm just pulling out of essentially a config file to get my key and my URL for my third party weather service and so that's another great thing about putting this up in functions instead of having it in my mobile app I can have the key to my weather service not on board my mobile app where it could be possibly compromised I have it up on functions within the azure cloud and it's safer eventually I could even put that in the azure key vault and really lock it down if I wanted to great so back to the function then all I'm doing here is using this client which happens to be an HTTP client calling get string async invoking that third party weather service getting my data back deserializing it and then finally all I'm doing here is putting it into a version that my mobile app would use so I continue that off and down here I just get this little JSON back and this is all my map app needs to display its data so I've already actually deployed that to azure that particular function and I'm going to run my mobile app now to actually see it in effect so I'll compile it and run it on the emulator and as it's going all I'm going to do here again is using the HTTP client is called get string async and it's just calling out prettyweather.azurewebsites.net to get its data back so as soon as it fires up still compiling and then we should have it done in just a second here hopefully and then we'll continue on talking here we go so loads up going to deploy it to the emulator then once that's done it'll go through and the very first thing it's going to do is going to hit this weather service here get the weather info and then it's going to deploy call out to the function loading itself up and then it should come in here and that's what it did call the get string async and I can see my weather info that came back it's the same thing as before and now it's just been updated with weather from Honolulu so there we go so that's all that's involved with loading up and calling an azure function from a mobile app it's just an HTTP get request involved so that's pretty straightforward as far as it's creating just a back end a web API but doing with azure functions a cloud native way of creating a web API so now adding the real amazing stuff to functions or to our mobile app and that's with App Center and so what App Center is going to do is going to allow us to wrap together Azure AD B2C Active Directory B2C visits the client and also Azure Cosmos DB on a really nice easy to use developer friendly SDK and so the way this works is that a lot of y'all may be already familiar with App Center in the dev ops portion where we had build and test and distribution so what happened is that with build what you would do is that you would connect to your favorite repo and then as soon as you would push to that repo it would build it would kick off some unit test and maybe even some UI test that would run on real devices and then as soon as that was done everything would pass it would kick off to the distribution whether it's distributing to the stores or whether it's to some external beta testers and then you would have some diagnostics that could run so what happened if the app crash maybe you can get full stack traces it could hook into app insights and then you have analytics where you can track how people are using your app that was App Center however there is this now this new features called the mobile backend as a service where there's authentication data and push now what's great about these features is that they interact really well amongst each other and they are super easy to use so first we'll take a peek at what the authentication does and as I mentioned before Visual Studio App Center's authentication works hand in hand with Azure Active Directory B2C so AD B2C itself is I'm going to say it's a little bit involved in getting set up and so what App Center Auth is going to help you do is going to help you ease that process of getting set up and making calls to it so its focus is on making everything easy for you and so the other way so there's two parts and involved in calling and authenticating and signing in your users there's the B2C portion and then there's the actual signing in portion which is done through Microsoft Authentication Library or MSAL now the MSAL is all done on device and that's taken care of displaying the web view and actually communicating the B2C and performing the authentication where B2C handles like calling out to Twitter or Facebook or your email to make sure you are who you say you are so you have these two pieces that need to interplay with each other nicely in order to get your sign in experience App Center makes this whole layout and this whole journey way easier this is what it looks like it's just sign in async now if you're familiar with what the MSAL framework was before it's super powerful but it was a lot of ceremony that goes along in setting it up this is what it looks like now it's super it's nice it's developer friendly and that goes right along with the App Center ethos going along with this I mentioned that right now it's just working with Azure Active Directory B2C but in the future they're implementing something called bring your own identity and so what this means is is that if you're using Auth0 or if you're using Firebase or if you're using Azure Active Directory already you can just bring those in to App Center and it's going to work for you so you don't have to be just using B2C you could be using any of those other identity providers bring it in and you'll still be able to work with them behind that beautiful SDK that we had then next up is the data portion so what the data gives us here is a nice wrapper around Azure Cosmos DB so the way as I mentioned before is that Auth and data and push work together hand in hand so this is one of the ways that they do so we're logged in with Auth and then user A, user B and user C whenever they do some data information they get their own private partition within Cosmos DB so when I want to store some data I get my user A partition same with B same with C but yet we still have some public data and so there's no I don't have to set up as a developer set up a new partition for anybody App Center's SDK takes care of that for me now the thing that we get with the data SDK is the ability to do offline writing if I'm connected it writes to the cloud right away also writes to an SQL cache on device however if we're not connected just writes to the cache on device and we keep on going it'll write up to the cloud next time we're connected same thing when we're reading always read it from the online cat or the cache on device if we're connected reads to the cloud and syncs up automatically works you don't have to worry about whether you're online or off the SDK is going to take care of it for you so some methods here that you have you create your data model new it up and then there's a create method a delete method passing in the IDs of what you want and then the partitions here are the user documents as opposed to public and then there's a list async to get them all back a read for a single and then a replace which is like an upsert or an updating other cool things that we have with the app center is that you can see data metrics from what your Cosmos database looks like all within the app center portal and you can actually go through and view different documents and the best thing at all is that there is a free tier coming along it's not there today but it is coming along soon so it is Cosmos DB free tier with app center and that's pretty really slick so let's jump in to the last demo that we have going walking on sunshine auth and data with app center so first thing I want to do is show you how we would set up the portal the app center portal to work with auth and data so what I would have here is I have opened up a app center application and I have auth and data here so just by hitting auth it says welcome to auth connect my address subscription and I can go through I have my pretty weather it's reading what's already in my address subscription user impersonation and then for the policy I have to manually add my user flow which is happens to be this user flow is the how you sign in so it's like which identity providers like if you want to connect to Facebook or if you want to connect to Twitter and then I can just say connect and that's all there is to it now my app is set up to use authentication the same with data all I'm going to say is I want to use an existing database use my subscription hit next here which database within it user preferences which collection and that's it I would hit done so to show you one that's already set up and ready to go is one of my Android auth is already there it's telling me my tenant name my application ID and the data and you can see here I have overview and then my explorer and you can see I have both Seattle and Honolulu added so the next thing what I want to do here is finally go through and show you the methods that I have set up to be able to log in and then save data so I hit the little things below and the sign in right here is just auth sign in async I have tokens that come back an account ID which is my B2C account ID all within it I can get listing my cities out is just a data list async sending in a city info which just happens to be a regular class continue on and then if I when I want to add a new one I will come through here pick a new city and crash the app so what it would look like if I would pick the new city then is save async and which just says create async city info passing in everything I need and then what I would have there is some really really funky stuff but if I go over to my real device I can see if I load up the app it should be able to see Madison Seattle and Honolulu come up and obviously Madison did not save but that's okay so hopefully it saves here without crashing anything and it comes over so great that's the quick version of adding everything and using app center with Xamarin mobile app so in summary we use Xamarin for creating a cross platform mobile application Azure functions for a serverless backend for a compute and then app center for a mobile backend as a service data and authentication so please go out and learn more follow these documentation links for Xamarin app center auth and data and finally the bottom one there is all the code that you can want from this session all right thank you so much my friend man how you doing today my friend I'm doing well Seth fantastic so here's a question that I always get that I thought I would ask you performance with Xamarin versus native is like tell us about that you get 100% native performance with Xamarin as you would if you were writing something in Java or if you're running something with Swift you're going to get the same native level performance as you would so there is no difference as if anything Seth you write bad code you can get bad code yeah he's saying that from experience yeah we work together and so he's seen some of that all right so here's another question does azure app center auth work with securing with securing a web API being called from a desktop app that's a good question so the auth center app it works with securing a web API calling from a mobile app I haven't tried it from a desktop app but they do support WinForms in the other portion of app center so I'm not going to speculate and get that project team or the development team product team in the trouble but it's just a GAT token fantastic well there's a lot of good links that he put up there so make sure that you follow those and get some of the code so you can try it out yourself it's pretty amazing now as we go along make sure to remember to to participate in the technical treasure hunt it's still going on you're going to want to watch all of dotnetconf 2019 because dotnet partners are sponsoring a technical treasure hunt there will be fun challenges to solve and you'll be eligible to win a lot of prizes which is critical so what we're going to do is we're going to throw to a commercial break and right after that we're going to have a tour of what's new for XAML Tools and XAML Islands and Visual Studio 2019 with my good friend Dimitri Lailin but this first Welcome back treasure hunters I've got your next clue from those wily folks at mobilize.net They want you to use this choose your own adventure band or snatch style story to decide what to do with some toxic legacy code choose the right path and you're a hero choose wrong and dreadful consequences might befall you go to this URL to get started whisper that response when you get to the end to the dotnet bot in the Visual Studio Twitch Channel and you could be well on your way to the next step in our technical treasure hunt Hi I'm Scott and I'm Kendra and we're going to talk to you about dotnet this is our dotnet 101 video series if you've just arrived here you might want to go backwards and take a look at this C-Sharp 101 series C-Sharp is one of the languages in dotnet but what is dotnet anyway? Right so we've been talking about dotnet for a while and we haven't fully explained what it is it definitely has something to do with development so let's dive into that so dotnet is an open source development platform for building different types of apps and of course that next question is then what's a developer platform yeah it's a little bit confusing it is the languages that you use plus the libraries that you use and that together is a developer platform and dotnet is one now with dotnet there are certain languages that you can use C-Sharp the one we've been teaching today also Visual Basic and F-Sharp and then the platforms are the things that you stand on the things that you write your software for are dotnet core which is open source that runs anywhere like Windows and Linux and Mac the dotnet framework which is very popular been around for a very long time it's let you write websites and services and apps on Windows for many many years and then Xamarin or Mono which is a dotnet for mobile so you can write your dotnet applications on an iOS device or an Apple Watch or an Apple TV or Android all of this together is examples of dotnet these are multiple dotnets and that can be a little confusing itself so what we can do is just write to a standard we can use a standard set of libraries and make sure that our libraries are standard so you just think about the dotnet standard and your dotnet stuff will run anywhere which is really cool Speaking of running anywhere what exactly can I build with dotnet? Turns out you listed a few of them just now quite a lot so we have desktop micro services web mobile all of that what's your favorite? I like IoT I like being able to write dotnet on a Raspberry Pi or even on the Windows desktop so I can write a Windows desktop app and then suddenly go to a tiny device and I'm using the same skills and the same libraries which is really cool Definitely Who builds dotnet? Turns out it's Microsoft and several thousand of our closest friends so over 60,000 developers and 3,000 Hi I'm Scott and I'm Kendra and we're going to talk to you about dotnet this is our dotnet 101 video series if you've just arrived here you might want to go backwards and take a look at this C-Sharp 101 series C-Sharp is one of the languages in dotnet but what is dotnet anyway? Right So we've been talking about dotnet for a while and we haven't fully explained what it is it definitely has something to do with development so let's dive into that So dotnet is an open source development platform for building different types of apps and of course that next question is then what's the developer platform? Yeah it's a little bit confusing it is the languages that you use plus the libraries that you use and that together is a developer platform and dotnet is one Now with dotnet there are certain languages that you can use C-Sharp the one we've been teaching today also Visual Basic and F-Sharp and then the platforms are the things that you stand on the things that you write your software for are dotnet core which is open source that runs anywhere like Windows and Linux and Mac the dotnet framework which is very popular been around for a very long time it's let you write websites and services and apps on Windows for many many years and then Xamarin or Mono which is a dotnet for mobile so you can write your dotnet applications on an iOS device or an Apple Watch or an Apple TV Hi there welcome to another dotnet con talk my name is Dimitri Lailand and I'm really glad you're joining me today and today I'm going to do a session on XAML tools for WPF and UWP developers we're going to go take a tour through XAML tools I'm going to do a lot of demos hopefully everything will work and we're going to look at features that are you know existing features you can use today features that are coming so we're going to do some road map and we're even going to look kind of further out if we get time to say this is what's really coming on the pike in the future and we want your feedback on it as well so let's get going before I jump into the details of my talk I'm just going to mention that three days of content and desktop talks have been kind of spread out across all three days so desktop development is something you're interested in I hope you can check out one of the other sessions so there they are they are also in the agenda the agenda link is down below and everything will be available on demand if you missed it or we'll miss it in the future all right so my session so we're going to start off by looking at XAML tools XAML tools I'm a PM of XAML tools so WPF and UWP for WPF and UWP applications and I work closely with Xamarin forums so all the XAML teams work closely together and in my talk I'm going to cover what's new in tooling around hardware load designer and the code editor I'm going to talk a little bit at the end around modernization of applications using XAML islands and just touch on road map just a little bit and hopefully that'll be a good talk all right let's jump in so this demo was going to be a code demo but I'm going to apologize and do some screenshots but it's a cool demo so I hope you enjoy it unfortunately my VM kind of died this morning thanks VM but let's talk about a new feature we're working on in the XAML designer so if you're WPF or UWP developer and you you know use the XAML designer we're adding features to that capability right to that space we have been thinking for a long time what feature would be a good way to increase developer productivity so something we're going to ship in a future visual studio update release as a preview flagged feature so you'll have to turn it on is XAML suggested actions think about it as a light bulb on top of controls so we're starting off with a well-defined set of controls that we're going to enable this on and a light bulb is going to make all the common properties of those controls available so here's stack panel here's a label we even have nice color pickers we're going to build into that here's the image control things like source visibility very much common properties so as they kind of go down this list of controls you see that these properties are probably the ones you often have to go set and today if you go into the properties panel it's kind of hard to find the most common properties this is hopefully going to alleviate that in the future it will even expand to other capabilities as well so it's a cool feature we're working on it's going to ship in a future preview 16.4 one of the update trains one of the preview trains you know we'll put it into release notes when it's available it's going to support the controls up on the screen right now that are listed but it is going to be extendable we are going to add it to more controls in the future and we're looking at actions because sometimes you have a control that has properties you want to change and that's great other times you have a control like a tab view you need to add another tab so instead of having to know how to do that XAML or have some other paradigm in the UI that lets you enable you know to add a new tab easily we're going to try to see if these quick action suggested actions work well for you so check it out when we make it available just wanted to show you one future facing thing and unfortunately my demo failed all right so from here on in it's demo time so I'm going to jump right in and talk about a story that could have been a little bit better than one but such is life so today this week the yesterday WPF core shipped that means WPF core as a framework is GA and if you install Visual Studio 16.3 that means you have the tooling unfortunately the designer is off by default we screwed up we made a little mistake so I'll show you how to enable it if you go to you know if you have a WPF project so this is a WPF project right here you go to tools you go to options and you go to preview features if you enable use preview of the dotnet core SDK and you restart it and we'll do that just to kind of prove the point so let's restart the application real quick and I should have my little demo app okay let's get this thing open all right so you can see designer is loading totally our fault sorry about that but designer is there and we're going to service this release to make it available but I just show you how to enable it right away and start using it now the one thing I do want to point out is that and let's make sure I have the right I have so many of these little applications sorry just need to make sure that I'm looking at the right one all right yep this is the right one all right so we have multiple designers that my team works on so some of our designers you know one of them is for dotnet framework WPF one of the dotnet core and one is for UWP so if you really pay attention you switch between those three you're going to see some slight differences those are not bugs those are differences that we sort of made decisions on we're here to hear your feedback on it but for the most part most of the features of the designer work the same across all of them so everything you would expect and this designer to work works here so if I go to toolbox and I go ahead and I drag a button that works and if I resize the button that works as well XAML is changing one tip lots of people don't realize there's an edit template feature in here that can create a copy of a style this is accessible through right clicking and control on the design surface or in the document outline so it's really available anywhere and if you right click on that and say yes created within my application here you get a bunch of XAML so designers are here quite a powerful feature some of the features that we also get asked would you add the feature and we say it's there and it's our fault you don't know about it so we're working to fix that but one of the cool features is regions so I'm going to show that feature right now region button style so this came in through surveys people were asking me Dimitri can you please add this feature and I wanted to show that it's there so we can add a region and then we can collapse the region so region begin make sure it's right and the region am I having my first demo fail of the day oh Jesus you know when something just works every single time well I can assure you this this feature does work I've tested it so many times not sure why this is misbehaving but there you go sooner or later one of your demos will fail but basically regions are in there give it a shot if you hit a bug like this please let us know we're here to make it better so I just wanted to show the designers there we have region support in XAML editor and we have the ability to edit default styles or templates so from there I'm going to jump into the meat of the demo and we're going to talk about an application we're going to use this application for the rest of the talk that I've been building using some newer bits than what you would have access to but for the most part all the things they show will work with some minor exceptions and I will point those out as we go so here's my project it's here for demonstrated purposes there's really not a lot of code to it it's just a basic WPF core app I have a view model with some dummy data it's like a fake email client you know that we're building it's really really poor and there's an object called email and I'm going to do some binding to it in real time so with this application I'm going to just reset it back to the original state and just run the app and show you that it's really bare bones there's absolutely no code in here right now and then we'll begin coding and I'll talk about some of the features so first things first there's a bunch of tools that are related to the hot reload feature that I'm about to demo the first tool is the in-app toolbar this is the toolbar that appears in the application itself at the top it's collapsible one of the new features we added is we made it movable left and right because sometimes we'll block UI if you collapse it it's pretty small but still you know there wasn't sufficient in all scenarios we also added this right hand side hot reload available because developers were not aware of this feature was working or not there's some scenarios where the feature doesn't work so we added the message this says unavailable or available so that is very clear of how the reload is on and you can collapse that away if that's not helpful to you clicking on the link will take you to documentation both the documentation says how to use the feature in this case or if it's unavailable how to resolve that as well so it's a really important tool and hopefully you find it useful one of the things that a lot of people don't realize also is there's a button in the live visual tree that if you click the button it completely goes away from the application so it really doesn't have to be there if that's not something you want in our case we're going to put it back in and I want to show hot reload and hot reload is a feature that changes the app as the app is running this app is running right now I've cheated a little bit you know I've created a view model and I created all the placeholders because when you're running with hot reload visual studio will block you from adding a new control or changing the structure of the project right so you're going to have to make all that available and while I can edit C sharp using C sharp edit and continue view models don't respond very well just because of how it's architected so I put all that in place and now I want to show you how hot reload and some other features make this really good experience so with that I'm going to show you the first the first feature which I'm just going to add a button just for the sake of demonstration purposes so I'm going to add a button in here the button will be 100 by 50 all right there's the button and if I go back to the application I see the button it just appeared magically because of hot reload now this window I'd actually love for it to be visible at all times so I'm going to go in here and say top most and I'm going to say true and now the applications will be visible all the time these are changes that are happening to XAML and being reflected in real time so what if let's say I wanted to learn more about the button see the C sharp code behind it and I didn't know where the button was in source in this case it's easy and most more complex applications really complicated we have a button called enable selection you click on that click on the control and in our live visual tree you can see the button and this is where I want to highlight a new feature that's coming soon it's not yet available but this feature is coming soon it's called just my XAML if I turn just my XAML off you get a much bigger live visual tree we show you everything in a live visual tree and that's useful sometimes but by default we find that only the XAML that you've written is useful so we're adding a feature called just my XAML it'll be on by default there'll be a setting to turn it off by default in case you want the old behavior so that's pretty cool and this is basically giving you all the flexibility here to to build your app as app runs now actually let's start building the app for real I'm going to go ahead and kill this temporary button and show you a feature that we've gotten kind of by default because other teams are doing work called IntelliCode with IntelliCode you get stars in IntelliSense of the most likely actions that our AI analysis shows that you might take so RML that means we've looked at GitHub we looked at open source projects and we've made some decisions based on that data for XAML C-Shop and other languages so here it's saying to me there's a really high try probability that you want to add a grid column definition grid row definition in fact I do so as I do that it says hey there's a really good chance that now you want to add a column definition yes I do and as I'm doing that it makes writing code just so much easier so here I am doing row definition row definition I'm like tap completing through this like no tomorrow so it's really really performant and how do we load making all these changes come alive for us in the app itself so as we go through I was going to write all the code but as they realize how little time I have I'm just going to cheat a little bit and cut and paste a few times you don't really need to watch me type that's fine right all right so first of all let's add some meet to this application so I'm going to paste this thing right here all right and as soon as I do that my app comes alive I just created a list box I created a list view and if I click on the list view there's an area here where the details of the email should be coming up I've also created some references to some styles that should be in my resource dictionary now I have a resource dictionary so I'm going to go ahead and create that so I'm going to go in here and I'm going to go to my solution so here's my merged in resource dictionary so I'm going to put some code in there save that off go back so now the error went away all of a sudden my application slightly changed so as you can see it's actually working in real time hey let's take it out the application changed put it back in application changed again very powerful feature in that sense we also have a cool feature in available as part of the in-app toolbar which lets you see exactly the alignments of things so as you select you can see how that selection is aligned to other things so we draw grid lines based on enable selection so you say enable selection you click on something and then it enables you to show to show the grid lines around then across very useful feature more complex applications right there you can see exactly where reminder baby shopping ends and you can see how that aligns with that was useful so a cool little feature display adorners available and then with the selection I'm able to once again click on here and then see exactly oh where's this border defined then click on define view see where this thing is available in my source code so it's very powerful in that sense now let's keep building this application up I'm going to add some more of the code that I wrote before so I'm going to add another piece here which is a text block and and think about this my app has been running the whole time I am not having to switch switch around so as soon as I added another one let's in fact collapse this this is where collapsing is useful as I'm switching it's working right it's displaying the concept of the email now behind the scenes this is just all in VVM I've got bindings happening and the bindings are here let's lower this so I can show you we've got bindings to an emails collection an observable collection of of emails objects and we have selected item binding two ways to the selected item and then we have the text the text block binding to the selected item.body everything just works and you can go ahead and and say title so you can really change this in real time body works if you misspell something it's just not going to work until you fix it but you're getting errors inside of your output so if you're watching that you can see if you're just have spelling errors that are coming in there all right so there you go the application is being built up but that's not all this thing can do let's go a little bit deeper I'm going to go back to my to my cut and paste window here and put in a status bar into this application so right now no status bar if we were building a real client we'd have a status bar so I'm going to add the status bar in and now we have a status bar it's just connected works great but in reality a lot of the the way that you would compose a real you know WPF or UWP application is by using controls to move some of the logic out so in this case I want to move my status bar into a control now I've cheated a little bit I've already put a control in here so I have the status bar placeholder if you didn't have this you would have to stop right now and go ahead and make that happen so in here I will select this and I will say well I'm going to I'm going to cut this out because I don't need that and I am going to first add a reference to the control so all these you know normal XAML things MLNS says oh I did this before I should have cleaned it up but it's okay we'll do it again just because I want to show that everything you be seeking to do is really available in real time so here I am and I'm typing control and I'm getting IntelliSense IntelliSense showing me this is probably the control that I want to I want to highlight so I'm doing that and as they go down I can now put the control in here so I'm going to go down here and I'm going to say control column span close that out and right now it looks a little bit messed up because now my status bar lost the grid row and column span so I'm going to remove it I'm going to go and I'm going to open up the control I'm going to paste it in there and everything is back to normal very powerful you can literally be sitting here building your app especially if you again get your get your view model and everything working correctly so let's dive a little deeper on the tools that are available because this isn't everything so let's say I want to play around with the status bar but now I'm shifting scenarios a little bit I want to make changes that I don't want to commit right now hot reload is all about like you're changing XAML and as long as you don't don't delete the XAML you changed don't undo the XAML you've changed it's going to wind up in your application sooner or later now what if you want to just really try something crazy or experimental and you just want to focus on the session that you're working on now so we have a tool for you as well and I want to explain one confusion that I've heard customers say they're like well there's already a properties panel wouldn't they use a properties panel to change properties you would if you want them to be again be committed to the source code but if you just want to play with the application as it's running and just have it be temporary we have another tool for you let me go ahead and show that right now so I'm going to select the status bar control I'm going to open it up and I'm going to go to the status item in fact I'm going to go all the way down to the text block inside of it the one that says connected and I'm going to click this button right here called show properties now this will show something called the live property explorer this is another window it's not the properties window it's the live properties window so it's the one that lets you make changes that are temporary so let's go ahead and make some temporary changes just for fun first of all I don't know if connected is the word I want to say because I'm like well connected works both connected live right will that work will that sort of fit so hit enter okay yeah that's fitting the status bar is not breaking okay that's good I actually want to change font so I'm going to go in here and I'm going to say font size what if the font was 24 that's not going to work font 24 is definitely going to be was going to be too much how about font 18 still cuts off a little bit right not really great it's 14 14 oh 14 is good so now I know which which font I want to make so I'm going to go in here and I'm going to say font size 14 so this enables you to to play with application in a way that you can you can kind of go crazy and then you can reset everything back back to the default values or if you just stop debugging it will reset itself so it's very much safe to go ahead in there and make lots of changes that that you want to try so this is hard reload I've I've gone through and I've and I've built like a little application that sort of feels feels like a real application right we've got everything working and we can see clearly what our tree looks like so some of the other features that I want to point out that might you know might not be familiar to everybody is some of the work we've done so I'm going to minimize the app because I want to focus on the XAML window right now so some of the work we've done in the XAML itself one of the things that you might want to you know get help on because it's not clear where something is is for example static resources like Lizbox email style where where is the Lizbox email style located I'm not sure where where the XAML is if you right click on it and you say peak definition you can actually look at the definition and you can see the file that it's in and it's one of these temporary files that you can pin up it's just like peak definition in other languages and that works it works in a lot of places give it a try if it's not working somewhere for you let me know if there's a scenario we didn't think of we'd love to hear from you but that's a cool feature you can also right click and say or use of 12 you can say go to definition so you can actually just jump straight to the file and make changes there so if I wanted to go in here and I wanted to make the fonts even bigger there you go the font became even bigger again hard reload is still working as we're doing all of these things another feature that I've talked to people that they're not familiar we have it but it's actually really useful for really complicated applications that might have like let's say a lot of resources at the top and you want to look at something we're looking at XAML at the bottom we have the splitter right here if you drag the splitter just like in other places you can stay at the top in the top one you can scroll down to the bottom one and you can you know make changes cut and paste values things like that very useful feature and definitely worth knowing all of these little tips and tips and tricks to make it easier for you to build your XAML application so I'm going to go ahead and actually move this back up so that works and now it's back into being one single window all right let me make sure that I've shown you everything that I wanted to all right I think I did in this case so let's look at one more feature here so I'm going to stop debugging this is a feature that's available and it's best to look at it when you when your application gets a bit more complicated that's why I kind of kept it today and this is a document outline really undervalued window in the XAML tool space we're in fact thinking maybe doing more with this in the future we'll see how that goes but basically this window enables you to see the all the controls that you've written inside of your application and you can go ahead and look at the designer and you can make things you know visible or hidden so it has that ability in my case I don't have much to show in that sense but but you get the idea so these are these are temporary changes that don't apply to your to your running app it's design time properties that you're changing you can also right click on a control in here and you can edit a style and create a copy just like we saw you can click on view source and it'll select where in the source this is so think about document outline as the control that you can use when you're when you're using the designer and the XAML editor the app is not running and then when you switch to hard reload as your app is running that's where the live visual treat LVT as we call it is available for you and lets you lets you do everything you need to do there all right I also want to point out a couple of things like we're constantly making this better so I'll give you some examples there was a deadlock error like we messed up we had an error where if you said in WPF application go to definition we actually froze visual studio really sorry about that we did not mean to do that we fixed it it's in one of the recent updates there was also a bug where as you're typing intelligence for example in the code editor you would get static resources for let's say a list view and we would in theory only show you the styles that apply to target of type list view but we had a bug we were showing everything so things like that are being fixed we're not making a lot of noise about it but we know these these are behaviors nobody wanted to have and if you find behaviors that you're like why is this working kind of strange let us know we could miss something too but we really want to make it better so these are investments that are going in for WPF and UWP developers we're doing everything for everyone every type of customer that we have all right in the last couple of minutes I want to show you one more demo so one thing I will point out is that we're switching gears quite a bit here but it's really worth knowing about so I'm going to switch over so these are just the hard reload docs I had opened just to demonstrate like we have hard reload documentation that's where the link goes if you click on the link but let's switch to another another doc completely to XAML islands XAML islands is a technology that's been being worked on for a while it's a technology that enables you as a WPF or Winform developer to host UWP controls inside of your application so let's jump back into my slides for just a couple of minutes here and just an interest of time I'm going to go quickly through it and just explain that you know XAML islands think about it as if you have if you think about UWP as a whole there's a lot to it there's an app model there's MSAX there's all of these things but one of the biggest parts of it is the controls and if you want the controls in your application XAML islands is the way we've enabled this just wasn't possible without XAML islands the work that my team is doing for a future release probably sometime in a 16-4 time frame is we're making it so that implementing XAML islands will not require you to do manual steps today there are some manual steps that you would need to do we're making it so you don't need to do manual steps and the ways XAML islands work today is requires 1903 version of windows they are looking to backpour XAML islands to older versions of windows but for now that's the thing and it allows you to host inside of a C++ app as you know Win32 app WinForms or WPF application and then you host your your controls in there and there's all these wrappers that we've built I would say just look at the documentation that's the best place to get all the all the information but there's lots of wrapper controls that the team's built it's open source and it's pretty easy to implement it's it's kind of basic there's not a lot of tooling support it doesn't give you all the niceness of hard reload designers but it does work in your application so if you block this would unblock you and just a quick demo of what that can look like I will show you something that's super simple this application literally has three list boxes but it's very significant the first list box on the very left is the one that comes with WPF this is a WPF core app with a WPF list box nothing to see here this next one is XAML Island it's a it's a it's a natively used I'm doing data binding using C-sharps I'm doing it in C-sharp just to kind of demonstrate that that's possible and then we have a third one which I've styled so it's even possible to style it as well because I'm hosting it in a custom control so I have full control over style look and feel and I'll have the sample available as part of the link so that's kind of my demo all of this is here for you I wish I had more time and I'll be back on we have community stand-ups and other things we're doing via Stoolbogs to talk more about this and thank you so much for joining me if you have questions please tweet at me or email me thanks a lot all right awesome thank you so much it's Dimitri so we have a couple of questions let's start with this one so JDK wants to thank you for using the dark theme for your demo dark theme huh I like the dark theme good his eyes can't take any more of the white background so thanks Dimitri let's see what else do we have Matthew says the changes to XAML Designer that I'm seeing right now give me hope for a normal sleep cycle in the future oh hey yeah we're trying it's a goal of ours and we have some really interesting things planned for the XAML Designer if you're interested to have conversations with us again tweet at me and or email me on dimitri.lilin.microsoft.com I'll make sure my email is available easily for everybody so here's a question that I have is it pronounced XAML XAML or XAML Seth we've talked about this yeah XAML okay are you sure though it's XAML okay okay XAML XAML all right so as we go we are almost done with this part of it we have one more session but before that I want to let you know that you need to participate in the technical treasure hunt and that's the important bit you can do that all day today there's gonna be more stuff going on but before we go to the next session which is secure your Nugget package ecosystem with Karan Nandwani did I say that right yes you did we have something to show you let's take a look at it hey there treasure hunters I've got your next clue in the hunt and this one's from the folks at contrast security they want to know at this URL which one of the code snippets contains a security vulnerability do your best investigation take a look let us know whisper your response in the form of code and a letter one of the letters that corresponds to that code snippet that does contain the security vulnerability whisper that to the .net bot in the visual studio chat room on twitch and you could be well on your way to the next step in our technical treasure hunt hi i'm cam sober a content developer working on .net docs here at Microsoft welcome back to entity framework core 101 in our previous video I showed you how easy it is to use entity framework core to create and work with a new database in this video we're going to show you how to use entity framework core to work with an existing database by reverse engineering it looking at visual studio I have a brand new console app that doesn't have any code added to it at all I've already added the new get packages same as the same as we do with a new database Microsoft entity framework core dot SQL server dot design and dot tools I have an existing database this database is already populated and was built by hand by a database administrator to reverse engineer the database and create my entity model code I'm going to use the scaffold db context commandlet I'm going to pass in the connection string I'm going to pass in the name of the provider so it knows what type of database to execute the connection string on and then I'm going to optionally spass specify an output directory and a name for the database context now that the scaffold is run we have a complete working entity model looking at the product's entity it should look pretty similar to the one we created in the last video one difference you'll note however is there's no data annotations describing the behavior of these properties for example which one might be required or might be a key that's because these behaviors are contained in the on model creating method of the database context if we'd like to create an entity model that looks more like the one we created in the previous video we can do that too I'll start by deleting this entity model and I'll run the scaffold db context command again but this time I'll add the data annotations flag this time the product's entity has data attributes that describe the behavior of the properties such as the key and required and the on model creating method in the database context is much more sparse now that we've seen how entity framework core can work with an existing database in the next video I'm going to show you how to use entity framework core with ASP.NET Core to streamline your web development hey everyone welcome to .NETConf my name is Karan Nandwani I'm a PM on the NuGet team today we'll be looking at how you can secure your NuGet package ecosystem in the recent past we have there has been an increase in the number of supply chain attacks and they have made the news we have seen that there has been a propensity for using package managers as the as the mode of attack for some of these things today let's let's look let's recap some of these incidents and see what we can learn from them so homebrew is a package manager that you can use to install software on linux and macOS and there are many use cases here such as setting up a def box really quick with the essential tools so that that new developer might need now in this case sometime last year a security researcher was able to get access to the core homebrew repositories they had commit access to these repositories which means they could have made a change and that change would have flown to anybody that that ran homebrew update or recently installed homebrew and they would have gotten their malicious formulae now the takeaway really here is that there was no way for the end user to protect them protect themselves so really what we are asking is there should the tools that package manager should be able to detect if a package has been tampered and block installing such packages in addition there should be a way for package authors to stamp their identity on a package and the on the other end for a package consumer to be able to validate this identity and confirm that this package truly came from who who it says it came from in a separate incident last year with npm the npm account of the of the maintainer of a really popular package was compromised the attacker went on to publish a malicious update that got into 4500 accounts and got the credentials before before it was taken down now this was we should understand that this was not a fault on the npm.js side the the attacker was able to get the password and username for the maintainer from a third party leak and was able to reuse it to gain access to the maintainer's npm.js account so the clear takeaway here is that username and password security is simply not enough in a separate incident a attacker uses a different vector to target target package users they published several packages that that looked very similar to a very very popular package which has over two and a half million weekly downloads the they then went on to these are all malicious packages that harvested environment variables from the victim's machine and this attack went unnoticed for nearly for nearly two weeks so the key takeaway here is that repositories popular repositories should be able to detect and block typosquadding attempts in addition there should be a way for users to define which which publishers they really trust and if a package does not meet that specification it should fail to install now let's take a quick look at what does a typical NuGet workflow looks like and what are some of the best practices so let's say I have an awesome library that I want to share with the world and the obvious next step there would be to create a NuGet package the first best practice here would be to author sign it now author signing it allows me to stamp my identity on the package and on the consumption side it allows the consumer to validate that this package really came from me next I want to publish this package to let's say NuGet.org last year we NuGet.org adopted MSA based authentication which allows users to opt into 2FA now setting up 2FA is really easy it is literally three steps after you log into NuGet.org now if you are an enterprise customer that uses Azure Active Directory to log in you can ask your admin to enable 2FA and it's just that easy as we have seen enabling 2FA would have prevented several of these attacks that that we looked at the next step here really is to publish this package to NuGet.org now when the package is being pushed to NuGet.org we actively check if this package ID looks very similar to an existing package and if it does we block it from publishing at that point itself after it passes that and it does not look similar to an existing package it undergoes several checks to see including virus scanning to ensure that this package is safe for consumption once it passes these checks NuGet.org then signs it with its own repository signing cert this way you can be guaranteed that this package is truly coming from NuGet.org even if you are using it through let's say ADO using an upstream source or this package or rehosted on an internal feed etc. now let's look this was the publishing side of things let's see what we can do when you're consuming these packages so to begin we have something called as client trust policies this allows a package consumer to define policies that say I want to trust a package that has been authored by a certain author or I only want to trust packages that come from a specific feed let's say NuGet.org and you can get more specific by saying only by these specific users or accounts let's take a look at a quick demo of how you can do this in your day to day flow so I have a a solution that is NuGet Cleaner I'm working I've been working on this side project for a while now along with the new PM on the team and I want to implement client trust policy the first thing that I did here was add a new NuGet.config file and this file is at the solution level this is necessary to isolate the settings that I want to apply to this solution from the other solutions that I might have on my machine so the first thing I really want to do here is start using a start validating signatures when the package is being installed the way you would do that is by setting the signature validation mode to require what this does is every time you install a NuGet package to any project in the solution it will check that the package has a valid signature now this happens at the time of installation which means when the package is being extracted it checks for this signature and then that point onwards that package assumed to be safe hence it is a best practice to add a new global packages folder which is exclusive for the trusted packages that you want to use with the solution the way you can do that is simply by using by adding a new key called global package folder and defining that folder now let me quickly close the solution and reopen it so that the new config can take effect all right so let's try to install some NuGet packages into this into this project I'm going to try to install need inside of json and what do we have here the package failed to install although it has a valid signature the reason for that is we although we said we want to validate packages on installation but we did not really specify what pack what packages or sources we trust so the next thing to do here is define NuGet as a trusted package source the way you can do that is using the NuGet trusted signers command and you can say add a new new trusted signer and say NuGet and what this does is it'll go out to NuGet figure out what is the right fingerprint for the for the packages that are signed by NuGet and in certain your config file so I'm going to once again reload my solution for the settings to take effect and let's try to install that package again and as expected this package now successfully gets installed but what if you told me that I I want to have more fine grain control over the kind which users on or which package owners on NuGet or get trust you can easily do that by specifying owners and in this case I'm going to say I trust James and K and I trust any packages that is published by Microsoft awesome so let's reload our solution again and we're going to try to install a bunch of more packages so I already installed Newton's or Jason I'm going to try to install this one for Microsoft it should since tells me license acceptance goes through perfect now what if I install try to install a package which was say something like this castle.core and as expected it did not get installed because although it is it has a valid signature it is not in our list of trusted signers so to summarize client trust policies allows you a guarantee is you package authenticity and integrity that is you're guaranteed that this package truly comes from who it says it comes from and that the package has not been tampered with after it was created or published to NuGet at all now in addition to client trust policies you can also use log file what log files do is they store the hash of the package content and when a package is being restored it validates this content hash against the package which is being restored if the match if the content has does not match it fails the restore and ensures that a package does not a bad package does not find its way into the into your NuGet dependency chain and to close the loop here we have hosted a first-class and highly available symbol server on NuGet at all this allows package owners to publish symbols using the new snub cake format the new snub cake format uses a secure portable PDB for symbols this also allows you this also allows you to and securely debug your debug your NuGet packages and to make things easier NuGet Rock symbol server is listed as one of the default sources in Visual Studio the added security here is that the NuGet the DLLs in the NuGet have a checksum for the PDBs which means that when you're debugging the Visual Studio debugger will actually validate that this checksum matches and provides for a secure debugging experience now let's take a sneak peek at we will be integrating with GitHub token scanning service what this means is if you inadvertently checked in one of your NuGet or API keys within seconds we will be able to detect detect that and delete that API and disable that API key and also notify you this will ensure this will minimize the the potential for malicious use of anything that has been the any API key that you might have leaked uh also we are working on a new feature that helps you identify and flag vulnerable packages anywhere in in your dependency graph this includes any packages that you have taken any packages this includes your transit dependencies as well and this will allow you to proactively update your dependencies to a one to the ones that have do not have these vulnerabilities and ship more secure code and applications to your customers so for anything that we looked at today uh you want to know more go to akms slash secure NuGet and you have we have links for everything there um that's all we have for from from the NuGet perspective thank you very much all right I'm excited to be here Mika me too so we have just come into frame because I was seeing like some spice girl stuff over there yeah and they're like hey Seth the director's like you need to go in there right now right now yeah because you know you're not a very good singer when it comes to the spice girls number one and number two you're kind of working and you're like you're on the clock let's get in there yeah maybe do something yeah all right so what do we got here for a new post looks like we are done for today thank you so much for that that was awesome the cool thing about NuGet the cool thing about NuGet that I like is that it allows you to share code but that's also the bad thing about NuGet so it's good to have all of this this infrastructure to make it a little safe do we got anything else in there yeah Ryan actually is talking about securing NuGet packages that build super pumps about this session also fantastic so securing NuGet like I said the cool thing about NuGet is that you can share stuff but that's also a bad thing about NuGet okay so look we are done in studio for today yeah is that right yes we are okay so what we're going to do what we're going to do is we're going to now toss it over to studio see yeah so you can still ask questions on the.net com hashtag but I'm probably going to go home and like have like a dinner and then maybe go to sleep or something yeah take a nap sink some more a spice girl so what we're going to do is we're going to have Jeff come in here because right now come on over dude as he's coming we're going to toss over to them you had the party last night too right the after thing we had the after party last okay okay yeah okay after party party okay and so were you wearing that no okay so so now this time we're going to have like an extra party so looks like you're muted right there so what we're going why don't you why don't you talk into the small of my chest here hi Seth it's so good to see you how are you buddy over so that I'm not muted now he's on am I on can you hear me now I know you're on before but not with the mic I say we're professionals so let's go show more studio C is let's go for a walk all right yeah let's do it so what we're going to do is we're going to go out here I'll open the door for you because no one ever gets to see Channel 9 Studio the way I do so this is Channel 9 Studio yeah that was off so let's come over here wait come here I'm going to I want you to meet someone come here come here closer closer this is Beth Massey she is the one that did all of the work we just stand around and look pretty here looks speaking to this right here I love you all thank you so much we had such a great event we adjusted the mic so that she could literally talk right into it right do you see this this was all planned by our wonderful studio people so we're going to have you back up here let's come over here let's go for a walk let me show you all the buttons that they push I'm going to try to push some buttons and if anything happens just let me know this is where all the buttons happen right this is the director here camera and cam cam goldmose tells us what to do and we do it mostly out of fear so there is that and so these buttons she says never to push okay this means that we're recording it right come on come over here so that way at the end of 24 hours all of this stuff all of the hot little bits are going to be in your hands as well so should we go back to Studio C let's take a walk all right come on let's come think it's about time let's come this way here so you don't want to take it back is that awkward for you no no no I got to come over here so this is Studio C obviously it says warning anything in this room can be live stream so we're going to go in here so let's open it up here we go okay hello fantastic oh my goodness this is now where the magic is going to happen afterwards so why don't you come in here here join us very good oh my gosh so we're about to go live live 24 hours straight on Twitch twitch.tv slash visual studio if you're out there if you're watching on Twitch click that follow button you want to follow along you want to know what's happening because we've got lots more content after .net conf for you but we've got our crack team of hosts all throughout the day you're going to see a bunch of folks hosting showing content throughout the day or every time zone so they are telling me to wrap in my ear because I have a special ear piece that makes me get into really special places all the time it's really fantastic so we're going to wrap it up here with the .net conf from studio a oh they tell me to keep talking so Javier here is the other mastermind that you may not hear let me scoop down so you can you can talk into he does all of the website stuff and he brought up a beautiful dashboard you're welcome hold on let me get closer you are welcome thank you thank you so here here's how technical we are look at this double keyboard two keyboards because I have to this is a two keyboard show it is a hunt it's great and there's more buttons look at all these buttons there's buttons don't push this one though they told us that this will cause issues it is not good there's literally an X there that says don't push it but I kind of want to push it all right no so before we go we'd like to say thank you for those that were with us in studio a we're going to turn it over to studio c after a short little break but it go to twitch.tv front slash visual studio to continue all of the joy and the fun make sure you tune in see you there