>> Hi I'm Matt. I'm a program manager on the Azure tools for Visual Studio Code Team and I'd like to welcome you to Microsoft Connect. I'd like to show you some stuff today that my team has been working on to help you be more productive, building your apps locally, and then extend that productivity to the cloud as you deploy your apps and adopt Azure App Service in Cosmos DB. We'll start with this app here which is an Express app built with React and uses a Mongo database on the backend. I'll start this app in debugging mode just to give you an idea of what it looks like. You can see it's a sticker app with no stickers. This will let customers come and browse and order stickers and customize them, but again, there's no data. So let's populate our database with some data. So the first thing that I want to show you is the Cosmos DB extension that I'll actually let you work with your database is locally as well as on Azure. In this case I'm connected to a Mongo database that's running locally on my machine and this app is configured to use a stickers database on localhost. So let's go ahead and create the database that we need and the collection which is just called stickers. There we go now we have a database and a collection with no data. So, I have some initial data that we can use. I'll copy this entire array of sticker objects, and I'll open up what's called a scrapbook. So this is a fairly unique concept to the Cosmos extension. What a scrap book because is, is a way to write your Mongo queries and get IntelliSense for the database that you're actively connected to. I'm already connected to the stickers database, but to do that what you would do is click on the "Connect" button. Choose my attached accounts, my local database, and the database we just connected to or we just created. Again, you will get some intelliSense on here so when I type Db, you'll see the stickers collection is automatically recognized as available and we're going to do an insert mini. I'll paste the array of sticker objects I just took from my initial data and we'll execute this command. As you can see, 15 stickers were added, we can expand the collection and actually see those collections or those documents within the collection, and I can actually click on these documents and make changes to them directly in the editor. Saving will upload the changes to database. But for now let's just go back to our app and make sure that the data works. Okay. Cool. So this is what it's supposed to look like and it's working on our local machine and let's go ahead and deploy that to Azure. To do that I'm going to use the Azure App Service extension which is our platform as a service offering that lets you deploy your applications and scale them as the demand arises. This all starts with the blue up arrow which is the deploy button. I'll create a new app, let's give it a name and I'll pick my node version. So what this is going to do it's going to call out to the Azure APIs to create an App Service plan which is basically a VM where the app instance will run. You can have multiple app instances running on an App Service plan. It will also create a resource group which is a logical grouping of Azure resources that you can use to manage various pieces, and it will create the app instance itself where the app will be deployed. Now that the app is created, I'm prompted to choose the directory that I want to deploy it to the app instance. We'll skip this part for now but if you wanted to you can actually let the App Service extension remember which app was deployed to this particular app instance so that in the future you aren't prompted for which app you want to deploy to. So at this point it's going to package up the app. Since we're in the default configuration it's just going to use a zip archive It's gonna take all of your code. Put it in the zip archive push it over to the Azure API where Azure is going to take over extract all of the code, run NPM install in the root of the project, and then start the application. So now that our app has been deployed we get notification letting us know that we can connect to the log stream or we can just go ahead and browse to the site. So let's do that and get an idea of how it's working. Again, we have the same problem with no data, but in this case I've actually created a database out on Cosmos that we can connect to. To do that, let's go into the App Service extension here expand the node for the app and choose connections. This will let us connect to a MongoDB instance that's running on Cosmos or in Azure. Choose connect or pick from my subscription. Again, I've already created a database for this, and it's going to automatically create the environment variable that we need on Azure to connect to the database. I'll use the default value of Mongo URL because that's what this app is looking for. Now that it's connected we can actually reveal this database in the Explorer which will take us directly to the Cosmos extension. We can expand this and the same functionality that we had on the local environment we have again here in the production environment on Azure. So, I can do something like make a change here. When I click "Save" prompt it to upload and refresh the page and take a second for our environment to be reset to use the correct environment variable. Now our stickers are loading. You saw that I made a quick edit to the markdown sticker and that did show up right here in the production version running on Azure. Okay. So now we have our app running it's connected to the database but deploying from the editor's a little strange. So what we're going to do is we're going to set this up to automatically deploy from our GitHub repository and we'll do that from the deployments node. I'm prompted automatically to connect to a GitHub repository. I'll click that, choose my username, pick my sticker app project and we'll choose the master branch. So what this will do is set up all the hooks out on GitHub to automatically pick up pushes to the master branch. This also includes things like pull requests that are merged into master, and then anytime that happens the code will automatically be synchronized over to Azure and it'll be running just automatically as we develop our app. This step takes a little bit of time because it is actually setting up the hooks and that it's going to do a sync or deploy, and get all of your all of your assets out on the worker and running. Okay now the application is connected to the GitHub repo. You can see the commits that have been deployed to this app before. At any point in time I can actually right-click these and redeploy to revert changes if I find that they aren't quite working as expected. So we have our app now configured to deploy automatically but the App Service Extension will let you do other things as well such as manage the state of the app. You can browse directly to the website, stop-start restart. You can actually set up your continuous delivery here as well. Your next step would be to set up continuous integration on your GitHub repository using something like Azure pipelines, and this will run your lint and unit tests tasks as you validate PR's and you do your code reviews. Once you merge those items into Master they'll automatically be deployed to App Service. For more information or to run through these things on your own, you're welcome to visit us at any of these resources, visit our docs page, there are specific tutorials that walks through the steps that I just showed you. Also please reach out to us if you have feedback about any of these features. I'd like to thank you for your time. Enjoy the rest of Connect and happy coding.
Wednesday, 23 October 2024
Breakpoint Groups in Visual Studio
hello everyone I'm Isadora I'm an engineer in the visual studio debugger team at Microsoft and for this demo I'm going to show you what breakpoint groups are and how they can be very useful when you're context switching between different bugs in the same project so for this particular demo what I have here on the right you can see it's a very chaotic city which is authenticity so this is a fort from transport icon which is a very cute and sweet game that I wanted to use for this demo this project as you can see has a lot of files so if I just want to keep track and have a debugging workflow here I'm quickly going insane but before we can go on and say let's just try to understand what this actually does just we can have some context because context is pretty important when you are debugging something so here you have a poses it's picking up people and going back this is like one of my favorites they have this pretty training that's going here and pick you up around and getting back to the city and you also have this Mayo buses that are just delivering mayo and coming back to it so they are all different doing different stuff and one thing that you may have noticed is that through all these different kind of things there are different things that I want to make one of the book so if you look here I already have a set of breakpoints that I picked just for this demo so here I have stuff like order trace and check and you can already have seen here that these are actually a group of breakpoints that point your other ones so it's much quicker if I'm debugging a particular context but let's say that I just want to debug order comments so every time someone has an order I'm going to stop here and then I can just step through and see what's doing oh for example here it's asking this guy this phone call here to go to this particular station and I can see oh this is and then I can just be super confused about it or maybe I can just pick this group idea and say that's his name now and if I hit continue I'm just going to stay here and let's say that I don't want to debug orders anymore and what I actually want to do is I want to debug traits so I can just click this right and it's automatically enable all these other breakpoints and then I can just hit continue and then you can see that I already checked if the train stay in Depot or not but I say I don't actually want to be here I want to be somewhere else so I can just drag this breakpoint around maybe around here before it even has a chance to return and then you can see that I even reverse my train and it's a different thing and it's all part of this breakpoints here and then I can just quickly keep stepping and going through different things and I have all the things that I want evolving trains and I can even do other stuff like let's say they only want to debug trainings when order has been emitted so what I can do here is actually set that I only want this to be hit when this breakpoint for order has also been chosen so you can see that they are all disabled and then I actually have to enable my parent breakpoint and as soon as an order has been updated here right here you can see that all these other breakpoints were just activated so this can also be very useful to have a function that SD cost several hundred thousands of times and just want to enable them in a particular context and similarly I have this other I can do like check orders so like every time someone's updating the order I'm doing something or just when someone is unloading the cargo I can go ahead and see whatever they are doing and yes just so useful when you're sharing like projects with like a huge team or like a huge code base and you just want to keep your debugging workflow saved somewhere and actually persisted and actually being able to jump through different context switches around one of my favorite things that even has support for emojis so you can put Emojis anywhere you want I highly recommend it if you ever want to try something else in your debugging workflow and that's pretty much it so for follow-ups I highly recommend checking out the Twitter handle for vs debugger or the blog post for breakpoint groups you can find much more information about how to create them how to use them or just how to improve your debugging experience in general
Awesome games with .NET, Visual Studio 2019 and Unity 2019
welcome back and today I'm going to be talking about unity my name is christos Matias I am a product marketing manager for unity and mobile and I have really created interesting 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 he can build with it and then I'll show you how to get started if you never done get into 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 visually for Mac to write your games and we'll do that 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 gaming team but now they're targeting different industries so the goal there is to give you the tools to create applications for not just games but 3d real-time applications and they're the most widely and known engine and it's built on dotnet so if you are Dalton a 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 the 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 and that's also their TV OS that the platform is insane so taking your dotnet skills with a 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 twin 2019 point to version of unity things have changed quite a bit on how you install and 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 then allows you to actually go and get the bits that you need so it's a unity first experience and many developers that know unity will start from there but if you're already a Visual Studio developer there is a way for you to add the unity workload to allow you to get started so we'll we'll see how you do both so if you're inside Visual Studio that you select the game development with unity and that will download the unity dependencies for you and the other way around if you are ready on unity then you can go and add the components that you need so if you aren't on V on Mac OS then it will download the adversity for Mac components if you're on Windows it's clever enough to let you know that you need to download Visual Studio so I already have both the installers here so if you're in visited installer it's 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 out they have selected a game development with unity if you don't have it selected you add that and we'll 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 download directly unity and get started but now and they have a unity hub like the views to the 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 and 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 in inside unity and the visual studio installer that show you that everything has been configured correctly so we're ready to go with this 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 velocity because it's the best editor out there so next we're going to look at why would you want to use Visual Studio or velocity for Mac over say notepad or OneNote 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 TV studio or if you just focus on unity then I would like to highlight some of the big features here obviously refactoring as 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 the line or you can instantiate the command by using ctrl or command dots and you can go straight to definitions I will show these in and then demo very quickly you can navigate the compiled assemblies you can get suggestions for variable names the idea guides you through a lot of a good practices and would try to give you the tools that you need to build good code so if you're creating a 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 certs and that's very big because if you have a big codebase and as your codebase grows you want to be able to quickly search and find a 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 video for Mac and you'd like a specific set of bindings then we also give the ability to actually switch the bindings around around so if you're envious to do for Mac there's a setting there 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 and next one we have Intel akkad some people may already know intelligence and Intel quad is is the next level it's the AI guided intelligence that you get inside your code and it's always context aware as well I will do a demo on how Intel code works and how you can improve your game coding visit of your life 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 yeah there's always the internet but there's nothing as somebody out there that can help you out so using live server you can actually set up a session to sir 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 in my game I don't know what to do can help me out and you can actually spin up a session inside Visual Studio they could be sitting on the sofa playing with their vision studio code doing some web development they don't need to have the exact same setup you'll be setting your environment so live sir allows you to unblock it allows you to share your environment and find solutions to problems sometimes you can use it for as a learning experience as well so that's really important I will show you how to spin up a live search 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 an 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 rosin analyzers and getting a get feedback about the quality or the errors in your code editor config is very big lots of people talk throughout the conference so far about a tour config and how it ties very well with visual studio or visitor for Mac and for those people that have not used a tour config before it's 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 declared in your code if you want to go down the 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 a code lence gives you a very quick glance about how your code and has changed over the times and over the years how many seconds you had for a specific method and what have you and then some other capabilities obviously if you're changing across machines if you work 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'd prefer dark themes and 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're at the 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'd have talked about refactoring so usually when you are sitting in your ID you can control dot and then we get intelligence and says you know we can remove those usings and you know make sure that you don't have them anymore you can also fix on all document or projects and all solution so if you brave enough you can apply that setting across to 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 limited to another one you can see here again we have fixes talked about the multicolored editing so if I were to say I add new methods I could do control out dot and then select multiple locations or control shift dot sorry control out select one two that seems to not working okay I move on but we can also do multi line editing so if you're here and you want to change from private to public and go public and automatically applies again we do support multi carry at 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 a tour config and they just way to showcase these if I jump into my files desktop and I can I already have an editor config they just way to get started I find is if you jump to the Roslin repo on github they have already an ATAR config that is pretty well tweaked so far so as soon as we drop the editor configure there you'll see we have all these different settings and 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's very well debated and a heated conversation so I go with tab and save that saving thinking about it there you go so if I switch back to my code you'll notice that right now I have 4 spaces everywhere but if I do ctrl K and ctrl D automatically applies the editor config settings to my code that means that the soon as you you add your ATAR config you can go back and apply those settings to your files which is fantastic that that means that your team can have a consistent code base there so I mean 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 tubs space save that and again not applies and I did say I did mention about life sir so you've never used life sir it's available on V video and visit your code and you don't have to have the exact same environment on the target machine the one that you're sailing with but you can go into live sir it's already kicked off a stirring session I don't have any one right now - sir with but if I go into more info you'll not study 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 development you're new and you need support and throughout the your coding session so I'm just gonna stop that life 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 and code lands we're building source control yet let me just show you this one so we source control again it will automatically pick up I was using get locally here so you'll notice that there's a lot of files that have changed throughout my editing you can also use an an exclude circuit ignore to exclude some of the files because obviously you don't want to take in everything and 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 won't ignore your debug you want to ignore other things and that are not relevant to you or Windows that are not like to box then you can come here create your session and your your layout and then you can apply it I know where you're these settings do carry with you as soon as you log into business to do with your account so if I were to change the 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 save great one for a guarantee obviously but it's fine so I'll go back to my default layouts go applying this one fantastic anything I want to highlight here and Intel Kota I will show you in a bit and now I will explain why real-time analyzers we have Roslin if you know if you don't know about Rosen you can download and install Rosen analyzers the ID also comes with some default analyzers here as I type it might come back 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 rows 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 there they said your code on fire right did you become a lot more efficient obviously Intel code now has been designed to work with most of the SES our 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 it will provide you with the best ideas as you type and Visual Studio does come with superior debugging we have the ability to set up trace points and breakpoints and really dig through the code there have been already sessions that so what vance 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 it has unity API reference and unity project Explorer so that 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 I thought simply going back to the ID up until this point we only had that ATS so you had to spin up the game and so you spin up the the video studio attached to unity and they had to go back to the unity editor and spin up the game and then set break once here in order to be able to attach but now lo and behold we have attached the unity and play straightaway so you will kick off your a 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 right let me stop that one bring it back to focus I think it's right something something resolutions 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 and before even starting coding anything this these were just Dom objects sitting on our scene so what I did is I actually add user controls to be able to navigate around the car and then I wanted to 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 toss the crate it just explodes so right now we're here you see it actually has kicked off the game so I can see ya think there you go we can never get around the space it's very basic I showed them to my daughters and we're 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 movements and then one more line of code that actually allows us to control the camera now I did speak about Intel akkad 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 Intel code here it tells us that the code that you might want to use this 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 massive API here I have no idea what I'm to do so Intel occurred 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 notice that it's changed sadly so it gives us the route 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 intel code hones in into those skill all those parts of the API that do you make sense to you right I did talk about Intel code yes and one more thing about and Teleco right we already have the automatic Intel code which does a lot of things out of the box for us but you can take it one step further by train in Teleco to apply specifically to your codebase so if you search for Intel akkad up here in Turley codes you notice that there's a Intel code model management and what this does is allows you to submit your code to your Intel code engine to create the model that you need to apply to your machine and that makes it very specific to your codebase 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 low of classes that you want to be able to quickly bring to the surface and Intelli code allows you to do that and you also have a custom model for unity to allow you to even be more efficient right by ends up jumping back into our unity the last thing I wanted to do is obviously show you some of the the good things in Visual Studio we do have they're built in out to create C sharp files sader files and in um 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 are the law 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 support more unsafe code debugging options and 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 sis or Diagnostics so with that I wanted to go back to our game and just add the explosion because as I said I promised your explosion so we'll see some explosions this time I'm going to go via unity so here you'll notice I have an obstacle and which are actually using to create new lots of obstacles in our game because we have about six of them it does 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 sharp files so a new script we'll call it collision detection because it's actually colliding with something collision helper there you go can you script collision helper create an ad 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 this ones because I don't need them and I'm going to add my snippet so what we're doing here very basic it took me probably two hours to figure it out for lives 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 without 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 achieve use the curly brackets that Matt stalked on the first day to check whether it's null or not and then we need to make sure there's no playing right now and then kick off they're destroyed so I'm going to kick off the game now let's save this one and 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 and explosion right that's it four lines of code and 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 add 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 a how to build your first game our PM John Miller wrote this one it goes through step by step on how to use versity for mac and build your own tic-tac-toe game so thank you very much thank you very much for joining me today
Automated and Manual Testing with Azure Test Plan
hi I'm Donovan Brown DevOps manager for Microsoft I'd like to introduce you to Azure test plans manual testing can be a key testing technique to delivering a great user experience as your test plan offers the features you need to manage your testing effort from manual and exploratory testing to load and stress testing let's jump right in and let me show you how you can get started to begin with manual testing I'm going to start right here on the landing page of dev Asia calm I know which project I want to start testing with so from here I can click on the test link this is going to take me to my test plans before you can add test cases you have to create a test plan simply click this link and enter a name a test plan is made up of configurations test Suites and test cases which can be broken down into shared test steps and use parameters let's begin by adding configurations upon which we intend to run our tests to add a configuration click the configurations link and the left navigation here you can review all your configurations and configuration variables we're going to be testing a web application using Chrome and edge both from Windows 10 we can edit the existing windows configuration and add the browser configuration variable and set it to Chrome now save the changes and let's add a second configuration for Windows 10 and edge you if we need to track additional attributes of our configurations we could add additional configuration variables and the valid list of values we can then add them to our configurations but for now OS and browser are all we need test configurations can be assigned to the entire test plan or individual test Suites and even test cases assigning a test configuration to the entire test plan will ensure all test cases added are automatically assign to those configurations setting up your configurations first and associating them with your test plan makes creating your test matrix snap with our configuration set we can now start adding test Suites which are collections of test cases there are three different types of test Suites static requirement based and query based a static suite is a logical container where you can add any test cases you like when creating a static test suite you just add a name a requirement based test suite is where you associate your test cases to a work item to define its acceptance criteria this linkage will be visible even outside of your test plan the final type is a query based suite where you create a work item query to select which test cases to include any test cases that meet these criteria will automatically be added to the test suite let's edit a test case to see what they are made of you have the steps to execute in any expected results steps that are repeated often can be extracted as shared steps to ease with tests maintenance lets associate the new configuration to our test case once we do you will notice our test case is now listed twice once for each configuration now we can run our test case and collect the results notice that we can test web applications and desktop applications as well with the test runner being web-based we can execute our test anywhere including on a mobile device now we simply follow the steps and pass or fail them based on what we observe the first step instructs the tester to open the admin page then open the security page and finally click members to see if Stephen is shown as we can see my name is the only one listed so therefore this test step has failed I'm able to leave a comment and even follow bug notice that the bug already has the steps to repo filled in from the test case once I stopped testing my test status is updated and I can continue with additional testing from the runs page I can review all my previous test runs before I go I want to encourage you to visit Docs Microsoft comm to learn more about manual testing
Monday, 21 October 2024
Achieving No Downtime Through Versioned Service Updates
so I'm gonna switch topics now and talk about upgrade so kind of going back to for my overall theme of us evolving over time from TFS into and on into a cloud service upgrade was a big deal you know back in the case with TFS still case with TFS you got to take it down early on with the STS it was the same thing take service off line go upgrade it which it's complete non-starter for a global team if somebody somewhere is critically in it has a critical dependency on V STS they're trying to ship something they're trying to patch their service it doesn't matter they've got stuff going on there's never a good time for everybody so we got to be able to do this this online now if you're gonna do an upgrade not everything can change simultaneously it just not possible so if we're not going to be able to change the application tiers the job ages the virtual machines as a unit if we can't change the virtual machines in the database together at the same time who's gonna have to handle the fact that they're different where are we gonna absorb that complexity and we've chosen to absorb it in the application tiers and the job agents and a lot of this comes back to you know I mentioned before we got a ton of sequel the thing with sequel is sequel with if-statements is completely awesome right we all enjoy writing sequel with lots of branches in it it's crazy right so we said instead of complicating further complicating our sequel we're going to handle this complexity in net and now you could do this in Java or any number of different languages obviously for us its net so we created a set of factory classes that understand the sequel versioning so every sprint you create a new interface with that version and you kind of march along in time and that way there's always a set of binders that match whatever version of the database is this also by the way allows for easy rollback miners because the first thing we do is to ploy the binaries after we deploy the binaries then we kick off the database upgrade so if we deploy the new binaries something goes horribly wrong we can we can roll back the binaries that's easy enough and this is much easier to test because now we're testing you know standard net code we can write unit tests for it it's it's much easier to deal with step through debug etc than dealing with this as a crazy set of if statements and branch in sequel so how does this actually work so we need to be able to do these schema upgrades online and like I said the first phase is we go deploy binaries the binaries in a given sprint deployment let's say so we're currently in currently deploying sprint 123 the binaries understand sprint 123 database schema and they understand sprint 181 22 schema so in and n minus 1 and the binaries will query a sequel and find out what scheme I'm not talking to you oh it's that one I'll load that binder again going back to the factory class of loading what matches the database and it is you decide hey I need to upgrade my data I've added some new feature let's say I've added a new feature to work out them tracking great I'll go add let's say a set of nullable columns I'll start populating that with data I may even put in place the sequel trigger to keep it all in sync but before any of the actual upgrade happens per se I've got to create the data because as you'll see when we want to do an online upgrade if we're not going to take you down it's got to be invisible to you so if I'm gonna do data transformations and if this is done at any scale it's got to be done before I lock the database schema before I block anything that you're doing because when I take that lock it's got to be fast so the first thing we're gonna do is you're gonna go manipulate our data whatever that means for the feature that you're working on and for something truly large this could take multiple sprints like when we changed work atom tracking from a wide schema to a long schema that was multiple sprints and every sprint made some changes to the schema some of them like that are very complex most of course are much simpler so once we've gone past the phase of creating this extra data in nullable columns it could also be in brand new tables with different names that will later swap in we go into what's called deployment mode for the application tiers and the job agents and this is where they when they make a call to the database they grab a reader lock on the schema and front from from a standpoint of of using the sequel if you will the the job agents and the ATS are effectively readers of the schema it's kind of a little bit of an odd terminology but that's what they are and meanwhile the upgrade itself is the schema writer and is trying to grab a writer lock and so there's this this dance that goes on in the code where every time a call comes from a tea or a job agent into the end of the sequel database it grabs the reader lock on the on the schema meanwhile the the upgrades sitting there trying to find a moment in time to grab that writing lock try to grab it nope can't do it try it can't do it oh wait there are no readers grab grab the writer lock make the final set of changes which is I'm gonna update the metadata I'm gonna swap in the new procedures I'm gonna swap in the new types I may even swap the names of you know let's say this new set a new table that I built on the side that's actually gonna take the place of the original I do that swap very very fast small number of relatively speaking of operations and then I'm going to release the lock and what you as a user should see is you should never notice if you happen to be using the your account at the moment this happens let's say you're you're gonna go save a work item it may take five or ten seconds to save that work item that particular time you go huh that was kind of slow and but everything else goes back to normal like the most you should see is that something slows down for a few seconds and then it all goes back to normal you don't lose any data you're in the midst of updating a work item that all happens for you none of that data gets lost it's completely invisible to you and by the way as part of this you know I don't really dive into it but we've also have to have the web UI handle online upgrade as well so when we upgrade the JavaScript files and the the style sheets and the icons and kind of all this stuff if I go make a let's say I do a major facelift to some particular area of the product if I have changed that UI and then you hit save and suddenly the end the call goes to the new stuff and the new stuff wasn't it was expecting something different than your data in the format that the browser sent it it's all gonna fail so even the web UI is versioned so we've got versions of the the type script that icons the style sheets everything it all loads from a bird and folder and that way until until there's a full page refresh that happens you're still using quote the old UI you do something along the lines along the way that triggers a full page refresh you switch hubs or something you get the new web UI but again everything set up so that you don't notice the upgrade happens you just get new functionality yes how are you deploying the the sequel using scripts using tack pack files good question so ed glass is going to talk more about how we do the actual deployment but a lot of it is driven through scripts so all of our sequel is checked in to birth control we've got lots of dot sequel files and the the way servicing is done and everything there's a set of things to get auto-generated to make some of the surfacing steps happen and so forth it's all done through through the sequels in text file so it's essentially a script and then we have something we call light rail that's a set of PowerShell scripts that actually drive the upgrade we built all this stuff a long time ago over time I expect to move to something newer but right now it's working well for us and kind of not a need to go crack it open but ed glass will talk more about how that actually gets deployed question No ah so a good question are the deployments manual thankful the answer is no we would go insane if we had to do 192 scale units manually so they're they're highly automated what actually happens and I think he'll show you some screenshots we actually use release management so the STS deploys V STS and that does mean we do have a way to deploy vs TSM vs TSS down right so but V STS release management workin straights the overall deployment there's a set of scripts that run the actual steps and everything so it's somebody goes to the UI and says hey I'm ready to deploy sprint 123 and they kick that off and it progresses through the Rings and he'll show you two it automatically goes from ring to rain it's not a manual thing that somebody says oh I've done ring 0 let me go queue a deployment for ring 1 now let me cue a deployment bring 2 doesn't work that way it will pause and you there are cases where we say hey we want it to pause we'll wait a day to do the next step somebody has to go say yes it's ok because if something goes wrong want to be able to react to it and not have it propagate out to the rest of the accounts of course but he'll go through it in detail but it's all fully automated and that always that wasn't always the case by the way question for all the different assets that you version whether it's store procedures or files JavaScript whatever how do you is your something do you have a complete copy for every version of the product internally or do are you doing some other kind of scheme like some form of copier and rage or something like that so it's a good question so the version it's actually got a full copy of every version so for example in Azure storage there's a full copy of every version of the the JavaScript files CSS etc the deployment itself carries you know full copy of the sequel so now as part of the servicing it generates deltas so it knows what to change so when we do the upgrade it's not you know changing one sprach into another one they're actually identical we detect all that at Build time and actually generate the Delta so we know what things need to be actually need to be upgraded but we've got full versions of all this stuff so that they're fully independent question what do you call this a Bluegreen deployment what I call it a Bluegreen deployment actually no because the way we do deployments today is since we're using pass we actually use something that's called a VIP swap with the azure load balancer so we actually spin up and I think ed will cover this too we actually spend up a new set of virtual machines in a staging slot and then we do a VIP swap and we swap all of them out all at once and the what's currently in production goes into the staging slot staging slot becomes production and it's it's it's not atomic but it's close enough to being atomic so that would be kind of a Bluegreen deployment right that you have a separate set of servers which are live and then a separate service set of servers that would go live later yes and and I guess when I think about it there there's no like rolling deployment for example right it's it's always the entire set of binary the entire set of virtual machines is always one sprint or another there's never a mix in there thank you question sue seems like you guys maintain two versions each time I deploy right yes so when do you do that cleanup because at some point you have to so like the next deploy you're gonna have to probably clean up the previous version right and keep like you know the to soap rate basically the current version and next so do you guys actually do the disk cleanup or this is something that you guys use in like an in the background that's making this easier was just like always like manual so so interesting set of questions there so on the binary or the the virtual machines once once we do the swap and they go into the staging slot it's not long half an hour later or something they disappear we delete those in the database you know of course there's only one copy of the data there's never two copies of the data that'd be incredibly expensive the the schema and all as the servicing runs and replaces the the sprach there's only ever one copy of sprach sort of active at one time and there's not a full second copy of this proxy in the database because again the servicing has generated the deltas and it knows exactly what what to go change the closest thing that has sort of two things at once is the is the binary since it's capable of talking to the old DB and the new DB and what happens is as you might imagine the code if you went looked at the code you're going to see okay milestone 100 1920 800 2100 2200 2324 what happens this teams as they go add those eventually they go you rip the others out the other sort of interesting challenge and I'm not going to talk about this at all but really gets into on on-prem upgrade in the cloud we go every three weeks we upgrade on Prem you could be coming from TFS 2010 so that's all whole separate conversation so there's there's another conversation around how on-prem upgrade works but it leverages the same functionality because we couldn't literally have two separate upgrades we could nut [Music]
A Whirlwind Demo of C++20 in Visual Studio with Sy Brand
Hey there! Today I'm going to give a short demo of the four main C++20 features in Visual Studio. Those are coroutines, modules, ranges, and, concepts.  So what I've got right now is an implementation of a generator type. If you're familiar with a Python  generator it's much the same thing. This is based on C++20 coroutines. It's also compatible with ranges and it's using modules; it's exporting a module called generator.  And then the single type which exports is called tl::generator. Now what I want to demo  today is I'm going to implement iota, where iota is a function template which is going to give  you back something which counts up in increments of one, so if you start with zero then it's going  to give you zero, one, two, three, four, five, six so, on so forth. Could start at 20 and give you 20, 21,  you get the picture. And I'm going to implement this using my generator type. Now I want iota to be exported as a module, so I'm going to go and create a new item.  One of the options down here now is C++ module interface unit, which has an .ixx  extension. It's going to go ahead and create an iota.ixx. This will create a new file which is  exporting a module called iota. Now I want a single function template which I'm going to  export which is going to be called tl::iota. So I'm going to have namespace tl. export,  because I want to export to this from the module. It's going to be a template. I want to take anything which is an integral type,  which i can use std::integral for in concepts. It's going to be going to return a generator  for T. This is where all of the magic for coroutines happens, it's all in the return type.  It's gonna be called iota, and I'm going to take a T or you can just pass nothing and it will default to  zero. Okay so I've got a few errors here because I haven't included ranges and I haven't  imported my generator type. You can see if I hover over here it gives me an error.  So you might think that I want to #include here.  This is actually subtly wrong. Anything underneath this export module will have module linkage and  we don't want everything in this header file to have module linkage, we'll get some weird  compiler errors. The way to get around that is to put it in the global module fragment, which  you do with a single module semicolon, like that. We're also going to need to include coroutine and we want to import generator. And if we save this.. There we go! IntelliSense just found std::integral in the ranges header.  And we should hopefully get tl::generator soon as well. Now if I control click on this import  statement, this is going to go and look for the generator module, and it's taking a  little while because it's having to scan for all the dependencies and all of the the modules in  the project, the next time that you do this it will be a lot faster. And if I ran a build first...  But there we go, we got our generator module. That's handy. For example if I do this again then it goes pretty much instantly because it's already worked out dependencies and you can  see the intellisense has now found tl::generator. We're all good. Okay so our implementation of iota.  We're gonna loop infinitely. You could give this a bound or end, I'm just gonna count up infinitely.  And we're gonna co_yield back n and then increment it. So all this looks like an infinite loop.  And it is, but this function's not going to hang when you call it. Whenever it gets to co_yield it's  going to suspend, return back to the caller, and then this function can then resume later when it's  asked for. So this will stop in the co_yield and then loop round and then loop around whenever you  ask for a new value. That's what the tl::generator is going to be doing.  Okay, so we've got modules, we've got our generator, which is built on coroutines.  We can go and test this out. Okay, so in our generator test I'm gonna import iota.  We're gonna need ranges, we're gonna need coroutine again. Note that we do not get  the imports, the hash includes from here, this is all like firewalled, which is one of the  actually good things about modules. And I'm also going to do some output so I'll include iostream. Okay, I'll just have a single main function and we can test our iota like this. for i in tl::iota,  start off at 10. Oops, std::cout i. And a space. Okay, so this will never stop, right, because tl::iota is gonna  loop around and we'll just get 10 up to you know when this loops around and  we don't want that. So let's pipe this, like I, said this is ranges compatible so we can say  std::views::take 10 to take the first 10 items from this range. So now if I go ahead  and compile this. So what this is going to do is call tl::iota, which will get us back a generator.  It's going to pipe it into views::take and now whenever we go around in this loop, something's going to be dereferenced internally which is going to cause the coroutine  which we defined here to drive forward and give us a new value, and then take is going to make  sure that we finish once we've got 10. So this is kind of a nice way to compose things, this is the  the value proposition of ranges, you know, this is a kind of a silly example, but you can see how you  could compose these things as much as you want, and also the implementation for iota is way smaller  than anything you would write by hand for ranges which, would be, you know, a couple hundred lines of  code or something, it's about 15 with all of the the includes. Okay, so that succeeded, we can go  ahead and run this and hopefully we should see 10 through 19 being printed out to the console. 10 through 19. There we go 10 through 19. Okay now say that we want,  like right now this takes any integral type. Maybe we have something which you know acts like  an integral type um but isn't. Maybe it wraps some integer.  int_like. It could have other things basically anything which you can increment and subtract  to take the difference between. So say we have int_like which has some internal integer, and it has an  operator++ which you can use to increment it and then we also need operator++,  a post increment operator which you know makes a copy first and then increments and then returns  temp, and then we want to be able to take the difference between two.  friend auto operator  minus takes a couple of int_likes and returns the difference. Oops. Just return a.i minus b.i. Okay, so if we compile this right now then we're expecting to get an error because  iota says it requires something which is an integral type, like you know, int, or short, or long and we've  given it something which is not an integral type, so we're expecting a compiler error here. And this is concepts. You know, we're constraining this function template-  Oh, we're getting a different error. I must have class type... Oh, I need to give it int_like here.  Yeah, so we're expecting an error here because int_like acts like we want, all we really need  is to be able to increment this thing, but it's not an integral type, so the compiler is going to  give us an error. One other thing to note here if I look at my output is this is scanning for  module dependencies. This means that the build system is doing all of the dependency handling  for us, for these modules. We're not going to have to tell it in which order to build these  modules and things like that, it's going to work it out automatically, which is very nice, and you  can see here in our errors we did get no matching overload found, because the associated constraints  were not satisfied. So that's what we expect, that's what concepts gives you: the ability to  constrain functions and for the compiler to tell you that something went wrong. You didn't  have the right constraints satisfied. We can fix this by changing this to weakly_incrementable, which basically says you can pre-increment it, you can post increment it, you can find  out the difference between two values. Slightly weaker than incrementable, the difference between  the two is weakly_incrementable supports single pass operations, whereas incrementable allows  you to do multi-pass. So this is going to go ahead and compile again, and hopefully this will succeed. And we will print out, because we're starting at zero then we'll get zero through nine. So again  this is scanning for dependencies. Oh we forgot to return a value here return *this. There. It's one thing I always forget when doing things like that, returning  this. This is going to go ahead and rebuild, and one other thing like I mentioned you can  control click on generator here and it will go to your module, the go to definition will  also work, so if I go ahead and control click on generator then this is going to take me straight to the the implementation for our generator type. As soon as IntelliSense works out we're going. There we go. Okay, that succeeded. We can now run this and we should see zero through nine. There we go, okay, that all worked!  So that was my whirlwind demo of the main C++20 features inside Visual Studio.  Please do give it a try, let us know if you find any issues, we'd love to hear your feedback.  We'll be continuing to work on the IDE experience to make it the best we can, and also please do  check out pure virtual C++ on the 3rd of May, where we'll be talking a lot more depth about  Modules in particular and also our general C++20 progress, so thanks very much, i'll see you there!
A Commitment to Accessibility
It doesn't matter if I'm short or tall. Anxious. Or obsessed. Loud. Quiet. Or quirky. It doesn't matter if I walk. Run. Scoot. Or wheel. Smirk. Smile. Or laugh. If my disability is visible. Invisible. Or nonexistent.
A Commitment to Accessibility (Audio Description)
It doesn't matter if I'm short or tall. Anxious. Or obsessed. Loud. Quiet. Or quirky. It doesn't matter if I walk. Run. Scoot. Or wheel Smirk Smile Or laugh If my disability is visible Invisible Or nonexistent
2018 AI Summit San Francisco Keynote Microsoft AI CTO Joseph Sirosh
>> I'm going to tell you about the three key trends in AI that are really powerful that you probably haven't really heard about. Now, let me start with an example. This is an arm that can see. It's 3D printed, it has a camera in the palm of his hand, it is connected to a service in the cloud. The cloud service can trigger the movement of the fingers, based on what the arm actually sees. Let's take a look at it in this video. So, watch the arm. Now, as someone brings it over a keychain, the camera and the palm recognizes the keychain and on the right, you see the classification of the object and a pincer grip was selected. With the flexion of a muscle, with the muscle sensor, I can close the grip and you pick up that and then you can put it back down. Now, watch as we bring it to another object, in this case, a wine glass. The classification is for a palmar action, closing all the fingers together, and with a flexor of a muscle, I can pick that up and I can put that back. All it takes is a few off the shelf components like a Raspberry Pi, an Arduino board, servomotors, a 3D printed arm. In fact, inside of this are fish lines that pull the fingers closed, but of course, the magic is the Cloud AI service behind it. An AI service in the cloud that can recognize what the camera in the palm sees and then match it to the grip action that should be taken so that the right grip action can be performed. That's trainable. It's adaptable. It really is something you can set up, something that others could set up, in the service in the cloud, personalized prosthetics. That's very powerful. So, that leads me to the most important macro trend, which is that a cloud AI service behind every device, it might be a prosthetic, it might be any device that you use in your house. Of course, your apps on your phone have AI services behind them eventually, some of them already have AI, but others as well. Everything in the world that is connected with Wi-Fi or Internet connectivity can now be backed up by an AI service. That's very powerful and profound when you think about it. Now, think about this one, the grip classification. How it works is there's a muscle sensor that I've attached to my arm here, there's a camera in the hand. So, through the electronics, it goes to an Azure Custom Vision Service, where our classification model has been set up, a deep learned model that recognizes object, classifies it to the right action and then that triggers the appropriate grip classification in the servo motors connected to an Arduino board in the arm. Two undergraduates built this. Hamayal Choudhry from the University of Ontario Institute of Technology and Khan from University of Toronto. Samin Khan. They did this for the Microsoft Imagine Cup. They were the winners in 2018. Building this took them a few weeks. Of course, then the magic was provided by a cloud AI service to be able to make this device intelligent. That's a power. Even an undergraduate can build something as powerful as this today. So, why is this revolutionary? Step back and think about this device. Look, there are over a million amputations per year. That's an amputation every 30 seconds. WHO estimates that 30-100 million people in the world live with limb loss. Only five to 15 percent of these have access to Prosthetics. Even though prosthetic devices have been around since the Egyptian times, that what you see on the left is a toe on an Egyptian mummy. You can see this in the Egyptian Museum and then you see the iron hand of a knight from medieval era, his arm was cut off and he got one. Even though these devices have been there, they have been purely physical devices and very severely limited. Limited by cost. The bionic arms that you have heard about today, they cost tens of thousands of dollars and it takes a lot of effort to fit them on you. They're limited by availability, very few people have access to it, and they're limited by the interface you can attach to the body. Above all, they're limited by the nervous system that we have because we've got to train ourselves to use that device. In fact, literally, we had to force our will into these devices to be able to use them effectively. How could we change all of that? What could change us from having to wrestle with physical devices? How could we break these limits? The answer is an AI or a cloud AI service backing it up. Think about this, what if you had low-cost electronics to build with it? What if we could change the game of availability with 3D printing? So, you can print these things anywhere in the world. What if you had a Cloud AI service behind it that provided the ability to recognize things and make the movements? What if it could be personalized? What if it could be adapted? What if other people, your friends could train your arm to make the right kind of movements, in the right kind of environments? How could you have customizability of all types? What if you could tap into the knowledge of the world beyond our senses through the cloud service so that you can keep improving it? What if all of these things came together for a very low cost like the $100 it took for this arm to be built? That would be revolutionary, right? Imagine, now every prosthetic in the world or orthosis in the world which is, let's say you break your arm and [inaudible] sling and you need assistance? What if you could get something very cheap that you could move around but it's controlled by a Cloud AI service and all you have to do is express your intent to that Cloud AI service somehow and it does the more complex task of actually doing the grasp? See, this is the difference that the services can make. What you do is you express your intents and your constraints, and the service generates the behavior you need. So, it's a generative service. The behavior is generated but from high-level intention that you communicate. So, the future is affordable, intelligent, cloud-powered, personalized, prosthetic devices and really devices of every type. That's hugely revolutionary. So, let me keep this here and now talk about the next trend. So, you realize how empowering AI can be. Now, with all this power, we have 3D printing. We have AI. You're going to be able to revolutionize every aspect of your life and potentially for millions of people who are disabled, that could be a new lease on life. So, now let's talk about how these things are built. What we're seeing is a huge explosion of APIs in the cloud that democratize AI, so that every developer can tap into this incredibly sophisticated AI without knowing AI. Now, this is a standard common trend in computing by the way. Incredibly sophisticated algorithms are wrapped up in functions that are so simple you just call them. When you call a sort function in your programming. Well, there might be an extremely sophisticated implementation of quicksort behind it, but you don't have to worry about it. You learn to build it. Same thing is happening with AI. So now, there are cloud APIs with machine learning in it. I call them AutoML. So, let's look at some of the current trends. There are APIs for perception. There are APIs for comprehension. So, perception vision is being solved, and a lot of vision tasks are being solved. There are capabilities like face recognition, identifying a face and you can train them. Computer vision, meaning put an image, get a caption or a description of it. Custom vision, where you can upload your own images with class labels and train them to classify. Speech, speech recognition. All of you know about it but it's trainable now. You with the right language model, with audio environment and text to speech, text to generating voice. Then comprehension, the world of language. Language understanding. So, you can train a system with the kind of language that you might see and it will recognize the intent that's expressed and call the right functions to execute them. Filtering objectionable content or translating text or analytics on text. Then, the whole power of search engines like the Bing search engine, including customizing the search to different domains or doing search with images. All of that is available as APIs. These are just the start. A lot more APIs like this are coming. What's important about these APIs is they're not just algorithms, they are built with proprietary data, so it brings the power of the company that is building it behind it, whether it be a Microsoft or a Google or an Amazon. They're bringing data and algorithms and all of those things together to build these APIs. Very sophisticated ones. So, here's an example of a custom vision thing, called free customization models. You upload images with labels. You train it. You deploy it as a rest API. You can even take those models as containers and deploy them in your software application. So, what's an example of an application? Here is a fun example. That image, by the way, is from a real customer of ours. They asked us if we could understand all those images and catalog and organize them. It happened to be the Ministry of Justice of a country, by the way. We quite couldn't get access to all of that data for security reasons, but we asked ourselves "Hey, how would we go about solving such a challenge?" I want to now show that with a fun example. In November 22nd, of 1963, John F. Kennedy was assassinated by a lone gunman in the streets of Dallas or so, they lead us to believe, right? Well, this topic was so controversial that Congress mandated that all the documents associated with the Kennedy assassination be released to the public by 2018. So, end of 2017 came out all these documents, lots of PDF scans. If you pile them up on the stage, it would be four huge tax seven feet tall. So, how would we understand all of these documents? How would we categorize, organize, discover who killed JFK? All other controversies around it. So, our software engineers took this challenge on. So, they've created this thing called cognitive search, is actually a service in Azure which allows you ingest all types of documents with the majors were taxed and all of that. You then apply these cognitive skills that I talked about. You enrich it and then you put a search engine on top of it to explore. So, let me show you the JFK files. I'll actually show you a fun demo. So now, switching. So, this is our website, live website that you can actually go to jfkdemoazurewebsites.net. I'm going to just search for Oswald and let's see what comes up. Here's a PDF document. It did OCR and recognized Oswald in here. Even more interestingly, you see something here. This is an handwritten document and OCR allowed you to recognize terms like Oswald in here. Right there. Then, I can even go down, take a picture of Oswald. The custom vision, the vision service actually captioned it. It's a Lee Harvey Oswald posing for the camera. Now, he's not really posing for the camera but close enough. It even recognizes the OCR numbers here. Very interesting. So, now I can even see relationships between them. I can see Oswald is connected to lots of interesting people like Sylvia Duran. As I go look through this, I see things like Cuba in here. So, what's Cuba doing in JFK files? So, let me show you. This is a fun thing. We search for Castro operation in here and we found all of this by just building this application. You see Castro operation and you see, apparently, in around that time in the late 1960's, the CIA in an operation called Operation Mongoose had hired the Chicago mafia to poison Fidel Castro with poison pills. Fun thing. No one knew but apparently, the pills took a whole day to dissolve in Fidel Castro's coffee. So, our test coffee. So, Chicago mafia got cold feet and backed out of the whole thing. So, out of the fun thing. So, now let me show you another thing. Like, when a government releases this kind of very classified documents, you hope your name is not in there. Now, my name is not in there, but the name of one of Microsoft's products is in the JFK files. SQL Server. Well, SQL Server didn't kill JFK. But, we found that SQL Server was selected as the platform for the secure classified information facility by the CIA when they built it and Lotus Notes from IBM was selected as a medium of communication. They even gave us a whole architecture for how these things will look. You've been a complete with dial-up lines and so on. So, really fun story. The amazing thing again, is this kind of things can be built by an engineer in a very short time period. In this particular case, it took about three weeks for an engineer to build it using these APIs and all of that. So, let me just get back to my slide here. These are incredibly useful. What is really useful is that you can take pretty much any data in an enterprise, like legal contracts, or engineering plants, or extract form information, connect all of these things up, understand it in a cognitive sense, you think it's cognitive APIs and apply it. Which then leads me to the third big trend. AI Enables Natural User Interfaces. Well, all of you know about bots and speech interfaces, there are even neural interfaces emerging, behind all of these things is AI, and AI is enabling completely new types of interfaces. Now, one that you may not be as familiar with is Ink, Digital Ink, using a pen. So, let me show you some examples of the power of ink. Look, all of these are drawn by ink, and the pen. There's this famous saying, the pen is mightier than the sword. Try and type any of these things, you can't quite create that. But with the power of a digital pen and a Digital Ink, backed by a Cloud AI service, you can now start capturing these creative experiences, and even go beyond. So, let me show you some examples. Now, we have Digital Inking as a service in the Cloud behind PowerPoint and Word and Office 365. Here's an example of what you can do in PowerPoint, you can write, you can turn that into text, you can now draw boxes like this, especially on a touch screen, you got all of that, and yes Lasso it with a circle and then you can turn it into actual printed letters, you can make those boxes look much cleaner, and you can even draw lines between them, right? So, now you've created something new. Same thing with Word, you can edit in Word with a pen. So, you can put an arrow there, you can write what you want like brand and then it'll get inserted right there in that resume, right? You can cut out a line and that will clear up. So, all of these interactive experiences that you're seeing can be done with the power of the pen. So, let's keep going, what if I had handwriting like this? I can make it look prettier using a Cloud AI service, this is ink beautification. So, that's my handwriting, and you will see it getting cleaned up. This is beautified, original, beautified, original, you see that it's improved, my handwriting became better. Let me give you another example, what if I'm actually drawing diagrams? These diagrams are not as clean. By the way, this enables speed as well. I can quickly draw something and then let the AI service clean it up for me. So, this is the original, this is beautified, original, beautified. Now over time by the way, we can keep improving these things, and it'll become better and better, and your interactions with these devices will become very powerful. It doesn't stop there. Now, here's another example that I'm going to show where you're drawing on a whiteboard, and a picture is done, and then you can focus with your hand on the right portions of the whiteboard and then touch any of those. >> Zoom catcher, eliminates scenario for selection in an extremely lightweight manner. The user can then act on the strokes, such as to recognize. But only what areas the user wants and only when the user chooses to do so. >> Cool. Right. So, you saw that interactive power. So, this is a progression of Ink in Microsoft. It's been a journey, but around 2017 is where the magic started happening, where we saw a big step change improvement with the power of more data and AI, and I wanted to show that to you. Really, up until 2017 we were using a shallow machine learning models, limited data, limited accuracy and a client API. But then starting 2017, we started using DNS, and we started using much more data. We had a Cloud AI service behind it. We had a Cloud service that draw the country's improvement, significant improvement in the capabilities and all of the endpoints to which you could bring them. Now, I want to end with a final story. So, this is a story of an application called Helpicto. Helpicto was built by a French developer. A French developer who just used the Cloud AI services to create an application to communicate with autistic children. Now, communicating to autistic children, mothers, fathers, communicating, that's always a challenge. The standard of care has been you bring up a picture book, you take pictures from it, compose pictorial conversation at the same time as you speak. So, the child hears you and at the same time sees the picture and that increases comprehension. But of course, this is incredibly unwieldy. So, the developer ask the question, why can this be on a mobile phone? Why can't this whole thing just recognize my speech, make that conversation happen pictorially on a mobile phone and so the child can be shown that, and it just improves the speed at which you can do this, and you don't have to carry a book around with you. Let me play the video and look at the subtitles so you can understand it, it's in French. >> [FOREIGN] >> AI powered Natural Interfaces can be very empowering. So, AI is the new normal. It is an incredibly empowering technology, and Microsoft, by the way, is about empowering others by creating platforms on top of which all of you can build these types of powerful applications. So, I hope you go away from this event, inspired by the power of what AI can do for you, and build on top of this to change the world and to change your communities, and make it the next technology that empowers us all. Thank you very much.
09 Shifter Extension
so I'm going to show you an extension here called shifter it allows me to flip between values and the editor really really easily let me demonstrate let's write some CSS let's do background to Blue and let's do set index four so I have a keyboard shortcut here Ctrl alt and then either the up Arrow or down arrow and so if I'm on a number here like the Z index and hit Ctrl alt up it increments the number like this if it was a 0.08 here you see it will know to keep those values depending on the decimals and all this sort of stuff so really really handy but we can do more it doesn't have to be just numbers it could also be colors so here's the color blue so if I do control all up I get royal blue dodger blue you see here it gets lighter and lighter the color gets lighter and lighter and lighter and then it gets darker if I go down dark blue and so on so forth so I can flip through these very easily if I have a hex value like this I can do the same and it understands what hex is and it knows it's a color in this case and so it will make the color darker or lighter as I either go up or down with the keyboard shortcuts we can do other things like switch between true and false or you know yes and no on off every time we can toggle between kind of known values shifter comes in and makes that super easy for us Ctrl alt up and down
06 Navigate to Source
here on line 18 I'm making a method call into a nougat package called newtonsoft.json and I don't really know what's going on inside the method called serialize object I might be able to find the source code somewhere on GitHub and then go figure it out but it would be really nice if there's a way for me to just go straight to the definition hit F12 and go to definition so let's try that and it takes me straight to the source so this is not disassembly or anything like that this is the actual source code using something called Source link all nougat packages can opt in to Source link and that will allow Visual Studio to understand how to get to the actual source code that made up this particular version of this nougat package and even when you're inside these files you can keep hitting F12 until we come down here and it's a serialized object internal and this is a private string so I'm F 12ing I'm going to definition through a file that made up the nuget package that I'm working on and I can see everything that's happening so super helpful
.NET Package Management (NuGet) in Visual Studio 2015
hi there I'm Jeff Fritz a senior program manager on the new getet team in this video I'm going to talk about net package Management in 2015 today we're going to talk about why we need package management what's in it for me and how does it simplify working with my code in Visual Studio we've seen many advances in how developers work with their libraries their colleagues and the technical community to simplify the interactions with these tools and organizations we've updated the new get package manager to handle these new requirements I'll show you how to add a package update the package and then remove that package from a sample project let's get started with the why why is package management important well package management with net allows us to deliver a bundle of files that contain libraries for various versions of The NET Framework and configuration information as well as any static resources that are needed to support that bundle the new get package manager simplifies placement of those resources on disk adding appropriate references to your project and updating the package where appropriate additionally packages can take dependencies on other packages for example I could install a package that allows me to send messages to an Azure queue using the Azure storage package and that package has the dependency on the Microsoft o dat package nuget will automatically gather those dependencies and add them them to my project for me packages can support multiple Frameworks including the Net Framework mono and the new net core framework this is important for package authors because they want to be able to provide functionality targeted to different devices or different operating systems appropriately in our Azure storage example that package will use the network differently if it is communicating from a Net Framework application an asp.net core application or a Windows phone application let's take a look at Visual Studio 2015 and see how we can start working with packages in an asp.net 5 application here I am inside of an brand new asp.net 5 application and for this demo I want to add that Azure storage package to my project I can enter the new get package dialogue by right-clicking on my project and choosing manage new get package packages from here I have several options to work with this dialogue I can see my list of available packages on the left initially and then the appropriately selected packages details on the right across the top I can change the filter of the packages that I'm looking at I can also choose to look at pre-release versions of packages but in this case I want to search for that Azure storage package there it is I can select the action that I want to take place and then I have a version here that I can choose from any of the versions of the package that are available in the new get repository I'm feeling a little conservative here so I'm going to choose version 4.0.0 let's show the preview window so that I can understand what changes nuget is going to make to my project I'll click install I'm presented with those changes that Nugget's going to make I'll accept and now I'm presented with the licenses that I need to accept yes and now you can see on the bottom in the output window we've successfully installed the package great but maybe a couple months go by and I'd like to upgrade that package and in the latest stable version in this case in my combo box I can see that the latest stable version is 4.3.0 I don't want to see the preview window this time I'm already familiar with the changes it's going to make and I can click upgrade I'll accept the license and my package is updated we can see those results in the output window down here well now if a few months go by and the requirements to my project change I can come through and uninstall that package by just clicking the uninstall button and very quickly the package has been removed from my project finally I have some resources online for you if you'd like to learn more about nuget and package management with Visual Studio the nouet gallery is available online at www.net.org we'll share news about upcoming features information about packages we find interesting and updates for our existing tools on our blog you can find that at blog. nuget.org are you interested in checking out the nuget source code or maybe you have some feedback you want to share with the team you can visit our source code repository online at github.com slne slome we'll be happy to answer your questions on GitHub issues thanks for watching
.NET Core 2.0 Released!
hi I'm Scott hunter and I'm here today to talk about net especially not net core today we just released net core 2.0 and you can grab it today at do tnat slash core go out there and grab it right now and for the next hour so I'm going to go through all the new features all the new cool things in net core that you want to check out so first off before you can get into that we have our virtual conference net comp which comes out September 19th through the 21st this is a great virtual conference that you should block out some time for and you're going to have all the experts at Microsoft on the team you're going to have a lot of the experts in the community talk about net over those couple of days and all the new stuff that's in.net core 2.0 so you can check it out at net comp net and we will see you there next let's jump into dotnet core 2.0 I think that a quarter point O is the kind of the first real release we shipped out to core 1.0 last summer and it was a great version but it had preview tooling and we know we got feedback from customers that all the api's we're not there and so then a core tune kind of rust over all the rough edges and the coolest thing is as part of that McDonough core 1.0 we talked about how AFC net core was one of the fastest web frameworks on the planet we've made dotnet even faster in dotnet core 2.0 so now we're about a web app is about 20% faster depending on how you run it Dan Ross going to talk about that limit later today more AP is one of the biggest feedbacks we got on deck or 1.0 was hey a lot of my favorite API is the old dotnet EP has them used to things like data sets are not there they're all back we have a bunch new project templates so now if you want to build an angular app with asp net core or react with app with a ethnic or those are all in the product more distros one of the cool features of dotnet core is the fact that we are multi-platform it runs on Windows Mac and Linux we've added a whole bunch more Linux distros in.net core to and even better for a developer we have a the ability to target generic Linux and that means you can actually run net core to on most linux's without even installing a specific version for that particular Lenox simplified packaging if you follow this in decor 1.0 we broke the framework into a lot of packages thinking that would be a great way to update all those individual pieces separately but into being that it was too hard for us and it's too hard for you you don't want to have to reference all these individual packages and find out we're going to guess where which api's are in which packages and so now we've made it very simple in asp.net you reference one package for dotnet core you reference one package and you're good to go we have new and improved visual studio tooling we'll do some demos of that a little bit later on but much better tooling and we have great BS for Mac support as well so everything I show in dotnet core to you can run the same stuff in Visual Studio for Mac so let's also talk about this is exciting as well with the release of that net core 2.0 just a couple days after we ship Red Hat will have the Red Hat version of.net core 2.0 as well and they have a great no-cost developer license that you can grab at the URL here to try dotnet core 2.0 on Red Hat so really excited to have Red Hat following us so quickly into the - oh wave let's talk about the the open source aspect of net this is one of the things that really excites me is two years ago when we first started saying we're going to open to arsenic core we had no idea what the reaction is going to be was the community can come and come join us and help grow Nets and the cool thing is they really have if you look at this chart you can see the amount of pull requests by the community over the months we're at a point now where about half of our pull requests are actually from the community and even better you can see that we've had a bunch of cool companies embrace us because of the Samsung is building their Tizen platform for their televisions their mobile devices and their appliances and wrist wrist watches on dotnet core so you can actually use dotnet to program all those things we have earlier games they've moved a game they were building their own web server and net and they recognize one day that we were trying to make net core super high performance and so in trying to build a competing web stack they actually came and helped us make dotnet core way way faster and so when you see the tech and power benchmark where we scored really well last November it gains helped us a whole bunch and you can see here as well we have a foundation a dotnet foundation by big people industry you can see we have Red Hat Samsung jetbrains uni and Google that are all participants in this so it's the open source thing has been great for net now let's talk about dotnet standard this is my favorite part of net core and and.net and and even xamarin and when we started working on that core a couple years ago one of the challenges we had with dotnet was there's lots of nets there's not net framework there's Ameren there's there was not net core there's mono there's lots of dot nets out there in the world and they each had different sets of api's and so we said as the dotnet team let's stop this we want dotnet to be consistent across all platforms and so dislike html5 is a specification for web applications dotnet standard is a specification for dotnet and what that means is if you're a dotnet platform and you want to be you want to be known as a.net platform you have to implement the dotnet standard and that's basically a contract of a bunch of AP eyes and so any net that we consider a real net that influenced at that standard has to have all those AP eyes and that's pretty cool because it means you can easily move your code from xamarin app to agentic or app to a dotnet framework application and later this year with rs3 of Windows you people do the same thing with you to PP applications as well so let's look what that looks like what we basically did with that net standard 2.0 is we added about 20,000 api's back we took the intersection of all the api's that were in xamarin and all the api's that were in dotnet framework and use that as the basis of what this would look like and then we went through and added all those api's back to dotnet core 2.0 and so much bigger surface area the other cool thing about that standard too is when we look 70 percent of all the nougat packages in new georg actually support standard to today which means as a especially as an asp net developer or done in core developer a lot more of those nuga packages will work out of the box in your applications you might ask why don't some of them not work well some of those 30% that don't work with their referencing things like windows forms or WPF or technologies that don't exist on all the dotnet platforms the other cool thing about the dotnet standard is it doesn't require you to recompile any code and so in a demo I'll do in a second I'll take some a library compiled back in 2002 and just add it to my project and it'll just work and that's what's cool about that net standard 2.0 here's an example if you're a done it core 1.0 customer and you've been using it for a while here's a hint of the stuff coming back all of xml came back all serialization came back all the networking stacks came back all of i/o all threading all of core so I'm super excited we don't have it on the slide here but data came back as well so all the data sets data tables I've used those a ton in pass code and they all work great with that in standard two so let's do a quick demo so what I have here is I have an AF core one one app and I went out looking on the web for zip libraries and I found sharp zip Lib and if I look here look at this package it was built in 2011 s been out there for a long time so let's try to reference this in my h-net core 1.1 project so I'll bring up the nougat package manager here you we'll go browse find sharp and I'm going to add this to my project and notice that the package restorer and it rolled back that happened because dotnet core 1.0 did not support the api is required for sharp cichlid to work so let's instead let's move to a dotnet core 2 project here so I've got a dotnet core to project here I'll do the same thing again and first up this to show show this off a little bit I'm going to add the CS proj file and you can see this is using.net core 2.0 zoom in a little bit here this is a dotnet core 2.0 application and because of Sutton at core 2 I can come back to the same example and say manage NuGet packages I can browse and let's sign sharp as if Lib and I'm going to add it and this time because we added TI's back notice that now getting the dialogue saying this is going to succeed the nougat package is added and I should be able to do a build here successfully added restoring to build everything works great so this is showing you that now I can take a dotnet core 2.0 application and because of dotnet standard 2 and the support we have for that suddenly all this existing code out there is available to my apps so that's not in that standard 2.0 the next thing is let's talk about performance improvements so one of the cool things about being open source is a lot of places where we don't have time this we're always focusing on you know new web frameworks or new libraries to bring into dotnet making it cross-platform we don't always have a chance to look at all the bugs out there and dig into all that code one of the cool things is being an open source project we've had tons of submissions from the community the diff fix performance problems in low-level pieces of nets that we've never had time to go look at and those are all in net core 2.0 we have profile guided optimization this is where we actually run applications through the system and measure how net behaves in those situations we do optimizations based on the profiles that we create by running the applications and then obviously we're we're running the same jitters that we are on the full framework on that net core as well one of my favorite examples here is ray gun they have a product called ray gun i/o and they use a node base back in a couple years ago and I ran into them and talk to them about dotnet court at the time and said hey we're doing all this perf work they actually took their same application which was doing a thousand requests per second on nodejs moves it's dotnet core and we're able to get 20,000 requests a second and that's mainly because of they are an i/o heavy application and we can do more background i/o than note can so that's kind of cool the next thing is as part of our launch today we also launched Visual Studio 2017 15.3 you can download it today at Visual Studio calm and we're going to talk a little bit what's new in it first off better together dotnet core plus vs is an awesome tool for building applications we have full support for dotnet core 2.0 and 15.3 and we also have full support for net standard 2.0 thought that standard 2.0 can be used in your win for Maps your WPF apps your estimate apps your attic or apps your console at school everything can use that in standard 2.0 the other thing we did is we made it very simple to have a project files that work both across the CLI and Visual Studio so we have great support from the command line if you're building net core from a command prompt or on a Linux machine or a Mac and these projects go back and forth we're going to show later today that you can also transfer these same projects back and forth between Visual Studio for Mac and Visual Studio for Windows one of the areas that I really love is code navigation improvements so today a lot of our customers actually have to go install third-party extensions to get the best out of Visual Studio and so we've been spending a lot of time over the last year trying to find the most common things that people are trying to use those extensions for and make sure we have support for those just in the box we're doing that because loading a third-party extension uses more memory slows the product down and so we're trying to get you all those same features faster with less memory another exciting part of vigil City of 2017 15-3 is we have CI CD support for containers this means if you're building containers in dotnet core you can basically go through a wizard and have a CI CD pipeline set up using V STS which will either target Azure app service or our asher container registry so right from vs as you make code changes builds will kick off in the cloud the land if they pass all their tests the land either an app service or the land and a container registry all built in another cool feature that we shipped in march with visual co 27:17 RTM was liveing at testing and the idea behind this was today typically you do test kind of an afterthought you write some code for awhile and at some point you run your tests also because it's a kind of an afterthought you don't really see when you're writing your code you have no idea what code is covered by a test what code is not covered by a test and so the idea behind logit testing is as you're developing you can see live in the in the ide which code has tests which code doesn't have tests even more so than that as you actually make source code changes in the product we actually will identify which tests have to be rerun we'll run them on the fly as you're editing and typing and you can see whether they're succeeding or passing and you get so great great visual coverage in the the IDE so that's life in your testing and next I'm going to do is I'm going to have Casey come on and she's going to do a demo of the editor work and lugnut testing so let me there's Casey from the team she works on net productivity on the tooling for.net yeah hi guys I'm here to show you how vigil studio 2017 it's going to make you as productive as possible as you're coding Visual Studio 2017 has a lot of the awesome features that we have for other dotnet projects also for dotnet core for the first time ever we brought like live in your testing over to.net core yeah I think you're going to show the do project system as well yeah and so you'll see all code analysis I'll show a little bit the new project stem and bunch of different things that you can do in dotnet core so here I have a simple net core 2.0 app it's basically just lets me yell at my Alexa in the morning figure out when my bus is coming and the first thing I want to do is show file globbing so files globbing allows me to just drag a file from here from the file explorer into my project and then you'll see it immediately appear over here on my solution explorer so this is automatic syncing between the file and solution Explorer now we're at existing file yep so Don to manually add the file yourself and sort one two merge from source control and things like that can you open the CSV file as well yeah I can also show you the new CS Praja so rather than having to unload a project and reload it to edit your CSS prajapati's now just do it directly from here so I can click on this and you'll see that the new CS proj file for dotnet core projects is really small and if you look closely you'll notice that when I added that direction file it doesn't exist in here I was not there yeah which means which will save it's a ton of time when you have ton merge conflicts in your CSS proj file from all the different files that you and your team have added and removed super cool yeah so they're just some of the productivity enhancements I've done for dotnet core project specifically you'll notice in this direction file that I added that I have a merge conflict in here so it's a result that we added actually a ton of newer factorings and visuals to your time 17 and you can see here I can you know choose to take the head the upstream or both of the changes that I had and so here I was on take the head and again I access this for factoring with control dot and now it's resolved this merge conflict for me hi so probably my favorite saying that we've added is I should feature we've had for a while but now we've remapped it and renamed it is ctrl T or go to all this allows me to quickly navigate to any file type member or symbol declaration from a single location so I know I want to go to this type that I have called plus helper so I can just use camel case matching to just type in the like the humps or whatever you want to call it of the letters and then it will navigate me directly there so as I was talking about we have live unit testing support for dotnet core now so I can go to test live unit testing and I can click start so what is live unit testing typically when we're unit testing we have this kind of like tension where we're trying to route what is the smallest number of tests I can run so that my R unit tests run in a reasonable amount of time but also a big enough sets that I can feel confident I've run enough tests to actually know that my change hasn't broken something else and so we're always trying to figure out what that but that compromise is between smalls number and the biggest summer for confidence and so once you actually find that set then you have to manually go click a button to run all your tests and then you have to go to a different window to actually find the results of your unit test and so live unit testing is actually removing all of that and doing it for you automatically so live unit testing will figure out what code is impacted by your code change and run those tests and then display:inline the results so you can see a red X means that this line of code is hit by at least one failing test a green check means a sign code is hit by all passing tests and a blue dash means this line is not covered by any test at all to me this is the coolest feature is just being that quick visualization what I have tested what I don't have tested what failing we have open up other windows or run other scoffs yeah you never have to lose the context of your development to see the impacts of your changes is awesome I can click on icon and see exactly what tests are hitting that line and you can just double click to actually navigate directly to the test itself so if I don't actually know why this is failing which I don't I can just right-click and choose the debug this test so this is all on dinette core so we have all assumed debugging support live unit testing support for dotnet core projects that we have with all the rest of the dotnet projects so if I should hit a breakpoint here and debugging a new feature that we added in Visual Studio 2017 is to run the click where if you hover next to different lines this little icon that pops up I can zoom in to show you that or I can say run on my program to this point so I can just do that and when I do that my execution failed because I've actually thrown an exception and this is a new exception helper that's part of Visual Studio 2017 where we cleaned it up and we try to put at the top level the most important information so here I'm throwing a reference exception so it would be nice if I knew what was null and this is actually telling me that the lot variable is null now I know exactly what I need to do I just go through all the air text behind that air anymore yeah I don't need to restart my debugging session to figure out and step into different things so again I was talking about we added a ton of new refactoring the Visual Studio 2017 so I who's come directly up to my parameter list and press control dot and now I have the option to add an old check for this parameter I can do the same for my longitude parameter as well and now in a single click I've added all this boilerplate to actually test my or do my node checks for me and without me having to think about it I don't know as I did that live unit testing figure out what tests was impacted by my change ran them for me and updated in the editor in the context of my development let me know that now all my tests are passing that's what's pretty great romaine anything yeah so now that we've shown debugging and summer factorings let's show a couple more so it just so happens so I'm going to use again control P to go to any place that I want so I want to go to the file called stop so I'm going to put an S to filter by files and type in stop it just so happens when you're trying to catch the bus in the morning it depends what direction the bus is going for which stuff you go to learn that the hard way when I first moved to Seattle so what I'm going to do here is now my stops we're going to have directions associated with them so I need to actually add a parameter to my construction constructor subdueth a time type direction and you'll notice now Visual Studio is actually suggesting a variable name for me for this parameter so like hey resurrection you probably I just want to name this parameter Direction and I can immediately do that also while my cursor is here I can press control dot and then I can create and initialize the property direction for me and I can do control dot again and add the nil check automatically as well and so again this is a bunch of quick little things just help you scaffold out your app without you having to really move anywhere and so it makes you a lot more productive I would use every one of those that's awesome yeah so now because actually added this for my serialization have to add adjacent convertor so again you can do the camel chase matching in here so I can type Jason C and they can see all the different things that match type of and again use the camel case matching to help me autocomplete unit testing is actually letting me know that nothing is covered by this and that's because I haven't actually used my updated constructor anywhere so to do that I'm going to go to final references to figure out all the places that I have this constructor lucky me it's only one place in this app and now I can just add my last parameter and here where I'm adding the direction of my stop to my unit test to check that it's working and again live unit testing went through figured out what code was impacted by this change figure out the tests that need to run and then ran them for me and now I can tell that all my tests are passing despite me adding a new parameter to constructor shuffling things around and stuff like that yeah so you might notice in here now are these pink dots over here which they're actually gray by default but pink is a lot better-looking to look at and matches the blue color scheme so I made it that way and this is a code suggestion code suggestions allow you to like hint best practices or alternate coding patterns to developers so if I investigate here you can see that's telling me to use the explicit type instead of var and this is part of the code style configuration enforcement that we've added to Visual Studio 2017 that's one of my favorite features where you can actually on a project basis go and set these rules and say these are the rules of the project everybody has to hear those rules in the write warnings or errors or whatnot and so we actually allow you to like codify all these different conventions you have in an editor config file so I can just navigate to an editor config which is an open source file format that we worked with the community and extended to work with dotnet code style and to see here all my different of our preferences so I've chosen four built-in types so when the type of the parent to use bar otherwise I want you to use the explicit type and you can configure this at the directory level so if you want to at the project or the solution level you can do those kind of things as long as it's in that directory you you'll also notice and here that when I actually converted to the explicit type I've used a c-sharp seven two pole which is my favorite c-sharp seven feature which allows you to return multiple values from a method so here I've returned both a route and a stop and you'll see that there's now pink little dots down here and if I investigate those I can see that this code suggestion is helping me learn the new language features where I saw me hey I've named my tuple element route unstop and so rather than using the item one and item two which is really hard to understand when you're just trying to access these different members we can now just directly use the explicit name instead so again code suggestions are really great for enforcing code style across your team and learning your language features but the other things are good for is helping learn best practices so we've actually in version 15 3 we have a beta version of the FX cop code analyzers where we've written all the FX cop rules which are just a ton of rules on best practices with performance and security we've written them as live analyzers in the code to get live feedback inside the editor on different code violations people use those before that used to be an external tool that you ran statically against your code and that was like being as an analyzer it's live in the product you don't have to actually do an extra step it just runs all the time and so here's an example of one that's here on my bus helpers if I do control dot to see what it's asking me to do I can see that saying hey you have all static members inside this class you should probably just make this class static so no one can instantiate it and again in a single click it will now make this fix for me we went through all the FX copper rules and took the ones we thought were most pertinent today and with the ones ones we're moving into analyzers yes so we took like the most commonly used ones that people were saying that they used and we made them into this extension that you can install today's I have installed here on the last thing I want to show is we have all these grades added lines going on editor here which are indent guides this allows me to hover over and just kind of get a better idea of like I'm that kind of like code and so I can see here that I have another class besides bus helpers in here and how the class called my stop info which is basically what my file is named so I'm just going to use the refactoring that we have to move this bus helpers type to a file with the same name because that's how my team likes to do it where you have a different file for every type and so in two seconds or less I was able to now make it into a new file and so those are just an again will let me notice the whole time live unit testing has been running and still let me know in the context of my development without me having to navigate to a different window or run a test or click a button that all my tests are still passing and so those are just my favorite things that we've added in Visual Studio 2017 to help make your dotnet development awesome those are awesome thank you very much good yeah thank you okay so now we're going to move on and do as you're functions in Visual Studio so there's been is huge push in the last year so this interest around building serverless computing and what this is is instead of building a full web application just building the small snippet of code that you actually want to run when something happens in the cloud whether a REST API gets called or you have a trigger that's fired from a vent or a file is added to a storage account something like that that's that this new model of programming called serverless computing and we want to make sure that c-sharp dotnet and visual C are the best ways to build those types of applications so with Visual Studio 2017 15.3 we've added support for Azure functions directly in the box and visual studio and this tooling is pretty cool you can basically build c-sharp functions and what's what makes the tooling so awesome is you can actually develop them locally first we have a emulator so you can run them locally in Visual Studio put breakpoints in them all that kind of stuff then when you're ready you can push them up to the cloud and you don't lose any of that functionality you can actually still put the breakpoints and run the breakpoints in the cloud just like you do locally so it's a great experience and we've changed the way that functions actually work they are now class libraries in Visual Studio which means you get all the supports of c-sharp all the tooling all the cool features that Kasey showed they all work with Azure functions now and so next I'm going to bring Andrew Hall up and he's gonna do a quick demo of Azure functions cool so this is Andrew Hall Andrew works on visual studio tooling all up for.net and today let's let's talk about added functions yeah so as Scott mentioned already we've put it in the box for visual studio 15.3 update all you need to have is the Azure development workload selected you'll notice here that I don't have any of the optional components not because I don't want them just to prove that we don't need them so it's included by default in the azure development it's really tiny only adds a couple megabytes to the installation just check check out your development and you're good to go just check as your development you're good to go you'll get everything I'm about to show you so when you come into the cloud node in Visual Studio this is the new project experience you'll see the Azure functions project template shows up so you can pick that how do you have one that I've created and by default you'll see that it drops a empty project and I have two files so one is host Jason that I can configure settings this is all documented online but we're going to go ahead and build a queue trigger so when we push things into a queue we're going to pick those message up and process them and I've set the max polling interval I've upped it just for the purposes of our demo because I want it to process relatives and explain to people what this means is I've got a at your table table storage set up in the cloud and I've got a queue inside of that and you're saying anytime somebody puts an event into that queue it's going to call your code that's correct okay and so one of the great things about Visual Studio is we have a schema you can see we know the schema for host at JSON that we've created and I can configure settings so for example I mentioned what this max point interval is going to do is it's going to say this is a millisecond value check the queue every thousand milliseconds or once a second but if I hit control space because this is visual studios JSON editor so control space you can see I get intellisense for all the possible things that I can configure about my application so just by virtue of working in Visual Studio I don't necessarily have to remember the exact commands I just control space or start typing I get the intellisense that I would expect in visual studios first-class JSON editor let's go ahead and back back out of that the second thing I have is a local setting set JSON file and what this is is this is a file that lets me specify things like connection strings or whatever it's not it's by default going to be go dude from source control because it's supposed to be your local settings so the default get ignore that gets dropped with this will prevent that learn and source control but in this particular case I've populated a required property as your web job stored just as the required storage account for working with as your functions required for every function type except an HTTP trigger so now that we have this configured we have our storage account connection string plugged in we have our polling interval set up to make sure that we're it's going to pick up quickly let's right-click on this and let's say add let's add a new item and we're going to pick the Azure function template so let's call this which we call this let's call this our cue trigger and bring up dialog so let's go ahead and pair it so you have a whole bunch of types there so I'm seeing blobs event hubs generic webhook HP triggers Wow lots of lots of services in Azure yeah so these are these are all pre-baked in templates in visual studio these match the types of triggers that you can create in the portal as you mentioned on the portal by default you're working with a c-sharp script file so tsx as you already told people in the introduction one of the things that we've done in business videos we've made these class libraries to give you a first-class development experience it also gives you better startup performance and Azure because we've already done the work on the dessert on the on the client side to compile that into a dll right so you're not going from source every time so that's the face locator what does what does that do base locator I believe this is a cognitive service that actually find spaces in your images that's cool yes there's a lot of fun stuff to play with you can really waste a lot of time or I guess is not waste you can spend a lot of valuable time playing with creating your own as your as your function triggers with this hopefully a lot of people watching have already had the chance to try this because we had an extension that we shipped at build that was available to install on top of Visual Studio 15.3 so the big thing is we cleaned up cleaned it up a little bit fixed some bugs and as I mentioned we've now made it part of the azure workload as opposed to happy to be something you have to go install separately so let's call this our cue trigger and we have a connection string here so this will use our as ur/web job storage here as your web jobs storage and the path is my cue item this is going to be the name of the queue so if I go over here I have storage explorer open and I can see that I'm going to use this Andre how Channel 9 I can look at my cues and I can see that I have my cues items so the name of that's all going to line up and we're about to see one of the big benefits of going to pre compiled functions that we've done with the work that we've done in Visual Studio 15 got three after I create this for people to watch this if you see as your storage Explorer that's a great tool if you're actually using Azure storage you can search for that download that and it gives you a visual representation and in fact I actually use it to copy my connection strings so I when I do this exact same demo like it I connect that thing first in a copy of my connection string format your storage Explorer into vs yeah and that's exactly what I did that's a really good point I did went cooking show style a little bit I have that might you know pie in the oven what the connection strings already pasted in but exactly that's where I would have gotten the connection strings from one of the big differences I want to point out here now that we've generated our cue triggers es file for the pre compile function is you've moved away from a world where you're mapping between your Azure function and what you're going to trigger off of me information is decoupled so if you look at in the portal for example for Azure functions you have it at the SX file and then you have a separate function that JSON file where you specify all the information of what is the connection string and what is the cue that you're going to map to what we've done in Visual Studio 15.3 is we've brought in the azure web jobs attributes along with this new attribute called function names so the function name attribute indicates that it's the this is going to be an azure function so that's how the runtime will find it the private attribute all the configurations being moved attributes on the actual code correct so my CS file in this particular case is an entirely self-contained thing so I can see it I can edit it I can do it all in the same place that no more decoupling of those things so what's right so let's go ahead and run it so one of the things as you mentioned is we have a fully local loop so let's just go ahead and hit f5 to start debugging this application and so once it spins up we'll see that we'll have the console up this is the local as your functions runtime that you mentioned I think you called it your emulator in the introduction and so now let's open storage Explorer and let's go ahead to my q and let's push a new message into the Q and I'm going to expect that that break point is going to be hit so let's say hey Scott we push that into the Q and within a second I've hit in Visual Studio and that's why I upped that polling interval just to make sure that happen quickly and if I look at the my Q item that's been pulled from the Q I can see my string that says hey Scott so this is the message we just pushed into the Q ourselves cool so let's say that we were happy with the way that this is working locally it's a pretty powerful function right we can say hello to ourselves and log it to the console I had the ability from Visual Studio directly to right-click say publish and I can publish it directly to Azure and I can try that out in the cloud so we're going to go ahead and create a new as your function app so I'll click my publish button there and you can see that it's going to query my subscription it's going to populate some information from the cloud it's going to show me my options resource group I created a channel 9 resource group that we're going to use for this I want to create a new app service plan in this case going to show one of the powers of functions is this consumption plan and consumption plan is only available for service computing but what this means instead of these machines where have dedicated resources and I have a cost associated with paying for dedicated resources a consumption plan is only going to charge me by the millisecond that my application right this is really the benefit of serverless computing is I only pay for what I use correct and so we're going to go ahead and pick this same storage account we're working off before which is my channel 9 storage account and so now when I click create it's going to create all the resources that I want up on the cloud and then it's going to copy this application of the cloud that should be running up and Azure we should have the ability to go hit it so you can see that we're on step 2 of 3 so this will take a couple seconds ok I make an assets in the cloud this is a copy of stuff up at the cloud and then once you're done we can run and do all that kind of stuff perfect so now I have a summary I can see the time that I've been successful so let's go to my Azure portal I'm going to open up my list of function apps in this particular case I only have one which is the one that we just created I can see my function app when I click the this it's going to populate so I can go into my queue trigger function and so this is showing me the gist the JSON that's generated that mapping file that I mentioned that we used attributes for on the locally but it generates it and so if I look at my logs if I open up my storage Explorer and I push another message into my to which says this is the cloud and I click OK when I come back to the portal I can see that the message I just added this is the cloud so from visual studio I took my function app I compiled as a DLL I was able to right click publish it directly to Azure and it's now running an azure and it's going to fire and execute anytime that the events that I've chosen the trigger off of you're only paying for when it when it's called and we're not going to show it but if I wanted to I could also open the clot Explorer in Visual Studio found that same function and attach the debugger to it right some videos to you that's correct yeah you can just right click on it you can say remote debug so if for some reason it's working locally but you get it up into the cloud it's not working correctly you have the ability to debug it absolutely cool awesome as your functions okay let's move on from functions the next thing I want to talk about is we just today also shift Visual Studio for Mac version 7.1 you can also download this today at Visual Studio calm what's cool about this is digital scene for Mac has full support for dotnet core 2.0 you can build console apps API apps web apps all with digital to you for mac and it's got full support for dotnet standard 2.0 as well so all the stuff that I was showing a Visual Studio for Windows you can do in Visual Studio for Mac next I'm going to have James come out and we're going to show videos to you for Mac okay so I'm happy to introduce James from the mobile developer tools team working on xamarin and visual cue for Mac and all things mobile yeah you name it I do mobile I love it you know me I love this stuff and honestly I'm super excited to talk about all the brand-new Visual Studio for Mac features we have for.net core 2.0 I'm crazy excited about yeah me too I've got this I want to show a hard example so you know we could've done file new and and built that and copied it from my machine of yours but I found this complicated app it's got all the stuff you might have in a real app if I scroll up here I've got data models I've got tests I've got a back-end front end let's run this thing it's a real app I can click see users need is going on so how about we copy this app from my machine to a memory stick and see if you can run it on the Mac that sounds good often I'm working with teams with multiple machines often on PC or Mac and this is the stuff that you have to do you have to be able to work on multiple machine so you got a dip great zip file on your stick for you okay and I'll give this to you all right and while we're waiting for him to set up one of the cool things that I like about visual Cu for Mac is both of our teams are working really close together to take the features of Visual Studio and move them to the Mac so my team especially we worked on living the HTML the CSS the Jason editor directly from Visual Studio to the Mac so when he's showing those in vs for Mac it's the same code that we have in Visual Studio yeah so all I did is I copied it the zip file to my desktop I went ahead and simply DoubleTap the solution and see here it should launch Visual Studio for Mac there we go and Visual Studio for Mac will give you a whole bunch of different file new project things and I'll walk through those in a second but already as soon as I open it up we can actually say that it's restoring all of my packages because you're kind enough to delete all of the need to get packages so it's a nice small zip which is nice and hold we can see is we have the same exact folder structure file structure intact so every single project in solution in the solution actually loads from my tests to my models to my actual web application here so you'll see all the dependencies all the files everything like that there we go it's gone ahead and packages are restored I'll hit go at this point is going to build up my donek web donna core 2 application and then deploy hopefully just like we saw just over there so let's give it it's building building building because it's a big rush it's a big app and I like it you didn't just do file new because that'd be way too easy right there we go launch into the browser there we go localhost 5,000 loads up visitors blows up my records and there we go the same exact app so you and I could be working in source control together and one one of us on a Mac one of us in a PC and just being productive exactly yeah I love it and then I can have all my normal debugging everything that you would expect all powered on Visual Studio for Mac now let me actually walk through some of the other things that we've done here because it's more than just ability to open the stuff so let me go ahead and actually walk you through Visual Studio for Mac a little bit so anyone new will have a little bit of experience when I go into a new project and I'll zoom in a little bit here we have kind of multi-platform applications that I'll walk through we have iOS applications Android Mac TV OS and right here is the dotnet core applications from libraries asp.net core and of course libraries right here I can come in create a dotnet standard library awesome right here if I go in and I say oh I want to what do I want to target down at standard - oh that is a single library that I can then share between all of not only my asp.net core donÃt core my Dameron applications and uwp applications - so kind of everything now we talked about getting started it couldn't be easier let's say I just wanted to create a blank council application I can come in pick between F sharp or C sharp I'm a C sharp guy so I'm going to say C sharp and again kind of a very similar flow of what flavor of dynacord I want and of course I want donek core - so say awesome da net core - now what this will do is it'll go off and just like we saw earlier it's going to go will see all of our dependencies here or SDK and we can see that we have our tool of to go to oh SDK now at this point I can just simply go ahead and hit a breakpoint set a breakpoint on hello world command line comes up and in just a few seconds debugging a dotnet core application right there here we go stop debugging from the council but it's more than just file blank new application right I can come in and I can do everything that you we're talking about with asp.net core in fact even the razor pages as well we wanted to bring over that similar experience so here if I come in and say awesome razor pages there what we'll see is that Visual Studio for Mac will of course not only scaffold out and bring in all my dependencies and nougat and SDKs but we're going to come in and we can look at our pages that are here so if I want to go into my about page I have my CF HTML I have my c-sharp code behind files and you can of course come in and modify any of the files you get full intellisense right inside of there if you want to come into your web root you of course can modify your JavaScript your CSS files so if I wanted to come in and adjust the padding we have the full intellisense coming in right it's the same CSS editor from visual studio for Windows so brought right over so now again just like we saw your application I can come in I can start actually building my application deploying my very first Rick I love Razer bridge is so cool from Visual Studio for Mac again it loads up it deploys as you'd expect and boom it's running I think this is awesome I can build my mobile apps in either vs for Windows or vs for Mac I can hold my web apps in vs windows ES or Mac yeah great experience yeah and you nail that you nailed on the head actually I want to talk about one final thing well I have the stage is that often I'm building back ends with donek corneas get on a core with web api's for my mobile applications and we made a drop-dead simple for developers to create a full multi application so under multi platform here I can select a salmon forms a mole based application or native iOS and Android app when I select that with one button click you can add an asp.net core Web API now I've done that here so I brought in all the packages and it scaffold out a full master detail application brings in master detail shared code for your mobile apps add on a standard library and an asp.net core application everything with Web API and a full website everything like that and what I love here is that you can see that I actually have i OS and a web as my startup projects was cool is that we actually have multi process debugging built-in so I can come in and set my iOS and my web application as the startup so I can actually debug my iOS app a my web has a service running and the mobile operating at the same time exactly so when I hit debug what we're going to see is that the iOS simulator is going to pop up it's going to launch my application at the same time over here launch my actual web site and here it's actually going to start hitting breakpoints so will actually let it spin up fully as we have some items there we go so we have an item here we have a website here and I can actually go to flash API flash item and we see we have one item C sharp is very sharp over here C sharp is very sharp now this is cool and I hit add let's hit an add new item here and I'm actually break pointing inside of the iOS project right when I have that item I'll sterilize it send it out to my back-end now what's really cool is it hits a breakpoint in my asp.net core application and it brings me to the code file right here another thing super cool continue on we can see that the actual item is now added not only in the iOS app but in the web app is right there then when I'm all done guess what you can do you can right click publish and publish to Azure cuz I need to put that actual asp.net core application right up into Azure I've logged in with my asher account so to quarry all of my services I can go ahead and select one or I can go ahead and create a brand new app service plan and everything all from Visual Studio for mac which is super awesome same experience and individual tee for Windows same experience in visual to you from Mac yeah that is a great experience we think developers are going to love it so go to visual studio comm and download the S or Mac today so let's move on next thing is a s phonetic or 2.0 lots of good stuff in a student core - first off faster in certain circumstances like running the Tekken power benchmarks it's about 20% faster than a s connect core 1.0 so very happy about that we have a new framework called razor pages and it's meant for people to want to build web apps sometimes the Model View pattern MVC requires you to have a bunch of files in different folders and stuff like that if you just want to go get some stuff to the web quickly we just want to write an API sometimes a simpler programming model might be more interesting and so that's what razor pages it I'm going to have Dan come up in a second and show that we've also added support for c-sharp 7.12 razor so when you use razor in asp net core 2 you get all the latest c-sharp features one of my favorite features is azure diagnostics and live analysis and i'll do a demo that in a second as well and this is you as you start publishing your apps to the cloud things change I no longer have access to the local machine how do I diagnose and debug these applications we've built a lot of capabilities in to.net core 2 that enable this to happen automatically and Azure and I'll show that in a little bit another one is we know a lot of developers are building applications with angular and react and so we put templates for both of those programming models directly in the box it gives you a front-end application with a s connect or back-end as well so it's all wired together so it's a great starting place and then we always want our temples to give people best practices and so most of us probably use to factor off to access some of our popular websites and we typically do that with an Authenticator app on a mobile device and we built that same feature into a s connect core so if you want to build applications for your company and have them support two-factor authentication we've got great support for all of those those applications so next I'm going to have Dan Roth come up so I wanted to introduce Dan Roth from the eighth net team he's here today with me to talk about a s net core 2.0 oh yeah so let's just jump in I've got a quick demo before you go and I've got the same instant core application I was showing before that I added the old library from so it's you know it's with that in standard but what I want to show is I'm going to publish this out to the cloud and show this new diagnostic feature so week so let's go over here and right click on our app we'll publish click publish so this is going to help me diagnose my problems when my app is live yes so some of the feedback we got with a snake for 1.1 was we put a pin sites directly into the project templates and so some people complain there's a pin sites NuGet packages there's some stuff inside of my web app I'm trying to help I know we're trying to help and so what we've done in the incident core 2.0 all those same features exist but if I look there is no app insights in my new capacity my will just go and list let's show that real quick oops here comes the browser join my live app if I go look at my dependencies and I look at nougats there is no app insights there so we took it out so we'll know where that's what's gone so my apps running up in the cloud now what I'm going to do is I'm going to go to portal and here is my app and I'm going to click on it and once it loads up in the portal something new is going to happen here notice this banner that you look at the top here click here to access app insights from monitoring profiling your Assn core application so instead of having to install app insights in my project inside a visual studio I can have inject it right from the portal so I'm going to click that button so this is without any like adding any packages or code to the actual appliqué a package is no code nothing just go right to the portal and say because typically maybe my developer is already published and I need to sit these insights I just go and let's enable it and this is going to create a app insights for my application and it's going to wire up all the new diagnostics so give it a second to finish that and notice once that happened the new banner shows up again no data automatically instrument your asp net application restart required so if I click this button this is going to relaunch my application and when the application relaunches it's going to actually load those assets like nougat packages that we did not install in the actual app on my developer machine okay so like it'll light it up just like it is liked it up bolt it on after the fact so let's watch here interpreting my application take a few seconds okay so I'm going to close the app insights panel real quick and show a couple other cool features about this my app is now running in the cloud and if I go down to diagnostics logs I'm gonna do something that you never could do before so before if you wanted to see logging inside of app service you had to actually go add a nougat package and hook some stuff up so I'm just going to go say hey I want some logging and I want my logging to be at the information level and I'm gonna click Save so I didn't republish my app my apps is still running that's been successful so let's go to log stream and what's gonna happen now is the portal is going to connect to the logging in in my ethnic core application and here it is live so let's go back to the web app and let's click around a little bit so is this like the asp.net core logging infrastructure like all the stuff that goes through I lager and lager factory it's just wired up just wired up no plea as I as I click around the application all of my logging goes in and what's cool is if you notice before I can set the information level so if I have information so a lot comes through I change it to warning and click Save then less information will come through because I've changed the warning level so I don't have to go and republish my application or do any configuration right from the portal I can live control the amount of information that I see the next thing if I go back there I can come down to the same section and I can click app insights app insights actually takes a little bit of time to actually open up so well hope things are hooked up here like provisioning from some app insights resource well for performance reasons it takes a while for your after I clicked around my app a little bit it takes a while for this to actually kick over in app insights because it doesn't want to slow your application down so it's actually slowly seeing that data around so we might not see it here for a second but let's go back let's click around a little bit more in the app go back to the portal let's do a refresh so look at there so now you're starting to see data flow through I didn't actually do anything as I said it takes it takes a minute or so for it doesn't start flowing through but the cool thing here is now developers can publish their apps to Azure without having any app inside configuration turned on right from the portal they can set their the log level they want see the live streaming logs in the portal they can also go to the app insights tab and see all the app insights data just flowed through automatically just by publishing doc just like okay logging and diagnostics so at this point let's flip over to you and I think you're going to show us what raised your pages yeah I'm going to show you a you know creating an application with asp.net core 2.0 so HP dotnet core 2.0 is all about making things easier like making it easier to get started making it easier to develop your app making it easier to build great UI let me show you what I mean so here in in Visual Studio I've already created an asp.net core 2o application this is just an empty web app and I just want to build some UI but let me let me show you some of this little difference your pages folder there yeah yeah that's that's where we're going to add our pages but I want to show you a few things first that are that are simpler now in this model like if I show you the the CS proj file for this product for this application you'll notice it's got just one package that's it and you don't need any other packages this package literally brings in all of asp.net core into this application so you no longer have to go hunting over the web to find which package do you need to get that feature that you want to use it also has just one version so you don't have to figure out like which version of which package you need to use with that other package over there you pick the version of the product you pick the version of the package and you're done and you're that's all you got to do and and literally everything's there if you want to reference individual packages they're all still there like if I expand the the node in the solution Explorer you can see them all now you might worry like isn't this going to make like package restore like crazy slow no because all the packages are already there as part of installing dotnet core yeah they're catch all these things with your machine so you don't have to worry about that and when you publish you don't need to bring all that stuff with you either because in dotnet core 200 we have this new feature called a runtime store so all those binaries are actually already there as part of dominant core - oh so and they're warmed up in cross-gen they're ready to go so you don't need to publish them with your apps your publish size is actually significantly smaller than it was in one Yanase to the core 1.1 or 1.0 application we were actually publishing 15 Meg's of MVC every single time you public was really good MVC bits but yeah if you did have to bring with you now you don't have to do that at all you can just just leave them behind they're already going to be there ready to go if we look at like program CS like that's also a lot simpler in this app there was a lot of stuff here that you had to do before like setup the server like wire up kestrel setup is integration set up your content route none of that you have to do anymore because we just do it for you by default and we do a lot more actually like we'll set up your ear config for you will actually put config in di by default and we'll wire up the like Jason config providers for app settings Jason we'll set up the user secrets file stuff so that you can keep your secrets out of the source code logging is actually enabled by default because the config specified one of my favorite one of my biggest complaints about AF snake or 100 or 1 1 was developers told me all you get to create an object but your configuration inject that into the I and I'm like just put the configuration in there for me so I'm going to access it from any of my controllers we did that for it's already there you can just use it from wherever you want to and as a result my startup code now it's much cleaner like I don't have to set up that that config object anymore I'm not setting up logging because it's already set up for me we've already set up the console logger that the bug logger so it just feeds right into Azure for example and it just works but if I want to set this stuff up manually I still can right again that's where all those api's are still there we're just trying to help you get started faster to actually build your app which is what I want to do I want to build some UI like I'd like to just add some pages to this app how do I do that so I'm going to use what you were talking about which is razor pages razor pages is a new app model in asp.net core - oh it's built on NBC that allows you to just add pages to your app that render dynamic HTML so let me show you I've got that pages directory that you mentioned I'm going to add a new item right here show you how quick and easy it is to get started now writing dynamic you I'm gonna add a razor page index CS HTML that means it's just going to be the home page of my app and we should get some razor and there it is alright cool so I got a razor file with nothing in it yet because I found like a student webpages although that it's it a different much more fleshed out model like it's literally built on MVC so all the features that you know and love from MVC they actually still continue to work like you might notice I actually do have a view imports file in this directory that sets up you know the namespace for all my pages that's from M you see it just works you start that just works tag helpers that just works because it's built on top of MVC I get all the power in VC and I get the ability to do CS HTML files in a folder just like I could with web pages so I get the best of both world you get the best of both worlds exactly so I have a code behind file this is my page model this is the mod I'm going to be going to use to decide what to render on the page so let's add some stuff like it's just let's do something simple so I'm gonna add a property let's add a string let's call this I don't know like current time great so that property is on my model and it's referenced from my page so it's not it's now going to be accessible from this piece of razor now we want to populate that property with some data so in my on get page handler so this is where you can handle the request as it comes in whether it's a get request or a post request I'm going to set the current time to be I don't like date time now and we'll make that a string so that we can easily render it on the page alright okay so now if I save that on my page let's now go actually you know render that current time we'll just add a header and we'll say at model to refer to the model current time perfect let's run it let's see what we get hopefully we'll see what time it is on our server in big beautiful text and all right great there it is and if I keep hitting refresh you know the seconds tick by as the app refreshes that's how easy it is to get started with razor pages you just add a page and you got and you're ready to I love this I don't have to have a controller folder or views folder I don't have to have routes I don't understand how writing works between all that stuff yep you can still do those things of course you have controllers and and views you can absolutely use all that but this is we think this is a much simpler way to do UI now this was a very simple app let's do something a little bit more real I'm going to file new project up now and we have of course templates for razor pages I'm going to select to create a new a spinet core Alek and mix the two systems together I can have some views and controllers as razor pages on the same applicator you can do them both and they work beautifully side by side you can have some Web API is that our letter embassy controllers and have some UI with Razer pages that just works while you're on the screen we should point out these new templates ago I was about to do that time to do this so here I'm going to create a new razor pages based app first of all you'll notice that I now have two web application templates so the web application Model View controller that's the one that has use and controllers the same template that we've always had still works can continue to use it web application template now that's using razor pages because we think it's just a simple way to get going with building UI and adding pages by the way you'll notice that we also have the templates that you mentioned earlier for angular 4 reacts for react plus Redux that's just an easy way to get started with building a spa with asp.net core as a back-end we're going to work with razor pages so let's add that this is going to give me a template that has the standard you know three pages that we have on almost all of our templates the home page the about page the contact page now what I want to do here is add a form razor pages is great for doing forms based programming so I'm going to open up the pages folder and the routes to the pages are just determined by where they are in disk so if I want to go to the contact page I just go to slash contacts so there's there's index that's the home page there's contact and there's about you notice that we also have you imports do you start those or it's just built on NBC so those things just work we even have a layout the layout just works it's like MVC so let's go to this contact page and we want to add a data form here that lets you submit your contact info so that you can we can contact you about our great products you know something like that super easy so what we're going to do is we're going to go to the code-behind file and I'm just going to add a little class here let's call it a contact and then let's just add a couple properties on this let's add a name and let's add a email address so that we can actually contact you now I want to I want some validation on this guy so I'm going to make this this property required using data annotations the annotations just work with razor pages it's all MVC required for the email address as well you've got to give me both okay so now I want to render a form on my page using this this contact model so I'm going to add a property to my page model of type contact okay and that's going to allow me now in my contacts HTML this model type will have that property and I can use that to render the form I'll spare you the the typing on that I've got actually already pre typed here and we'll just copy this and put it into the page so I don't have to do that manually but the super acts are pretty easy to do but there we go so there's our form now this form you'll notice that it doesn't actually have an action attribute that's because the form tag helper will automatically set the action attribute to just post to the page by default that's the obvious thing to do then we have two fields one for the contact name and one for the email address and that's it and a button to submit we run this we should be able to see that form now now there's nothing that this is going to post to yet we need to add that in a second but let's just make sure we've got our UI so let's check this should brought us to the home page we go to contact great we've got our little form so now let's go back to our model we need to have some logic here now for handling the post requests so we're going to add another page Handler instead of on yet we'll have an on post I got that here as well just to save some typing so let's go ahead and copy this onto the page model there we go resolve a namespace so we can get our action result action results because then we see you again so what's this going to do so when we post the form data it's going to check the malla state to see if it's valid or not if it's not it'll just render the page and say like here's the errors the things that were wrong then you would normally like save the data someplace like in a database we're not going to do that here but you would just have a DB context you you inject it into the page model like you would have controller it goes in the constructor works just like like that-like is NBC you could also inject in the page itself with that inject all the directives work and then if things are all good then we're just will you know what's a post redirect get so we'll redirect back to the page just to show that yes everything was good now I would like to do something here so what I'm going to do is I'm just going to set it like a success message like yes thank you for your contact information we got it you're good to go so I don't like thanks I'll just reference that saying property contact uh name wherever you are we'll contact you soon via and then the email address of that person okay great now we should probably render that on the page as well I think I've already got like a header that renders that message but let's change that to like a like a P tag and just set up some bootstrap so that shows up and green so like text to a success because this is a success message and I think there's also one more thing I got to change which is on this um get I don't want to clear the message I want to actually leave it as it was now this is almost done that message property will get populated when the post comes in but first of all like how do I actually get the contact data like I should buying someplace like I could I could actually put it in the post arguments that's there's like you good with an MVC action but instead of doing that because I'm already got this property right here I'm just going to bind it right here to this property that's super convenient and you can do that on your MVC controllers too like if you want to use that same feature there you can also that message property I need that to survive the redirect we have a feature in MVC that makes it easy called temp data what you can now do is you can attribute a property and say please back this we buy a temp data and so that means when I set that property it'll populate into temp data when I read from that property you'll read it out of temp data and that should be it okay so let's go back to our like view our page and let's uh let's click Submit and I didn't put any data and so I expect to get like some some validation errors that say like you didn't provide a name we didn't provide an email address and there they are okay now if I put my name in and my email address there it is and then thanks Dan we'll contact you soon that's raise it very cool very simple if you publish it it'll be smaller also when you publish it and run it it will start up faster than it would in 1:1 because the the runtime store is already crossed also we will pre compile these pages and your views so that you don't have to do any runtime compilation that just happens in demo that's a new feature that we have into o as well is we are pre compiling CSS HTML files as part of public as part of public by default you just want to do anything it'll just happen and then at runtime like you said it'll be faster because the throughput of 200 is faster than 1:1 as well awesome thank you so let's move on next we have entity framework core 2.0 any framework core is a new version of any of you framework that we built as we built net core the primary goal of Adichie framework or was to have obviously a version of energy framework that ran cross-platform just like that in core does but one of the things I like to think about with any framework core is it's a version of.net core kind of internally we used to call it any of you framework everywhere because the idea is it can run anywhere today so it used to be the engine framework could only run on the.net framework that runs on net core it's not that standard compliant as well which means it technically can run on uwp as well so whether or xamarin so whether you're building a dotnet framework app a dotnet core application xamarin application or even a uwp application and the rs3 time frame you have the same data data data framework that can go all those places another cool thing about a new framework is we have a couple goals here and one of them is to obviously make it very easy to build awesome applications with address equal and sequel server and so we've actually enabled features in sequel server like in-memory tables you can actually do with attributes with energy framework they've already shipped that and we've also done all the stuff for accessing databases in the cloud where you might actually need to have like retry policies and stuff that's all built into any framework or and I've got a couple of features in on the screen here that we're that are needed framework or to my favorite one is probably the performance improvements if you're used to programming at a do net level you're probably familiar with connection caching where we actually have a pool of connections and keep using those we've got a great new feature where you can actually have a pool of context and so if you're having an app that's running a lot and doing a lot of requests you can cache these contexts and reuse them so it's kind of like connection pooling for energy framework contexts I'm going to have a Diego Vega come up and present some of these features so if people can go to the dotnet blog to read the announcement and see an overview of the new features this one is about the the fact that we look at performance profiles of some 80 or netcode applications that we are using EF core 2.0 sorry previous version and we realized that we were spending a lot of time creating instances of the ideal context yeah pretty much anytime we create a controller yeah which every time a request comes in we create a controller we're going to create a context cuz most people make the context a member of their controller yes that's it and and we we try to address this in two different ways in 2:01 is first make it cheaper to create you know like we have a view context that is using dependency injection internally to create its own dependencies and those are scoped they get created every for every request and then they go away and we will use the number of a object need we created for each one but we also took a more radical approach based on on the same idea that we have been using for connection token 11 for all the years and that is well basically we can have like a pre created set of the context instances that are ready to use every time there is a new request that comes in we pass that to the controller and when the controller finishes the work we can take it by the pool then we use it for the next request that has the token and all we need to make sure is that we are cleaning up all the state that means we cannot that we are disposing all those that need to dispose and things of that so we want to show a demo that is actually one of the simplest demos that I have seen we have a a this is actually a console application that is simulating everything that a an external application would do with a real context it has this small D context with just one entity and then it has this section where we are configuring services this is a line here that has the call to the context is important that's the registration of the D context type that are going to use in the application and then to simulate what would happen in a normal application I have created this method request async that is basically doing the work that was happening in a controller action yeah and this one is doing a lookup in the database so we're going to run this the way it is and we are going to see some numbers so this is executing a bunch of requests is creating a bunch of threads to simulate what is happening a real application in this in this particular case for creating contexts a lot of times every time when it is request from the ESRI recruiting in context so we're throwing a bunch of memory out there a bunch of times it's just like a snake or went and optimized a lot of memory usage away now you're going to show a new version of this it actually yeah doesn't do doesn't work as hard exactly so the two numbers that I want people to remember here that are important is the total number of contexts that were created to do this works a lot that were like more than 70,000 and also the number of requests per second is the throughput that we achieved with this way of doing things yep now I said that this is a very easy mo because all I need to do to enable the new feature is to change this call to add three contexts to a new API that is called happy context pool and this one the way it work is basically running up the same capabilities in dependency injection but instead of giving you a new instance of the D context every time is going to give you one from the pool so a one line code change we run the application and what we see so we are seeing that very quickly we achieve it better to put but before I can see the very throughput and add at the end here we're going to see that look at that only 32 content created versus 70,000 yeah that's dramatically dramatic difference because there's going to be much less of our patients to serve the same number of all right when I take my existing es core code I change one line of code and my web application and suddenly I'm using a lot less memory and my applications faster awesome let the iris collection as well so one one detail a people you said you asked about this is that why is that we are not adding this to the default template even even that is so good and that performance is so much better with this way and the reason we we don't do that is because we want people to be aware that the feature changes how things are going to work right and for instance when you create this blow in context this is your own user class it's derived from the mini context and you can put your own state in there and if you are not careful using this feature if you have your own context you're right young okay if you put your own set in there well then you're going to be in trouble because somebody else is going to see that same state over and over again and it's not really your state you're sharing that today with everybody so yes you pull something you need to be aware don't don't we putting your own private user data inside of that DB context because it's not your own private data yeah exactly so the feature knows how to reset all the state of the duty context that we know about on every time we we put it back in the pool but you don't know about what the user put subject on a class yes that's something that we can improve in the future but currently we don't have a way to do that yeah we should probably do an analyzer in the future that actually tells you not to do that or we can give you a method yeah for that okay what else you got so the other feature I wanted to show is a very simple feature and this one is also very easy and I think that this is say I want to yeah I like this feature too yeah I want to give the language team a some some trades here actually all the credit because they build these these features is reading revelation string interpolation we added the Sierra if you if you look at this code what is doing is basically using an EF model and is using a feature that we call from which you can use to execute your own sequel in a composable way so you can invoke some sequel with with some sequel and then you can continue adding link operators on top of it but I want to be careful arrived and I don't have any like sequel injection here because I'm passing a parameter in here so this is pretty against sequel injection I would assume so this is this protecting you from sequel injection but in the way that we did it in the first version of EF code so if I show you how how this works basically sucking for a 10 a turn I'm going to type cut here this is showing me the secret that gets generated I'm putting the select I can see the variable there yeah there was a parameters and created for it and it's being passed to this this is actually a table body function in sequel server based in both yes and this is safe but it's not as nice so one one thing I may want to do is I'm using the new features in c-sharp the exemption of seeing a 0 here which is undoing yeah bye bye order so C sharp allows you to do I can actuate the variable directly and yeah a dollar sign there and then just say okay I want to put term here sorry I'm in turn and this is a more concise way of writing this query I know myself and I've done sequel in the past I've had I passed so many things in I was 0 1 2 3 4 5 and by the time and all the parameters scrolled off his right side of the screen and so I wasn't sure what they are and so the interpolation feature being able to put the name of the variable directly in a place I want is amazing yep and now you support that with any different work or yes the things that if you did this with the first version of anti-fungal cord it would expose you to I mean it will fail but if you if you add some quoting here probably turn this to the string then it would be exposing you to C code in general injection so what we wanted to do is say ok we want people to be able to use this nice way of writing the equation and incorporating the parameters in line in the query but we want it to work the right way so we wanted to create parameters for them and we want to we want it to be site perfect I love it so I get all the features of string interpolation in c-sharp I get all the protection from sequel injection all with the F core 2.0 yep also if we execute this now is the same say we ask for fish and it's also generating the parameter on the and using it in the call to the table of the function here so the way this works people are excused when we see when they see this demo is really because the language team invented this in a very small way they created a new type that is called formattable string that can hold all the information for an interpolator string including like the text and also the parameters so we created an overload of from sequel that takes a formatted string so we can actually capture the whole intent in one variable and then we create a sequel for you cool awesome okay thank you for the demos no problem thank you thank you okay so let's move on I want to close with something I think is really important earlier this year we launched a new part of the.net website do tnat and it's our architecture guides we got a lot of feedback from customers saying that hey we're looking at moving to the container micro service world or I want to look at how I would move my application from on-premise to the cloud and so we are now building some patterns and practice style guides and what's cool about these guides is they're in an eBook format if you want you can download a PDF of these books and read them offline you can also read them online on Doc's not Microsoft comm but even better after you click one of these to download it'll take you to a page afterwards showing you all the resources for the guide that you selected and the best resources each of these content contains a sample as well so if you select microservices and containers you get a great book to learn how to build and and ripe micro services that run in containers with net in the cloud but also you get a great sample application that shows you the best practices and a lot of things you're going to find in the sample applications or things like you can see health checks those types of things or patterns we're going to actually move out of the samples and put into the actual dotnet core in the future so if you're looking at how to build modern acid net and dotted core please come to this page and learn more key takeaways I think the biggest things as a.net developer that people should take away from this is that in a standard - I think it's the most important thing here because it means all of our all of my dinettes xamarin dotnet framework dotnet core all have the same set of common api's across all the great code sharing you can continue to see we have performance you know we had great performance results with dotnet core 1.0 we're continuing to push that envelope again as Dan was saying earlier 20 percent improvement in the tech and power benchmark for a snit core and then the other part of this is nothing makes gotten that better than awesome tools and we have Visual Studio Visual Studio for Mac and Visual Studio code which are all great platforms for building applications with nets and don''t core to is supported across all of them so go out download dotnet core to today at DLT got any tea slash core and give us feedback on how it works
Building Bots Part 1
it's about time we did a toolbox episode on BOTS hi welcome to visual studio toolbox I'm your host Robert green and jo...
-
hey everyone welcome to Microsoft Connect my name is Nina Zakharchenko I'm a senior cloud developer advocate at Microsoft ...
-
It's lunchtime, and this is Brad Anderson's lunch break. Here in Redmond we're visited by some of the smartest peo...
-
[MUSIC]