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 ru