Showing posts with label you. Show all posts
Showing posts with label you. Show all posts

Wednesday, 23 October 2024

Building apps for iOS with Visual Studio

are you an iOS Developer or potentially you're looking to build your first IOS app now this might surprise you but Microsoft actually has a bunch of tools and services that can make a developer life just a little bit easier regardless whether you want to build the app using JavaScript and web standards C or even C++ I'm Jonathan Carter and in this video I will show you how Visual Studio can make you a more productive iOS Developer visual studi easy setup gets your Dev box ready fast including a handshake with a local or remote OSX box for build it comes pre-installed with many project templates so that you can get started building your app fast it also has integrated debugging support for both devices as well as remote simulators Visual Studio team Services support continuous integration and deployments for iOS apps no matter how you've built them even if you're using xcode and you can use hockey app for your post- production needs like Distributing betas analyzing crash reports and getting feedback from your customers let me show you how all of this works Visual Studio gets you going fast by setting up your Dev box with everything you need for iOS development with with a simple handshake you can set up a local or remote Mac machine for building your iOS apps once set up you can see that Visual Studio provides you with a variety of templates to get started building your IOS app if you want to build your app using web standards you can choose one of the Apache Cordova app templates using either JavaScript or typescript you can iterate quickly using a workflow that is even familiar to web developers if you want to build your app using C the zamar and extension for visual studio provides you with a variety of project templates including traditional UI kit apps openg GL Sprite kit and even Apple watch extensions once you've created your project and are beginning to write some code you'll even notice that directly within Visual Studio you get a great intellisense experience even for the iOS apis you can even connect to the storyboard design surface to build the visual components of your app directly in visual studio if you're building using C++ visual studio also has project templates for iOS to help you get started building static or shared libraries building your app with JavaScript C or C++ allows you to achieve maximum code sharing which makes it easy to build with a common code base to Target not just iOS but also Android as well Visual Studio team Services comes pre-built with support for iOS applications which allows you to automatically build your xcode projects as part of your CI server you can also use hockey app now a part of Visual Studio team services to automatically deploy your app to testers as well as to gain insights into the health of your application using crash reporting so as we saw in the demo no matter how you're building your IOS app Visual Studio can make your team more productive and your life as a Dev a little easier to learn more check out the other videos that go deeper into some of the topics that I've discussed Additionally you can follow us on Twitter and watch the vs blog in order to stay current with new functionality that we enable for mobile development as well as best practices and tips thanks for watching

Building apps for Android with Visual Studio

are you an Android developer or are you looking to build your first Android app this might surprise you but Microsoft has a bunch of tools and services that make an Android developers life a little bit easier whether you want to build the app using javascript and web standards c-sharp or even c++ and java i'm amanda silver and I'll show you how Visual Studio can make you a more productive Android developer visual Studios easy setup gets your dev box ready fast its pre-installed with many project templates so you can get started building your app it has integrated support for debugging across devices and emulators we even have a visual studio emulator for Android which is fast and can be used with other IDs like Android studio or eclipse visual studio team services supports continuous integration and deployment for Android apps no matter how you've written them and you can use hockey app for your post-production needs like distributing betas analyzing crass reports and getting feedback from your customers let me show you how visual studio gets you going fast by setting up everything you need for Android development once setup you can see that visual studio provides you with a variety of templates to get going if you want to build your app using web standards you can use the Apache Cordova app templates to iterate quickly using workflow that's familiar to web developers if you want to build your app using c-sharp the xamarin extension for visual studio provides you with the variety of project templates and even support for Android wear you also get great intellisense for Android you also get the world's best Android designer if you're building using C++ you can build an app using OpenGL a native activity or just a shared library if you're building using C++ Visual Studio has one of the fastest debuggers out there new in the latest update we even allow you to step into code for Android written in Java building your app with JavaScript C sharp or C++ allows you to have maximal code sharing which makes it easier to build with a common code base when you're also targeting iOS no matter which programming language you use you'll find the Visual Studio emulator for Android super useful because it's x86 based it's really fast to get started it supports multi-touch which is amazing when you're developing on a touch enabled dev box like the surface book with Windows 10 the emulator is even available standalone and can be used from Android studio or eclipse today we're announcing that it's coming soon to the Mac visual studio team services allow you to build for Android using Gradle and you can use hockey app now a part of visual studio team services to deploy your app and gain insights into how it's performing in the wild things like feedback and crash analytics even into Java code no matter how you're building your Android app visual studio can make your team more productive and your life as a dev a little easier check out other videos that go deeper into some of the topics I discussed follow us on Twitter to stay current as we enable new functionality for mobile development and watch the vs blog for best practices testimonials and tips and tricks

Bridge to Kubernetes

>> Don't you wish you could just focus on one micro-service instead of having to drag in the whole set of micro-services, and all of those related dependencies in Kubernetes? Well, it turns out you can. So join me and Nick Greenfield on this episode of Visual Studio Toolbox. [MUSIC] Hey everyone. Welcome to Visual Studio Toolbox. I'm your host, Leslie Richardson. Today, I'm joined by Nick Greenfield, who is a Program Manager on the Bridge to Kubernetes team. Welcome Nick. >> Hey, how's [inaudible] going? Thanks for having me. >> Yeah. Thanks to be here. It's a very smoky day out, but enough about that. The cool thing is that I hear there's this new feature available as part of Kubernetes called Bridge to Kubernetes. Can you tell us a little bit about what that is? >> Sure. Bridge to Kubernetes is an iterative development tool for developers that are authoring micro-service applications that target Kubernetes. It's offered as a client experience in both Visual Studio and Visual Studio Code through extensions that you can pick up in the marketplace. >> So what are some of the existing approaches that are kind of similar to Bridge to Kubernetes that can help address that issue? >> That's a good segue to this next slide that I have here. There's a lot of different tools and methods for solving these kind of challenges where you're working on a single micro-service in the context of a larger application. We've kind of categorized all those different methods and tools into three main buckets. There's the local approach, the remote approach, and then the hybrid approach. So like these columns that I'm showing here. The rows are key characteristics that we've learned are really important to developers when trying to be successful in their day-to-day task of developing their micro-service code. To go through these quickly, and I'll talk about where Bridge to Kubernetes falls into one of these categories. But starting with the local approach, the local approach really revolves around. I'm reading my code locally and I'm satisfying all those external dependencies on my local development machine. Whether I'm using stubs or mocks to fulfill those external dependencies, or if I'm actually running all those external dependencies on my development machine and configuring, and connected to them manually. Or if I'm even using a system like Docker Compose to run those dependencies and containers. Ultimately, what this approach does, is it allows me to work on my dev machine where everything was running on that workstation. This has a lot of great benefits as in everything's local so I get a really speedy developer inner loop experience. But it does lack in that, my dev machine is most likely going to be drastically different to the deployment environment where this code is ultimately going to be running in Kubernetes within Azure. The extreme of the local approach is moving into this remote approach. There's tools that basically allow you to write your code on your local machine. But then when it comes time to debug and test end-to-end, you take those changes and deploy them, and sync them into that deployment environment. So into Kubernetes that might be running in Azure. This plays off the weakness of local approaches that I get that fidelity to a deployed environment. Because I'm testing and debugging where this thing is ultimately going to be running. But now, I have these extra steps in my developer inner loop cycle of having to build and deploy my code. I think, working in the space for a little bit, the biggest learning that we've heard from customers, specific to this approach, is that it does add some extra friction onto a developer's workflow. Because now they have to have these operational concepts of how having to bundle their code, and build an image of their code and deploy that image into Kubernetes. What we've learned is that not all developers are accustomed to those sort of concepts and complexities. >> Yeah. >> The last approach, and this is where Bridge to Kubernetes falls in, is the hybrid approach where it's kind of the best of both worlds. Ultimately with this approach, allows you to do is write your code on your development workstation, but connect to external dependencies that are running in some remote environment. So I'm actually fulfilling all those external dependencies by connecting to my Kubernetes cluster, let's say running in Azure so that I can leverage the whole end-to-end workflow. But the only thing I'm running on my developer workstation is the code that I'm working on. Diving into that approach, this is really where we feel is like the best of both worlds, and we're seeing this resonate with customers quite well. If you're interested, I'll show you an example of how this works given that simple application that we were just talking about. >> Yeah, I do like demos. >> Cool. At a high level, when you are using the Bridge to Kubernetes, like I said, you are only responsible for running the one micro-service on your development workstation. So taking that example that I had earlier, where I have that bikes micro-service open here, which is one of these back-end APIs. The first thing you would do with Bridge to Kubernetes is create a connection to your clusters. In this case, I've created this bridge to my deployment environment. Once this connection has been made, I can actually pick from all the available services running in the cluster, which of these I want to work on locally. In this case, inside the bikes open, I would actually select the bikes micro-service. >> So can I pick multiple micro-services if I wanted to? >> Yeah. >> Or one at a time? >> No, you can pick multiple. So you'd have to have different instances of VS or VS Code open, but this can allow you to redirect multiple outlets. >> Got you. >> When I select, in this case, the bikes micro-service, we're actually putting this re-director in place. So that when I make a request that goes into the front-end of my application running in AKS, it will continue to hit all the services running in my cluster until that bikes service is called. At that point, that request will be routed to my development workstation where the Bridge that I'm running locally from here [inaudible]. >> That's really cool. It's kind of like you finish the jigsaw puzzle, and you're just kind of sticking in the missing piece when she go to run, test, deploy, all that jazz. >> Exactly. >> Nice. >> This is at a high level how Bridge to Kubernetes works. I love to show you an example of our Visual Studio experience, working on this exact application, and how you could go from zero to using Kubernetes on a project that you have of your own. >> Yeah, let's check it out. >> The first thing that I want to show you, is that application running in AKS. Is that bike renting application, where as I mentioned before, you can log in as a customer, and you can have a list of available bikes that you could reserve for a period of time. In this case, I would see the men's cruiser. Looks good. I can rent this bike. Then when I'm done using this bike, I can return this bike. It's returned back to the list of available bikes to rent. Just really simple application, just for demo purposes, right? >> Yeah. >> What I want to do is I actually want to work on one of these services. Since I'm going to show you the VS experience, it's probably appropriate that I show you the reservation engine, which is a micro-service that is written in.NET Core. >> Sounds good. >> Since you're over to VS, I have Visual Studio 2019 open. You'll notice that I have a solution that has one project open, and this is that reservation engine; that micro-service, that's responsible for actually reserving the bike. You'll notice that, over here, this is just the source code for that micro-service. There's no Docker file, there's no Kubernetes configuration, it's just that source code. >> So you don't have to sit through opening up the giant project, contain all the solutions you don't need, except for the one, right? >> Right. So it's just that one micro-service, nothing else. >> Cool. >> Now, since I have this open, and if I go to the VS marketplace and I installed the Bridge to Kubernetes extension, what will happen is I'll have this new launch profile that's available for me to use up in this list of launch profiles that I can select from. When you select the Bridge to Kubernetes launch profile, the very first time you'll be presented with this dialogue that I have open here. What this dialog allows you to do, is define the connection from your development machine to your target AKS cluster, or you can select that service that you want to redirect to your local running version. So just to quickly walk-through what's required here, [inaudible]. A subscription is required, and within that subscription, I have available clusters that I could select from. In this case, it's your Azure Kubernetes clusters. Then I have filter because I have different namespaces within that cluster, so I'm going to select the namespace that's running this application that I want to start debugging. My bicycle application is running in the bike app namespace. Within this namespace, I have a list of all those services that I saw from that diagram earlier. I want to select one of these that I want to redirect my locally running version. As I mentioned, I have the reservation engine open, so I'm going to select the reservation engine here. This next dialog here are the drop-down, basically it's asking me to select a launch profile that we want to clone. This app is a launch profile that I am familiar using with this micro-service. What we'll do is we'll clone this launch profile with some extra configuration that's taken from the Kubernetes cluster. >> Okay. Is that just to make sure that your local content is in sync with the rest of? >> Yeah, so the reason why we clone is we want to tap into how you're familiar with developing. If I'm used to developing this application locally, however that may be or whoever profile that I have set up and configured, we want to allow you to continue using that, except we'll add some additional configuration into that launch profile. That is from the Kubernetes environment that allows you to talk to those other services. It basically continues doing what you were doing before, but we'll throw in some extra configuration for you to use the Bridge to Kubernetes' functionality. >> Neat. >> Yeah. This is actually a really neat feature that we just released, I'm a little excited about. I don't know if you picked up on how we're redirecting traffic to your development machine, but that also become problematic when you're working in a shared environment. If I have other developers that are working in that same namespace on other microservices or the same one that I'm working on. Potentially we'll step on each others toes because their traffic will get sent to my machine environment. We have this isolation mode which allows you to work in isolation where only your requests that are being set will get redirected to your machine. We do that by giving you the special URL, in this case we'll prefix your URL that you're normally using through your application with your username on your machine and then this unique hash here. So that only traffic that's using this URL don't get sent to your local running version or the normal URL that everyone else would be using will continue to run in and hit the service that's running in the cluster. >> That's really cool. Ultimately, there might reach a point of course when you do need to push changes and things so you're still going to have to fix merge conflicts in that context. But as far as running and testing with the Kubernetes Cluster, it's not going to be an issue and you're not going to bump into somebody else who's also trying to access the same cluster at the same time. >> If I was working in a shared namespace you can imagine that if my friend John who was using the same namespace and working on different microservice, he would have his own special URL and I don't have my own special URL so that our traffic isn't conflicting with each other. That only my traffic is getting redirected to my machine and his traffic is getting redirected to his machine. >> Great. If only all traffic was like that. >> At this point I have this configured. Again like I mentioned before this is a onetime configuration that you would set up when getting started to boost your Kubernetes. We persist this you can always go back and change it later. But for this case I'm happy with it, so I will hit "Okay". We'll check to make sure that we can actually isolate that service and we can redirect it to your local running version. So this usually takes us a couple seconds. Cool and that's done that check passed. Now if I want to start working on the service and hit some breakpoints let's do that. I'm going to open up a file here this is the bikehelper.cs and since I'm debugging in the reservation engine microservice, so when you reserve a bike this is the service that will get executed. I can actually put a breakpoint and let's put it in this reserve bike method that seems appropriate for this service here. Then since I'm targeting that Bridge to Kubernetes launch profile I can F5 and what it's doing is going back to that diagram that I showed you before. At this point, it's creating that bridge between my developer workstation in that Kubernetes Cluster. Would you require admin privileges on the client machine to allow that traffic to be sent back and forth. So that is one dependency that developers will have to have when working with Bridge to Kubernetes. At this point what it's doing is it's establishing that connection, it's finding that service in the cluster that I want to redirect to my machine. What it's doing it finds that service is putting that redirector in place and then it's going to make it so that any requests that hit that service will actually get sent to my machine. I just got my UAC prompts so I authorized that. It looks like that connection has been made it's starting my debug session here. As you can see that special URL that I had in that dialogue where my debug session was started it actually launched that URL. So here I am with my application and you can see I have that special URL that was provided to me when I clicked, I want to work in isolation. At this point I can chart a debug at my service and an end-to-end scenario. I'm actually hitting the services that are running in AKS at this point. So this is the front end that we'll call the user microservice here we go. Now that I have a list of bikes to choose from, I can select a bike. Again all of this traffic still happening within the cluster nothing is being redirected to my machine yet. But now when I'm actually going to reserve a bike and it's going to actually send a request to that reservation engine microserver. You'll notice that that request will get sent to my VS instance, you see VS has popped open and I'm stuck at my breakpoint where I can debug, step through the code and however my debugging practices, I'm open to using wherever debugging practices that I'm familiar with. >> Cool. It's essentially skipping over the existing microservice that's up in the cluster and just redirecting to your local machine? >> Exactly. This is right so I can iterate on my code, I can make changes, I can debug maybe potential issues. Then again the only thing here that I want to call out that for me is the most exciting thing about this feature is that I'm only running that one microservice I don't have all these other services I'm leveraging them from running in that Kubernetes environment. Again, no Docker files, no [inaudible] Kubernetes Artifacts. I'm running this natively on my machine. >> Yeah, that's so cool. Even locally sometimes when trying to look at a huge project but you only need a chunk of it. It's just like I'm spending all this time debugging this other issue that's not even my responsibility. All these other dependencies. Yeah so that's cool that you don't have to worry about that. >> Yeah. In this point as was a developer I'd step through this code and when I'm have you there I can hit "Resume" and that requests will get sent back into the cluster to be completed. The really nice thing about this is that if let's say I actually make a change as a configuration change that I would need to restart my debug session. So if I was to exit my debug session here, you'll notice that I'm no longer in that debugging mode, but I have this yellow banner up here this info bar that says, "Hey, your service reservation engine is still being redirected to your machine." Yeah, I can make a configuration change and you know I'm ready to F5 again. What's going to happen is it's actually going to skip that connection that we went to initially because we're already connected. Here I am, my application launches and I can know iterate on my code as I look. >> That's great. It's almost like it got cached someplace and so you need to use again while you are in the same VS session. >> Yeah, that is the Visual Studio experience for Bridge to Kubernetes. >> That's really exciting and I think that could save people a lot of frustration. Based off of that, are there any existing limitations that you want to tell viewers about? >> These limitations, we'll we're working with hard to unblock any limitations. We're working with developers, we're understanding the applications that they're developing and where Bridge to Kubernetes fits and really just understanding the different scenarios that we need to support. I would say the one thing that we get asked constantly and I'm really excited to announce is that people want to use Bridge to Kubernetes on Kubernetes Clusters that are not AKS clusters. So a Minikube Cluster where it's basically running your Kubernetes cluster on your development machine. We are in the process of actually enabling a public preview that would allow you to use Bridge to Kubernetes on any Kubernetes platform. So it's a really exciting announcement that will happen in a very near future. >> That is really cool. Speaking of previews, how can people access this tool. Is it available yet? >> Yeah, so we recently just went GA so that's really exciting. >> Congratulations. >> Thank you. There's some quick starts under the VS code documentation under that developed with Kubernetes and we also have some getting started material under the Visual Studio container tools documentation. I will absolutely provide us some information on how did we started with those. >> That is fantastic. You already mentioned that you're working to you expand Bridge to Kubernetes functionality out to all Kubernetes platform. So what else is next for Kubernetes? >> Again, it's really understanding what the scenarios that different development teams had to use. Actually one limitation that potentially when people are watching this video will no longer be a limitation, is only targeting the Linux containers in Kubernetes. We've heard that there are a lot of development teams that are in this hybrid scenario where they're running Windows containers as well as Linux container. We want to make sure that we cater our tools to all different situations. We're really working through having this ability where we target any of these containers. >> That is very exciting. Well, thanks for sharing that, that is a really cool tool that I think can help a lot of people out. I really like that you can just segment the microservice that you need and don't have to worry about anything else seriously. >> Focus on the business logic that Microsoft [inaudible] in front of you >> How much time gets wasted just trying to figure out how another chunk that's not really your problem connects to the piece you're working on. So super exciting. >> Yeah. Well thank you. >> Thank you. Yeah, thanks for being here Nick. So go try it out, it's GA now officially. >> Yeah, we want to know what you think so we'll provide some information on how you can get in touch with our team and we want to hear about your experiences with Bridge to Kubernetes. So absolutely reach out. >> Awesome. Until next time happy coding. [MUSIC]

Brad Smith Remarks at US Senate Judiciary Subcommittee 52417

Thank you, Chairman Graham, Ranking Member Whitehouse, Senator Hatch, it's my pleasure to be here on behalf of Microsoft this afternoon. Certainly, before I say anything else, I want to echo your thoughts, and the views of so many Americans, in expressing our condolences and our concerns to Mr. McGuinness and all of the people of the United Kingdom. Today's hearing gives us an opportunity to address related issues, the important need for law enforcement to work across borders to obtain information it needs, while avoiding conflicts with other countries laws. The issue is not new, governments have long turned to Mutual Legal Assistance Treaties, or MLATs, but the world has clearly changed. As a company responsible for storing and safeguarding citizens' most private information in the cloud, we long recognized that new laws are needed. I first want to underscore Microsoft's appreciation for last year's work to negotiate a bilateral agreement between the United States and the United Kingdom. This agreement is a positive step forward which we support. Second, I want to thank the Department of Justice for proposing a new framework for U.S. law. While we have important concerns with some aspects of this proposal, we have long urged the department to consider new legislation, and this is a welcomed step. Since Microsoft filed this lawsuit in 2013, we've stated repeatedly that new law is needed. We recognize that criminals sometimes use technology across borders, and that MLATs and legal principles designed for the 20th century simply have not kept pace. Unfortunately, while the use of extraterritorial search warrants in the short run have sometimes helped law enforcement, they have created their own set of problems. First, they've led the conflicts between laws, even among friends and allies, as countries seek to protect the privacy of their citizens. These conflicts put technology companies in impossible position of deciding whose law they will break. Second, the use of extraterritorial warrants undermines foreign confidence in American technology. They drive foreign customers to foreign products and put American jobs at risks. These concerns led to our lawsuit, objecting to extraterritorial search warrants to obtain information stored in our data center in Ireland. Last year's court of appeals decision, supporting Microsoft's position, makes clear that now is the time for congress to act. While important details remain, the DOJ's proposal opens the door to a new and constructive discussion. Importantly, the department proposes a new legal framework that would enable companies that have information in the United States responsive to a foreign warrant to turn that information over directly to a foreign government in specific, appropriate circumstances. It would do so in a way that both complies with foreign and U.S law, and in a manner, that protects privacy and civil liberties. Ultimately, we have one fundamental concern with the DOJ's proposal, a concern that can be addressed readily. The DOJ proposes a new standard for allied and friendly governments to obtain information located in the United States in a manner that respects U.S law, namely through this new framework, but the DOJ would not follow that framework itself. Instead, it wants to revert to extraterritorial search warrants despite all the problems these create. Put simply, this isn't going to work. One year from tomorrow, on May 25, 2018, the European General Data Protection Regulation will take effect. On that day, technology companies that comply with the DOJ'S proposed extraterritorial warrants for information stored in Europe are almost certain to violate European law. In fact, they will be subject to a fine of up to four percent of worldwide revenue. Instead the U.S. needs to consider the same framework for itself, and demonstrate respect for borders and reciprocity with allied and friendly nations. This isn't simple, but it's achievable. We have a year and a day to solve this. We'll need important work by the subcommittee, it will need to build on the DOJ proposal, and it will need to build on the sustained work of senators Hatch and Coons. It will also require a broad dialogue. Speaking for myself, and considering my colleagues across the tech sector, I believe we're willing and able to help. Thank you.

Azure Functions Less-Server and More Code

all right what do you guys what do you guys get ready to film we are going to do a visual studio tool box at the soda I'm one of the co-hosts of visual studio tool box to show that Robert Green started and myself and Batman Brown there now co-host the episodes and I have my guess you Jeremy yeah I just randomly wandered into the studio I'm actually a cloud developer advocate and have been doing a ton of things without your functions we're going to talk about serverless today both compute with functions and then we're going to do another episode that focuses on cosmos DB which is the less server version of the database I always say flip it backwards what's cloud developer advocate I advocate for developers in the Clausura less is less server it's not no server yeah and then a full-time job I'm actually the product manager for visual studio team services which is our DevOps cloud offering so I have a lot invested in Azure and I mean this guy did a so pretty recent about that as well so being able to Jeremy in the show a lot more stuff together I'm sure all right well we're ready to get started and talk about as your functions so Jeremy why don't you kick it off those what are we gonna talk about today in detail yeah so one of the best ways to get familiar with the technology I think is the dog food it right and I wanted to talk about a project that I made that's my own URL link shortener so you're familiar with these we have a kms here for example who isn't know exactly and what I wanted to do was take ownership over the data so I'm very interested in when do people click through links what links generate the most click throughs right is it Twitter is it LinkedIn is it Facebook is it one of these social media sites yeah and then I wanted to also look at different statistics like what time of day is the most popular time of day for people to click or day of the week so I thought what better way to leverage functions and server lists than to build a link shortening tool awesome so what don't we just roll it back just a little bit because I think sometimes people might be watching the video and they're like what would it what are you talking about what is this functionary so at like five words or less summary what is functions and we are talking about something on a so it's a cloud hosted thing but what does functions give to a developer well if you're going to restrict me to five words I would say events and code right it's functions but but the idea when we talk about server less I like to flip it backwards and say it's less server yes so it's the ultimate realization of focusing on your code and not having to worry about necessarily how your codes hosted it's not even platform-as-a-service because we're not necessarily talking about web applications right we're talking about some sort of event that triggers the code and then we're talking about the code that actually runs right and that code could occur in that the X or Y right it's all it's all dependent on what you do in the implementation it's not specific the code doesn't care what you do with it you can write to to a script file something you could generate some data it could execute a web service call it could return something to to an end user but really it's agnostic it doesn't care what codes inside of it I think that's something that you and I took awhile to overcome as a train of thought right this is like you said a function in the cloud right I mean it feels to me like the ultimate realization of the dream that's microservices if you will I hate to use an overloaded term it's a valid term in this case I mean so some of the things that are really neat about functions are number one you can write them in different languages I'm gonna demonstrate it in dotnet through Visual Studio but you can do them in Python PHP node.js you can even write bash shell scripts that launch function so that's one neat thing the other cool part about the way Azure implements functions is we have a concept of triggers and bindings and these are ways we set up the environment to allow us to interact with things like storage and queues and and it can be file storage it could be blob storage and it makes it really easy for the developer to work with those resources and I'm going to show that in the application that I built that's awesome well let's jump into it it sounds like a great demo alright so what I'm going to do is is jump into the portal right now so I've already deployed this application I'm going to take a step back and show how this is built but I want to set the stage with the link shortener that I have I wrote a web front-end but just to focus on the function side it's a small window but you can test functions directly from with inside the the UI which is pretty cool yeah so what I've loaded up here is a link that if I just paste this link in a new tab you can see goes to some of the azure functions documentation so if I run this through the tester I'm just going to click run here it will go out and call that function and I see a little completed success and I get some text back that has what is the short URL that I can use for tracking so I'm just going to copy that and paste that so you can see the way the experience works so jli K which is my first name and part of my last name dot M e right and then BW is the short URL when we hit this it goes through my function and redirects now for the end user it's a very simple experience you just end up where you're going for me a ton of data is generated from that that really simple event right if we have collects quite a bit right it does and looking at that I actually wrote the part that shortens the URLs I wrote that as a script that's this run script so you can see my shortener there's an encoding routine but the the main part of this grabs a request and you know obviously if I have no requests I'm going to return and say basically not found there's nothing there we get the input we check the input for null we go through and basically I'm tagging if it's coming from like Twitter or LinkedIn or some other things and then at the end of the day I'm really just creating a record here that map's the short URL to the long URL and I'm saving it to table storage and that's it so when I'm putting the link in it's here's the long link and then give me something short back that I can use yeah now the real power of this comes from this function host that I have here and by the way all of this code is available on github so I open-source this so people can work with this project yeah well link it in the show notes definitely right so the the redirect comes in and this is when you're hitting the short end point so you're hitting the the BW e for example so what happens here is it'll grab that short URL and then I have a keepalive that sort of pings the server make sure it's running I also get requests from robot so I tell them not to follow right because this is my link shortener yeah and then we come out and we go in to table storage now this little piece of code here where you can see the start time and I'm starting a timer this is something that I love about functions because when you create the function app you can check a box and say you want to use application insights and this will automatically start building telemetry and analyzing response times and basically giving me the feedback I need to know the health of my application right what I wanted to do is because I'm using table storage is I wanted to measure how long it takes to read from table storage so with this telemetry I have this operation that goes out to the table and finds the long URL if it gets it back it says it found it gets that redirect URL and it's tracking how long that operation took and this is that's the most sensitive operation you don't people to wait when they're being redirected that's I mean it happens all the time now these public link shorteners you get to some URL and write events whining whining whining exactly so I wanted to test that and I wanted to just highlight how easy this was to put this custom data and I literally am tracking tables storage that's the thing I'm tracking retrieve is the action I'm taking and then I'm just passing it how much time elapsed the first two like strings it or they have any bigger significance or they're just the way you decided to store just the way I decide to categorize the data with application insights and then it's as simple as two two steps one is I want to do some more operations with this data but I don't want to slow down the redirect so I'm going to add some information to a queue that I can pick up in process later right now the event is an HTTP trigger it came in and requested an endpoint I throw this on the queue and then I redirect them that's it that's the redirect code then I have will ignore keep alive for now I have this process queue so again we said that serverless functions were events in code right in this case the event is there's an item in the queue and my code pulls that off and does some additional processing so I'm breaking apart the message in this code and I'm writing some custom information one of these is what I call a custom event which is literally this came in from Twitter or this came in from LinkedIn the source yeah right and then the other thing so you can see I do the the track event here the other thing I'm doing and that's actually adding a document I'll get to that into a minute there is a page view so with this piece of code I'm highlighting a page view so now I know which page it actually went out to so I'm saying what was the medium what was the page right and I'm adding that all through application insights and I want to show what that looks like and then this is a piece that we can probably dive into at another time because this is creating a document for Cosmos DB and I added this on later I started just tracking through application insights but then I decided to create a Cosmos DB database because then I can stand up a power bi dashboard and do some exciting things around that well and so what what is it Cosmos DB database or those they don't know yeah it's the actually the function is serverless compute the cosmos DB is a server list database it's a not only sequel right no sequel document based database that's hosted in the cloud what's really neat about cosmos DB is that you can pick your interface we have a document DB interface that was developed for the previous incarnation document dd what well it was cold document DB when it first came out on Azure right was you know very comparable to that's how people wasn't talked about it at Microsoft Center no sequel space and then more recently be renamed at the cosmos so there's any confusion out there that's sorry Microsoft love to rebrand but right the product has been very solid very you know long development cycle already for it and then quite you know the the cloud scale player I think is what they often call it right this lady right lives in a ton of data centers as a concept and use the developer of powerful flexibility to deploy your data across the world well you do you you get to choose your consistency levels and you get to just click with replication which is pretty powerful and the other thing I'll point out is this is using the document DB interface and the reason why I call that out is because you can use sequel syntax to query with document DB however there are a ton of developers are used to MongoDB as you mentioned yeah and you can use a MongoDB interface and write an application around so it's very flexible in that respect yeah it's very cool that you have these options and you know I'm a sequel developer most of my life and I've been toying with no sequel I kind of like it and it's awesome to see this not not really stopped me because I actually start with is my first database that I learned you know just the basics around that that claim me I'm a developer yet on that space right having sequel I didn't realize we've even added that so that's awesome I'm working something new in each episode here and that's what I'm finding out with cosmos DB it's so easy I'm a sequel developer myself I worked with it for 15 years yeah so I had that mindset transition to a document DB but after standing up actual applications using this for my analytics I'm finding out that it's not only easy to work with but it is scalable and fast which is is everything someone wants and I don't have to hire a DBA yeah it's literally inexpensive I run this shortener on my own subscription through Azure and one of the huge benefits I see four major functions is I only pay when someone clicks through the the function yeah right and with the model I get a million calls per month right now I'm sure it may change at some point but with that it's literally pennies for me a month I think last month there was a quarter for the storage and the function calls so cheap to handle and it's 2,000 requests a day yeah it's pretty cool that the thing about you know all of this technology on top of azure is that you you are living in the cloud that your credit card is plugged in they're yours or your companies or whatever in the trial we do give you a limit so if you want to now go over the free trial limit we provided an azure but I'm always kind of encouraging developers thinking about moving to the cloud as the first things they think about telemetry so it's awesome to see application in size built-in you actually want to know what's going on with your cloud service it's not just you know consuming your resources of your service it's going to cost you money potentially depending on how much you know requests come in and people just need to think that way it's a right slightly different world you know the other day money matters so it does and speaking of application insights what I thought I would do is show some of application insights just so people can see and this is just the check mark out-of-the-box when I created the function app and some of that custom code and I want to show the reports that it gives back and then we can look at what it looks like to create a function from scratch three visuals thank you let's take a look so let's pop over back to the the website so this is the the function app I had running and I've got all these features that are configured one of the things I wanted to call attention to is this is using a feature functions called proxies and that allows me to map one route to another route so the function app itself is something like blah blah blah as your web sites dotnet slash API slash URL redirect question mark short URL equals totally friendly which is is not a short URL so in in my proxies and you can see this in in the code this is part of that code base I've mapped what is a short URL right here so just slash and what the code is to that longer URL and that allows it to translate behind the scenes no one sees that happen and and Maps it on to that longer function so I have my custom domain and then I have the azure functions running behind it cool if we come into the application insights portion the very first thing that application insights pulls up for me which I love is the overall health of the system so we've got this live stream which I'll show you in a second but this is really informative to me here because this has given me an overview of response times over time and you can see that I'm averaging a few hundred milliseconds but this is across all of my services so it's not necessarily just the redirects right you can also see a count of requests and then up here we've got something called smart detection this has actually alerted me several times when it finds something that's outside of the norm it will automatically email me and tell me you know what your redirect usually only takes a hundred milliseconds suddenly it's taking two seconds you should look into it it automatically does that and when I click on it if there was a smart detection it also helps me diagnose and shows me the sessions that were slow sessions so I can look into them and try to figure out what's going on I'm gonna scroll down here to performance and when we see performance this will let me pick so overall you can see 122 milliseconds what's really important to me is the redirect experience right that's what the end users are experiencing so we've got a 94 millisecond average and if I want to drill into more detail I can come up here and over in this graph I've got my percentiles so I can see what the 99th percentile looks like and you can see the majority Falls even faster than that yeah so and this is the least expensive version of functions you can back it with beefier servers but even with minimal resources it's still giving me this type of performance the other piece is because I tracked that custom application insights telemetry if I click on dependencies you're gonna see my as your table storage operation right and you can see the average there is 17 milliseconds which is more than fast enough for my needs and what I'm doing here yeah it's cool the fact that you can drill down all the way from like what the requests are doing overall to the custom tracking that you did but in a particular block of code I think that's super powerful the fact that it alerts you is even more awesome I've used application insights kind of since the beginning I'm okay in some products so I do have dashboards but I haven't implemented recently and it's cool to see it even though they added that new automatic notification yeah it's pretty cool the other thing that I call this the the sad portion of the application because it is sad to think that you might be sitting in a hotel room watching the livestream of your website saying it so when clicking it is someone clicking it but it's a think it has its own level of use Melissa when you when you sort of create something this is your your baby one of your babies now you know better or worse it's it's fun to watch so this is a live set of requests and as the requests come in it's it's going to show me those and I may actually force the issue over here but let's go ahead and do a redirect and I'm just going to the generic as ER Doc's so that's the shortcode to land on the azure documentation you can see it here I'll show me the request that showed me how long it took and then I have all my trace information on the side so if I want to drill into details I'm not going to click on this now because it'll go into IP addresses a Mac and like everything you want to know about right session but you can drill into the detail the other piece with app insights and again this is just out of the box without me adding anything is this nice little tab right here for lytx if I click on this it's going to drop me into basically everything that it stores is Coria Bowl for insights so I can set up pie graphs and charts I'm gonna just open up my folder here and look at mediums over the past 24 hours and run that and this will give me a pie chart that breaks down Twitter clicks LinkedIn clicks blog clicks etc so you can see Twitter is definitely my main medium of choice for for generating links yeah yeah I remember somebody showing showed me this at ignite actually this this is like a sequel light language right yeah yeah they call the language itself but it's to me when I saw the first times ago this is the sequel close enough I guess it allows you to query all the various parameters and this is again this is the back end of application insights data has been collected it's not any other kind of data but but it can I think be mixed with other kind of data sources to give you a more holistic view of your environment if you have complex deployments these doesn't help the person described this I mean the dumb right ya know it cannon it's all prompt able if I'm inside and I start to type it's giving me a tell us and intellisense so it'll walk you through creating these these queries and that's exactly how I built the one you just saw and I'm gonna open top page views and we'll just do this talk these rolled ones you built yourself right yes they didn't have those and it saved it for me and then I just drop in the table and I could see channel 9 it's actually one of the more popular links in the bag 24 hours right so that's always nice to pull up on the fly we've got a juror this is actually interesting these are all Microsoft properties I actually do tweet other links but these are the popular ones for 24 hours yeah that's cool so that's the application insights experience let's pop over to visual studio and just show someone what it looks like to start a new function out yeah that's really great I think I think it's awesome when we show how we did something and we provide the code but often forget this part right exactly how do you get started yeah so the the prerequisite here is I'm working with at least 15.3 right so it's a preview version of Visual Studio 2017 right think we're up to 15.5 any of those versions will work for functions yeah if anybody has been kind of away from the visual studio versioning game for a while that's the versioning scheme we've gone to and if you like go into about dialogue for a second under the help menu sure yeah you'll be able to show so if anybody has any doubt which version they're on you can jump in there and there's 15.4 preview of that particular you know preview branch and you can install side by side so I have always the RTM version and the preview right machine it tends to work really well I've never had any issues asterisk a string like now you said it I know I care but your machine in your environment users out there yeah that's how people know in case they don't know which version yeah so once you have that install and you have to pick the cloud work load will go into a new project and as your functions lights up and the way I like to talk about this we talked about a Vincent code the function is the actual piece of code that gets executed the function app is the host for those different events and pieces of code right so you have a host that's what this as your functions is it's a minimal amount of you know stuff around it to make it work as a function and the rest is up to you right so what this will do is it'll create an empty project for me that's just ready to host an endpoint so then I can click on that and add a new item and fortunately these are sorted alphabetically so as your function comes up right off dial this yeah that that's convenient and I'm just going to give this a name of echo name and click add and what will happen is it's going to create a class for me the entire experience for functions within Visual Studio is is attribute driven so it's very easy to add what we call bindings or connections to things like table storage and queues what I'm gonna do is create an HTTP trigger this says basically you know what call this piece of code in response to an HTTP request which is a pretty common scenario and I'm making it anonymous so anyone can test it out and access it but you can we support permissioning but for our example here right no big deal and I think they also good just to connect line so we've gone the dependency is like what NuGet packages is this team bringing into to make this the default so you just got the function SDK and that's about it it's very bare-bones at this point there's no application inside there's no you know there's no gunk if you don't need that stuff it's not right by default free right and then if you want to start tracking custom telemetry you would just you know add a new get package going to the Explorer and add that that experience yeah I think if your right click on dependencies it would give you that yep as reference so what we've got is our async task and what's coming out of this is a response message because we have to respond to the request what's going into it is a trigger there's two types of parameters we're typically gonna pass a trigger is what actually causes it to get called and then a binding is something we might interact with and I'm going to show how to do a binding in a second cool so we've got this anonymous it supports getting posts the routes no here's to the request and here's the log and by default it creates some code that expects you to put the name in the request body or in a quarry string and it's gonna echo it back right but what I want to show is before we even touch a j''r I've downloaded the prerequisites I've created a function app I can put a breakpoint right here and press debug and what will happen is it's gonna run a full version of the function host right on my laptop and we just announced that we have this experience available cross-platform cool so it's not just Windows machines this will run on on Linux as well and and Mac OS nice so it's a been waiting for that when I give I kept hearing it was coming in it's awesome that we we finally announced that I I missed that part not not that I'm a Linux person or anything I still run a PC so I'm quite biased alright I spent a lot of time I actually was having fun running the function host in my Ubu - on Windows 10 yeah through the windows subsystem for the neighbors I should try then accessing it so all I'm doing is pasting the URL it gave me and you can see we hit the breakpoint and if I continue for that it's going to slap my wrist and tell me that I needed to pass a name so we'll go ahead and give that a name name equals vs toolbox hey Brandon go and we hit our breakpoint again and we'll go ahead and continue through that and what we'll see is it'll echo back and say hello this toolbox so that's a great start we've got it running locally we were able to debug it let's take it one step further and load it into Azure what I'm gonna do is just right click and go into publish and the publish experiment experience will allow me to create a function app in the portal and connect to an existing one or I can spin up a completely new application right from right here so we're gonna use live there earlier put the publish experiment that hey sometimes the world can be a public experiment yeah we're gonna try for the publish experience today let's see if we get that so we're gonna call this my vs toolbox app use my subscription and I'm gonna give it a second to spin because what's validating is making sure that is indeed a unique application name yeah I'll give it an agree eating the cloud you know resource that's assigning it to to the research group of your choice or new ones so there's a lot a lot to do there but you never have to leave the ID in this case right I'm gonna pick a location will do West us since we're filming here and let's the biggest machine can we do here oh my goodness you would want to do this right so one thing I do want to call out I can pick these various course to back my experience I can also pick the consumption plan the consumption plan is what I call the easy button for functions I don't have much control over size of the servers but I'm allowing Azure to do all the scaling for me it will automatically look at incoming requests and do what it feels it needs to do to accommodate those listen there's always trade-offs right if you have dedicated machines you can configure them to be always on so they're ready to start where with the consumption plan it may go to sleep and you have a new request and it takes a little bit longer to start up but again you have flexibility of options and I think consumption there's a reason to go at a price wise right there's some different right that's a good deal if that's good enough for your production environment right and that's what I'm using for my redirect experience as well I just have a cheat a little bit with a keepalive that pings the server to keep it awake yeah well that's valid they know you're consuming it nobody feels cheated in a dream I'm sure right yeah know it they're keeping an eye on you but for good reason that's right yeah so this is going to deploy there's really I like to share when people are watching this spin there's two steps to this the first step is creating the assets to host the application so it's going to create a resource group which if someone's not familiar with Azure that is a a logical group of related assets I think of it as life cycle if something's going to be created or destroyed with something else so you have an app and a database if they're related they probably belong in the same resource group and you can track cost by resource group and you can script out and even delete entire resource groups yeah it's a very powerful idea at first that was you know when resource groups were introduced I was a bit frustrated like another thing to do there's a girl wait oh there's a lot of benefits to this other thing to do so now I don't even think about it twice I really started to memorize resource groups I'm getting that bad on my glasses my out of my miscellaneous one if I need to just throw something out versus okay this is a bunch of real stuff together then I group right and it's great to if you're giving demos or meeting meetups or user groups because you can create a resource group for that experience and go through the same demo but partition it off so once it spins up those assets it's got the hosts it's got the function app the function app has storage with it next thing it does is builds and creates a set of assets that it then bundles up and deploys out so the first step is what is my target and then the second step is publishing and now it says publish succeeded so what we'll do is we'll just copy this in point right here I click copy to clipboard and we'll paste it in and notice now instead of running off localhost I'm doing the full my vs toolbox after we selected that was the unique name yeah and we called it echo name I believe so if we hit that it's going to spin up and it should slap me on the wrist again and tell me that it's expecting me to put a name inside the corey string and what we're seeing right now is that spin up you know for the first time and we'll let that go and and I always encourage people to use the mouse trick right if it's a clockwise mouse rotation should speed things up for that that is definitely the matter right there I mean you know Jeremy's magic tricks and look at that so please pass the neighbor Cory string now that it's spun up if I correct this and we'll do this again name equals vyas toolbox boom immediately it comes back hello vs toolbox and that that's the experience so basically I showed you how to create the function app from scratch from visual studio but then if you want to see what a mature application looks like something I'm using in the real world then that's going to be on the the github site for the link shortener that I created yeah and the fact that you can write this thing many languages the fact that it's so globally hosts the bowl I mean it's it's amazing what you can do nowadays it is yeah the only thing I don't have in production for more recent stuff is probably functions but we should some find some excuse do to put a function up there but it's cool yeah yeah no it's a great experience and and it's something that I'll be looking at too is is how do we take existing web applications and migrate them where it makes sense just because you can't move them doesn't mean you have to but where it makes sense because ultimately what happens is instead of one app with five endpoints that if you make one update you have to redeploy the entire line with the function you can literally just test and redeploy that one endpoint in isolation and you know you are very familiar with DevOps and and that experience and being able to continuously deploy at a micro service level is a huge benefit in my book yeah it's super awesome in the fact you can monitor it you can really get a sense of T to roll something back how is it doing or if there's any underlying performance issues in the infrastructure like the table storage slow down whatever I mean I have lots of flexibility nowadays to understand what is going on with my production environment and my staging environment if you put everything up on Azure you have all that same telemetry for all your environments which is really awesome right I've always loved love that part of a my def the Devon's experience is awesome right to get you going but get it up in the cloud you get all Morris or a benefit absolutely I'm digging am a one-man shop right with your shorting tool but I get all the telemetry and information I need to make sure it's running and up and healthy awesome well is that all you wanted to demo for this particular there was epic all right well thank you for being on visual studio toolbox and we hope you folks enjoyed the episode we'll make sure we'll put the links to the github repo and to any other resources we mentioned in the show notes and we hope you come back again and watch another episode of visual studio toolbox so thank you Jeremy for being on and see you folks later thank you see ya [Music]

Monday, 21 October 2024

ASP NET Core Health Checks

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

Anton Andrews The Role of Creativity in the Changing World of Work

Morning everyone, how are you feeling? Great, ready, all right cool, this is going to be a fun morning. I was talking with Joe this morning, Joe runs a really interesting place in New York called The Office for Creative Research. There's a weird tension in that name that we were talking about which is the word office and the word creative right next to each other. That's kind of why we're here today. Typically we were talking with Stoe last night when we think about productivity, work. It has that barbwire feeling to it, right? When we think about productivity we don't think about it that way at all. The pope said, "Without work there is no dignity." We think productivity is this massively important emotional thing in our lives where we're trying to create something to be a part of something larger than ourselves, that sense of belonging, that sense of achievement. When we think about that world that we live in that really means something to us and yet the landscape within which we're working is changing and it's changing in some pretty dramatic ways. Just to kind of quickly run through some of the things that are changing in the world is much more interconnected than it's ever been before. The speed and volume of data and communications coming at us is unprecedented. Networks are allowing information to flow faster than ever before. Even though, obviously in some parts of the world that's being tamped down. At the same time technological changes happening at an exponential rate. When you take all of these things together it creates a very unpredictable world. You know, General Stanley McChrystal, when we talk to him, he told us about volatile conditions on the ground. The same thing applies if you're a start-up, a company or an enterprise. How do you behave in this world? For about 100 years Frederick Winslow Taylor introduced this model of efficiency, we've run our companies the same way since then. We've educated our kids in the same way. Everything was sort of pointing towards this model of efficiency, this model of doing the same thing repetitively at scale with maximum efficiency. We train our works to behave that way, our management books train us to behave that way at work, our companies are geared towards that. Yet when the world around you is changing very very fast and very dynamically all the time, suddenly you can find yourself doing the wrong thing very efficiently. That becomes a real problem, becomes a survival problem. When we look at companies, there are these questions that we have to ask ourselves, small or large, start-up or massive enterprise. How are you going to survive in this world? How are you going to learn as a team? How are you going adapt and evolve? How are you going to respond creatively to the changes around you that are happening everyday not once a year? Add to that this whole thing that's happening now with automation and the fact that automation is gradually eroding and probably will in the future continue to chip away at routine work and road work. That sort of almost pushes the window of human employability into a space which is about creativity and social skills. If you take all of those things together, creativity starts to suddenly feel tremendously important. We think to re-think education, we need to re-think productivity with creativity in mind. We're going to ask some questions today and I'll just give you a brief preview of those questions. We're going to hear 2 amazing speakers, actually stand up and prime our minds. Then we're going to split into working groups and dive deep on some of these questions. Just to give you a taste some of these questions, as we shift from economies of scale to economies of innovation, one of the questions becomes, how do we foster a culture of creativity at work? How do we get away from risk aversion? How do we stop those [inaudible 00:04:11] that come in every year telling us that half our workforce is massively disengaged and instead create a culture, an operating system as Aaron would say? Aaron talks about an operating system for our organizations. How do you create an operating system that promotes fearless creativity? Another question, when we're in this world of abundant real-time information, constant information, constant data, how do we make sense of it? Can we actually use it to increase the quality of our work? Instead of our productivity tools just helping us document stuff, can they actually help us think and be more creative at work? That's going to be another question we'll dive into. A lot of our traditional productivity tools were made for individuals sitting at individual desks, working on individual computers, printing individual documents. That made sense in a stable world but now that we have to collaborate more, now that we have to work in real-time with each other, one of the questions becomes, how do we create super rich connections between people? How do we create high trust interactions within teams and between teams? That's going to be another group. Finally going back to AI for a minute and automation, this is something that Kate has at heart. What are the principles that we need to design into some of the new experiences that we'll be bringing to the world that actually make sure that we don't remove human agency as we introduce artificial intelligence and automation? That's going to be a very interesting working group, I think. Finally we have a whole bunch of people here today who are really about the physically environment. We're going to create a group that mixes some of those people in with the rest of you and we're going to talk about the workplace. Why go to work today if you work from anywhere? What is the workplace for? Why is it still important? We believe that it is still important. In fact, we believe that the workplace is a critical tool for knowledge exchange and for creating togetherness, co-presence as Dave would say. For that reason the workplace really should be a theater of innovation. Clearly, today's paradigms of isolated offices or open plan chicken farms don't really create a theater of innovation. How can we rethink workplace environments to support both individual creativity and team creativity at work? Really creativity from many different angles, that's why you're all here, you're all different. We have a very, very multi-disciplinary and cross-organizational group of people here. Our aim as Lisa said really is just to have this discussion amongst ourselves. We hope that we'll all benefit from this. It should be interesting for everyone attending.

All in one search in Visual Studio 2022 v17.5

finding the features you need and the code you're looking for has never been easier than with the new all-in-one search experience in Visual Studio let's take a look we'll start by enabling the feature go to tools options search for the keyword search and select preview features now check the checkbox next to New Visual Studio search experience and restart Visual Studio you now have the new all-in-one search experience from here you can select code search or feature search code search lets you search through all of your files class names method names and so on and it's super fast just hit enter to open the file code search shows you a preview to the right side of the search results but you can move that underneath if you prefer that or disable it completely from the preview you can do code navigation such as go to definition or refactoring such as rename of variables this way I don't even have to open the specific file in order to do my refactorings throughout the entire solution making this a lot more efficient feature search or control Q allows me to search for features throughout the visual studio IDE for instance the text Explorer tool window I can also search for individual options in the tools options dialog directly from the feature search here I'm searching for a way to change the keyboard shortcuts and it takes me right to the place I want to be if you found this video helpful and you would like to see more of the same type of content in the future make sure to like the video and subscribe to the YouTube channel down below happy coding

4 New Git Improvements in Visual Studio 2022

>> Everyone. Thank you so much for joining us as I share all of the latest updates for the Git tooling in 17.10GA as well as the 17.11 preview releases. Let's just jump into it. I've got some changes that I've made in this file and you can see that by the green indicator here. I'm ready to commit these changes. Now, you might have seen in previous releases we created this AI generated commit message. If I go ahead and give that a clip, what that's going to do is Copilot is going to take a look at all of the diffs that I've generated in the set of changes between my previous commit and my current one. It's going to describe those changes. Now we got a lot of feedback in the previous release that this description was a little tube verbose and maybe added some extra bullet points that we didn't need. We definitely took that feedback cleaned up the front and gave you better responses so that now you have a clear title and a description. Now with those changes, we actually increase the amount of people that were answering those suggestions and finding them helpful, so we're really proud of that change. I'll go ahead and commit that. Then if I go ahead and push it, what you'll see is an info bar showing up at the top coming in right here and that's going to let us know that we've got this option to create a pull request either in Visual Studio or in the browser. Now the create pull request page is not brand new, but we did make tons of updates based off of all of the feedback that we got from the Team. Now that we have the new pull request page, we're going to go ahead and add a title. You might have noticed a new update here is that I was able to get the template from my repo auto populated in here and these are going to be the default templates from either GitHub or Azure DevOps. This allows me to be consistent with my Team, be compliant with my Team's practices. If for example, my team doesn't have a template and I wanted to get a first draft of my pull request description, make sure I did miss any changes that are covered in this pull request. I could go ahead and use this AI generated PR description which works exactly the same as the comment description so it gives me a super easy starting point when I want to add that. Finally, I can also create these pull requests as a draft and these were another set of the highest level feedback that we got from the customers when we created this feature. Additionally, if you're using Azure DevOps, you'll see an additional area in the related item section that allows you to link those items so that you don't have to do that in the web. I won't show that here because this is a GitHub example but keep that in mind that was another highly requested feedback item. Now I'm done creating my pull request, and I'll go ahead and I'll switch branches to show you another new example. This feature is something I'm really excited about. If you're anything like me when you create a pull request item, it can be really annoying to actually address those comments. You have to open up Azure DevOps or GitHub in the browser and then you have to map all of the locations of those comments and changes back to the code. That is just a lot of time taken switching context between the two. But now, you can see this easy info bar that says show comments in files. If I click that, I actually get to see all of my pull request comments directly in the editor. This not only gives me the ability to cut out that context switching, but I get all of the benefits of being in my favorite IDE. For example, I'll share some really quick editor tips that are brand new. I'll show you I can use the new auto surround feature that allows me to just highlight a bit of text and then click on the quotation mark and that surrounds that text with the quotation and adds it on the beginning and the end. Previously, if I were to do that, it would have erased the text that I had highlighted. This is a super quality of life improvement. Then if I finish those off, I'll have addressed this comment by my colleague that mentioned that I didn't use the correct quotations and so it wasn't going to render correctly. Now I have that edit and I'm ready to resolve that comment. Now that I have resolved that comment, I can move on to my next one and it looks like I had the wrong png file here. I'll go ahead and I'll update that to be the correct file. Now, I have quickly resolved and acted on these two comments. I didn't have to map back and forth between the comments in the browser and in my editor. The last thing I wanted to share is an improvement to your Git history flow. For example, if folks didn't use our handy commit sage feature, they might not have included enough context in their commit to actually help you understand what happened in a given block of code. If I go ahead and open an example here, now I'm in the commit details view and code refactoring is helpful to know what happened. But if I don't want to go through all of the different files, I can actually click on this explained button and that's going to take the same algorithm that we use to grab all of the diffs and describe those, and give me a better description including references to the files that change the lines that change so that I can get a better overall view and I don't have to go through and understand exactly what happened by looking through the diffs by themselves. This just gives me a better overview and I get more information than I would have just from the code commit message by itself. Those were all of the features that I wanted to share. Thank you so much for joining us today. I hope you found some cool new Git tooling features that you're going to leverage in your everyday workflows.

.NET on a Microcontroller with Wilderness Labs Meadow IoT solution

oh I didn't see you there hi I'm Scott and right he's talking to this microphone cool how's it going friends I'm here with with Adrian how are you doing well thank you very much one of my top 10 favorite Canadians and we brought a bunch of things to show which I think would be fun yeah and will you push the buttons or do you push the what we want to talk about is is dotnet specifically for tiny devices right how tiny like I have a Raspberry Pi but it runs an entire operating system right so the Raspberry Pi I'm a huge fan of it's really it's a it's a tiny computer it's a full micro processor processor yeah works Iran dotnet on a micro controller okay microprocessor microcontroller it's small but like processor controller you know potato potato yeah so think less power a lot less power so much more people running out battery doesn't require full operating systems we're not gonna have this whole Windows environment that we see on sale Windows laptop or a Raspberry Pi okay so these don't boot into full operating systems that are multi-layered with kernels and drivers and haut and user mode and a show and write yes so is it essentially these into being when you write your app for a micro controller you're in basically a single purpose product you're going to run the application and the only thing that really beats definitely running and executing is your application okay about how like we know when you run something in a container you don't necessarily run like a full Ubuntu and then you're ten yet you run like Alpine or something with a tiny surface area these little operating systems are they call real-time operating systems right there have a very small surface area right yes they do the minimum and so they needs a minimum so your application gets the most the resources oh and they're constrained rich devices but well they also end up being very very stable it's really just running your application you boot almost you booting into dotnet effectively you're putting into a tiny operating system which runs your one app yes okay and this case mono as well can we share the screen or do we do a picture-in-picture push this is all right cool so this i'm not associated with this company i just think it's really cool will labs they have like we know and meadow and what we're talking about here is meadow so it's a platform that runs dotnet standard 2.0 and dotnet standard 2.0 is really great because it means that it's c-sharp code that you're writing to a standard that you know I could write a console app and it would do stuff I could write a constant could write that library and put it in the cloud or I could take a library and depending on how I wrote it if I wrote it to a standard I could put it on this tiny device absolutely so you can use all the great c-sharp skills that you develop building mobile applications desktop applications cloud applications and apply those skills to making IOT application right right and one of the things that's really interesting about this idea of a microcontroller is that as as Brian from wilderness labs likes to say is it's going to become the dominant form of computing like there's more microcontrollers than there are like people yeah absolutely we think about this a lot in consumer world things like like nest and you know home automation but that's really a small horse of that market I think truly it's it's industry and automation where there's huge numbers these devices already deployed we see a really big growth in that area so when you think about Internet of Things these things are not gonna sorry gonna boot into Windows or Mac or boot into a boon to it they're gonna put into a a tiny real-time operating system yeah I think the way I think about it is often you don't need those full os's and there are ok there are cases where you want that and you're Nam you know like the guy point-of-sale systems or they might have a little more functionality but for a lot of things running behind the scenes for automation we want those things super efficient super super stable mm-hmm and and obviously very secure exactly and who needs the headache of an entire giant operating system when you can go and do something like this now let's think about specifications we know when the Raspberry Pi spent $35 to micro processor 35 bucks and it has no gigahertz right milk quad processor gigahertz 4 gigs 8 gigs of RAM look at this 16 Meg's of RAM 200 megahertz but it's also got Wi-Fi Bluetooth and it can go and do things like jpeg acceleration but with these small specs I can still run a dotnet application absolutely so John and I think about as being either interpreted just-in-time compiled or ahead of time compiled we doing that so we are running the full mono on this so it is Oh make sure it must speak here but I believe we are it should be je compiled and then well in this case here we're gonna boot into this little application with a a build that we built locally and then we sent across the wire onto this tiny device let me actually do a little trick here if you don't mind get frisked and I just want to run my camera locally here so this is my camera surprise it's gonna be freaky hey friends Hey look at this this is what the device looks like well tiny that is like a stick of gum hey smaller than the size of your finger a little tiny thing very very light runs battery life could be a measured in days and weeks and not hours as it is absolutely if I okay so check this out look at this friends like we did for you know if this will actually work because of mirrored images let's do this will change and you talk about the sides here and keep in mind this actually is a prototyping board this is adult men board and so this will be an open source open hardware project so you can of course make this into your own hardware projects and make this even smaller and that fun so this is the development board and user to your point it could be smaller you could build this into anything yes and what's fun about this is that you can go and use whatever makes you happy for example we've got in my little kit here all kinds of stuff we could potentially play with I've got a soil moisture sensor I've got LCD screen and a segmented display I've got a ink you can see here we wrote on e you could potentially do a tricolor ink here that we got from Adafruit there's potential there lots of different things that we could do but when I'm writing this code well let's see what it looks like is that cool yes absolutely alright so this is a part that I'm so excited about so I'm just gonna go into visual studio here and let's do this I've got two things to show you first let's open up visual studio again and I'm going to go into my github and let's look at this e ink display okay yes absolutely you know a paper I think we call that and I point here that we're of course you're opening up Visual Studio 2019 yeah that's a good point I could open up visual studio code and edit it as a text file did you just see sharp but let's look at this this is actually a Visual Studio 2019 and I just added a physics you know I added an extension to it to make this work with with meadow but let's take a look at for example this ePaper I'm just gonna right click on this and I'm going to say edit project file okay and look at that see s proj here okay we're targeting look the meadow SDK in this sense now in this here it's pretending to be net 472 which is what mono supports but if we go and look at one of these displays go look at these so we've got these different libraries that use the meadow foundation and then let's go and look at the program itself check this up I'll go ahead and make that bigger here just make an instance of our new app and then basically chill out so we look inside this I love this it's an app of type f7 micro which is that chip that we're using here on this particular device right yeah exactly so this will match the the hardware the form factor so in the future other board will come out and you can swap in make sense because the meadow platform could work on other things and you'd have an app of that type as well which is really really cool if we go in here and we say like initialize hardware I understand that with microcontrollers there's different buses there's different ways to talk to things what is an SPI bus so that's the serial peripheral interface that's a fairly well-known it's a standard communication protocol generally it's good for high speed devices and you'll see it's used in a lot of these types of displays for example because that's good for pushing a lot of data and this is interesting because you see right here there's this this right this ribbon almost river effectively made our own ribbon cable here yes yeah exactly right and it looks like we've got eight bits going across that into a number of things you've got your ground your power and then a little bus here how BIG's the bus for these or three or six of these so the bus itself was actually two wires but there's there's a few extra things for various bits control so there's um get your power and your ground over here pairing the ground and you've got do through do three and then you've got scx and then mosey yeah so there's there's a clock signal for SPI which is just to make sure that the two devices are talking at the same time and then mosey is master out slaving which is sort of old school technology we don't use it it's a master slave anymore but that's the standard for SPI the meadow in this case is the master and this screen is the it would be the slaves I see there yeah and you see the Mesa which would be if you had devices that were sensors or reading data in from the world I had to push that data back to the metal board and then there's a reset painted a to command pan they're just some extra pins generally use an SPI I'm good until details right now but they're so common to wire up and we use those when the GPIO pins on meadow and what I'm finding really great about this platform I'm on Windows and you're on a Mac I'm gonna go out here because there's a tool that I'm gonna be using to just plug this in I wrote a blog post about this so you can just flash this on Windows was really easy with this thing called dfu I did this one time just to install the operating system and I haven't thought about this since this is not it used to be hard to do this kind of work and you'd go and install generic USB drivers and all this kind of stuff but all I had to do is just plug the meadow in with USB showed up as a serial port yes yeah that seems to be the nice clean generic way to do things it showed up as a serial port and I said oh it's on comm port 3 yes exactly and then from within my application here in Visual Studio look I can go and say right-click deploy and I got a nice clean experience yes and you do have this one visual to you on the Mac as well absolutely on the Mac and and you mentioned the comm port one thing that's really nice about that of course is Windows Mac OS supports multiple courts which can allow us to have multiple devices plugged in simultaneously and select which ones to deploy in the future yeah and then the we have this concept of a driver and this isn't like a driver like a dot sis file or something on I've got a question well you can feel free to just throw questions in it's open question your script 23 is is the board powered only by the USB port a great question is a great question so depends on if you're developing or not yeah yeah exactly so when we're developing we'll just plug in the micro USB cable and that will power the board now of course if you are using peripherals that require more power you know our displays are probably you'll see one is backlit and that's put to limit to how much power we wouldn't pull through the meadow so you might want to have external power and then once you've got you know a hardened solution you want deploy in the field meadow can be powered up battery as well and there's actually a battery port right on the air and they reminder again there this is in fact a and I'll go ahead and bring the camera up again this is a development board but when we switch back over to here you can see come something interesting you can see your micro USB here and then I can power that off a lipo yes yes I've done that or have a little bit the Impala battery and that works really great as well and those can last for a very long time and again this is the development for the other one will be a different size and to this point actually let's try something a little more sophisticated than eating because the e-ink is effectively hello world yeah I wanted to challenge us to do something more interesting perfect let's do that I'm gonna go back over here and I'm gonna say recent projects and I want to go back over into my FM radio basically check that this here this was a challenging we've been working on this this afternoon and and by we I mean you and I was also there but I get to what to take lots of credit for it and I thought this was super fun because what Adrienne Witten did here is he made an FM radio yes and I wanted to explain this concept to folks that understand dotnet because I thought it would be a fun way to do it here so what we've got I'll go ahead and put my camera back on here we're gonna do this check this out okay friends so we've got a radio there we go thank you sir you've got a radio here we've got the meadow board here we've got some buttons over here there's the meadow we happen to be powering it over USB but doesn't have to be that way but I want to be able to debug it and you know come to this if I want to and here you go looking actually it's oh it's upside down well not it's I've got it upside down here what I want to flip around the others it's okay like this there we go alright so what we're doing here is we're listening to the local public radio station here and Seattle or in Redmond where we happen to be okay so what I'm gonna do friends is why don't you give me a favor Jeff which I want you to hold this and I'm gonna hold that there and what we've got is our speakers now we're getting the Sun I think we're in a building here so yeah that cool so what we've done here I'll go ahead and unplug the speakers cuz this that's fun oops so how would we do a radio right how do we do a radio friends let's look at this it's it's fun because I like it cuz its model-view-controller okay think about this gold ass is requesting radio stations I guess so no now there's a question RadioShack come on we're not taking requests here people what's wrong with you when I say model-view-controller this is my construction not a meadow thing but I thought about this and it's like well there's the view right absolutely here's them here's the model here's the database to thing the webservice the object the the model the physical model and then in this context the dotnet code is the controller yeah I love this in that great and then you've got your buttons there that will set it to mute or to scan forward to the next FM radio station which is really really cool this is the kind of cool stuff now again this is a prototype that we've made if we're gonna go and sell our radio now we need to put an enclosure in a box yeah exactly quartz you get one with it it's a great app you sir you know 3d printing to get your first first engineering sample going mm-hmm and then yeah I don't quote me on all the parts but Moses are standard off-the-shelf so you should be no problem to you know big a custom board and okay so could this run dotnet core three right so right now it's using mono but in some theoretical future as dotnet core mono merge that I should have share that code yeah so um maybe in the dawn at 5:00 timeframe yes I think you do Baron I whip I I believe there's some some there's something so the intent the intent is to reconcile the dot Nets into a single dot net and mono right now is really let's talk about that for a second mono makes sense for something like this because it's clean portable C code it's got a great easy to build code environment yes mono is portable mono can run on a Nintendo switch or a we write because it's so portable so the ability to be able to go and take mono and then take some of the ahead of time compilation things and modify it in such a way that it works it's a small device is important but in the future we're gonna take down at core framework and mono and merge them into some kind of unified thing now those plans or years out two years out but certainly I don't see any reason why they couldn't but I don't know if I can speak for folks at the news life yeah and I'm overstating the goal is to make sure the sillies if the want is for it to be a modern development experience yeah so I think as dotnet evolves you'll see the meadow platform evolve and you know he's me mention the start you know supporting dotnet standard yeah and that's really nice way to share your Cove between dotnet Accord on that framework well and let's talk about that for a second because if we look at the code here let's remind ourselves so the individual said could it run down at core three and the question is does it matter because in this case if it is running to a standard if you have the functions that you're used to having then it doesn't matter your code is reusable exactly yeah but in the context of these kind of single tasked applications let's call this a single tasked radio application as soon as I do something that's specific to a piece of hardware if I'm on Windows and I decide to go and do talk to the registry right I'm using done at core three but now talking to the registry race now you've got a desktop cific application sir I just became Windows specific I can't do the registry on a boon to if I am doing a Raspberry Pi application and I talked to a GPIO pin let's say that I hard-coded two GPIO seven now it's not only Raspberry Pi specific but it's specific to a wiring diagram the way I made it then again with no matter what dotnet it's been written and it's now married to the the system so if we go back over here I like the way you did this you've got your digital output for your led your input for your mute button let's look at initialize hardware what's great about this is that c-sharp do we know how to read it and you go and you say hey this pin is for output and this pin number 12 which we've looking at our thing here yes we in that for 12 and then you go and get the bus ready and then you let us know 0 1 2 those are the pins that that device for the display is sitting on set the contrast then we have an i2c bus another kind of bus and the bus exactly that's the one to be FM tuner is using mm-hmm and then we've got this te a 57 67 you can go in Google for that with Bing and learn about that particular FM radio which sits on that bus you see how you're chaining those together and then here we're just hard coding it in the to start out with the local radio station and then we've got a search button the button is then hooked up and you'll see that there's a nice event there to go and say button chain so it's very familiar experience yeah and one thing I love to call out here is typically for these kind of applications you're able to do all the hardware have the you know the also with the software wiring but the hardware plumbing in a single method with an initialize method yeah and that's really the only place you need to do that any hardware interaction otherwise it's just C sharp and dotnet so it's all just familiar coding in a familiar environment and look how easy it is so after you have initialized Hardware then we just have an update display and then update display gets updated yes as soon as anything changes in this case and we're going to say draw text at zero zero I mean like I don't know IOT but I know this that's what makes me happy look the ternary operator in c-sharp like this is C sharp that you already know which is super fun yeah and I think that's what's really means about mono when it's running all these devices that yeah our skills are transplantable absolutely look it sounds like some of our friends in the chat room are little inspired and they want to know well the source code be sure I don't see why not actually we've got this source code right now over here I think it's hidden but there's no reason we couldn't make this thing that we were messing around with oh yeah absolutely now it's early days but you can see right now this is a an hour ago when we got all this stuff working you can see the FM radio code we were working on that as much as recently as an hour ago and then the ePaper display I want to do point out to be clear that this is a beta we're on beta theory yeah of meadow I think it's like what made us be a meadow beta 3 bi 3.1 I believe 3.1 beta 3 and it's so it's very early here who knows what will be done things will change your mileage may vary yes but go and explore our friends at wilderness labs in their website and talk to them this was actually a successful Kickstarter and they're kicking out these now you can go and watch a video about how this this project works and how it is gonna hopefully move forward and do a lot of really cool stuff yeah absolutely lots still coming so if we sell let me add Wi-Fi support for some Bluetooth there's some performance improvements coming plus a lot more driver surface yeah yeah if I go and look at my device manager right now and I can see right here I can see ports and there's sure them I know this is actually kind of a fun thing or fun hack that folks do if you have a circuit python device from Adafruit you plug it in it looks like a disk drive in this case it looks like a comport because it's kind of a universal bus like it's talking to these things really really easily and in fact if I remember correctly there's also a I mean I'm on my desktop here let's go to desktop meadow there is a actually a CLI as well a command line interface maybe we can do a little something with that yeah absolutely so the CLI is really it's the the proof of concept all the communication to meadow this is what's actually powering the visual to you attention mm-hmm so if I go and say can I see like file system lists look like - - list files yes definitely see if that works there you go so I just said list file said port com3 opened hitting a list of file types you can see there that it says mono is currently enabled so it's turned on right here if it was disabled we might be formatting the file system or - flashing a new firmware on top of it well so actually so interesting for the command line well double mono off and on so we can work with the device without not the executing application so we mentioned it right now you plug it in runs just runs right that idea that the single purpose so it automatically runs the it looks for actually a BAC mono fires up so you can disable mono allow you to you drop the file system without the app running hmm and then these are just the deals yes exact right in the mono right so let's think about the layers here right you get like sister not object the meadow foundation you can see the drivers for your your FM radio on your screen right the meadow stuff that's underneath meadow that foundation and then the graphics library to output to the screen draw the text ya decode get maps whatever needs to go and not actually that's a good call Oh in that's just code to me play data in memories just buffering which is a really great point actually if we go back over to that and take a look at the graphics library what's fun about these things is you can find out about the underneath like there's nothing hidden here you're not hiding anything from us you're like look that's a real font what's in there it's the width of a height in 8x8 right this is actually we build little tools actually had it was a lwith application you design the fonts my hands you just went and draw it and it's saved into a complete the bytearray fire exactly and when you go and you do these things it's like okay you know pull it out of the font table yeah this is it when there's nothing else hiding from you there look there's all your fonts yeah and that's very common in this kind of a tiny environment right yeah cuz of course they're they're super small super efficient right so we go back to our camera here take a look at what this font looks like I'm just gonna bring it around to the other side of the camera here well the cameras coming out is this were coated to a particular version of mono where can he be updated so I will actually show you in just a moment here seaton there you go so there's the font that we're drawing on the screen right there and that's the 8 by 12 the 8 by 1200 exactly so about the versions and the how these things work for example I received my board when I got mine for my Kickstarter on version 3.0 of this operating system so I plugged it in and you have to think about the layers right and correct me if I'm wrong here but it by default it boots up in the mano with mano enable that looks for a PXE and it run so you turn it on and it runs but if I hit reset while it's plugged in it's gonna go into this device firmware updating mode and then I could go and run DFU util lash the operating system on top of it yeah all that's bundle and included with that so when I downloaded it this is mono here yes exactly and the stuff in it and that comes with with the meadow so we are kind of dependent upon the folks that are working on this with their version of mono to make this work yes and so yeah I mean there are as there there are some parts of other deployed with the deployment the OS you sell itself and actually that MS core live what we deploy as NuGet package yeah a separate pulldown in terms of being up to date last version mono without miss I don't want to overstate my understanding his intentions to keep it up to date yep and so when changes are made to mono does we pulled into the verse of model gets deployed on meadow so pretty amazing stuff I just wanted to share it with you all I thought it was so cool again I'm not affiliated with this company but they seemed really cool wilderness labs dot Co they had a Kickstarter I'm a supporter I think it's great you can see I've got my kit that I got from them as well as the the wilderness labs piece of wood on which the breadboard is mounted so this is just an example of kind of the great stuff that happens with open source and dotnet and thank you for for hanging out with me thank you so much for inviting me in so yeah absolutely cool now what Jeff rinsed now we're gonna bring in our other host and we're gonna set up for our next yes deuces this is how later all right

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...