Showing posts with label say. Show all posts
Showing posts with label say. Show all posts

Wednesday, 23 October 2024

Brad Smith A Cloud for Global Good

First, I want to say thank you for spending your Monday morning with us. It's a real pleasure for me to be here in Dublin today. It was 31 years ago in 1985 that Microsoft got its start here in Ireland. We were one of the first technology companies, as you may know, to recognize that by coming to Ireland we could not only plant our flag in a place with great talent, but we could work with people here to serve all of Europe. Little did we know that when we made that investment to put our first big data center here in Dublin, we would also eventually become involved in an issue that brings us back here this week and today to launch a new conversation. Little did we know that this data center in Ireland would lead to litigation that would involve a case we filed against our own government, litigation that would be followed by many people across Europe and around the world. Little did we imagine that when we started that case, it would wind its way through the courts, literally taking us years, but little did we know that if we persisted, we would find, as we did this past July, that we would actually win a case that, as Fortune Magazine said, created not just only a good week for Microsoft, but a great one for the cloud. We brought that case because we thought it involved an important principle. We brought that case because we thought it was important to establish that no government through its own unilateral legal process can reach into other people's e-mail located in other parts of the world. We brought that case because we thought it was important to stand up for people globally. And that in many ways is what we wanted to talk about throughout Europe this week. As a company we look at where technology is going, and we believe that we're, in fact, at the dawn of a new Industrial Revolution. And that's why we think it's important before this just continues to go forward at such a rapid pace to ask ourselves, how do we ensure that this cloud not only serves the fortunate few but actually serves the world as a whole? That's what led us to put together our best ideas and share it in a book that we're publishing today. We do this not with a sense that we have all the answers, because we know that we do not. No one has all the answers. But we think that there's certain tenets that will all be served well if we can recognize together. The first is that as promising as all these technologies are, the reality is that with opportunity comes challenges. There are challenges that we see in the world today that are linked to globalization, and they're also linked to technology. Technology is creating new jobs, but automation can challenge and even replace some traditional jobs. There are new challenges to privacy rights. There are new questions about income inequality. There are new opportunities but also challenges for people with disabilities. If we don't acknowledge explicitly at the outset that this new era creates both opportunity and challenge, the truth is we'll do less than what we should to make the most of the promise that lies ahead. We in short need to ensure that we move technology forward without leaving people behind. And that requires that we accept a sense of shared responsibility. Those of us who work in the tech sector, those of us who work in the private sector have an important role and responsibility, as do people across civil society, as do governments around the world. If we're going to come together and do what it takes to make the most of this new era, we need to appreciate what we each can contribute. But we need to work together with some clear goals. From our perspective as a company we see three sets of goals that I'll talk a little bit about today. In the book that we've published we've outlined 78 policy recommendations. And the really good news for all of you is I am not going to read all of them to you this morning. It starts with ensuring that this new era of cloud technology relies on a trusted cloud. As a company Satya articulated our principles about a year ago as he said that we need to focus on security, on privacy, on transparency, and building a cloud that ensures that people can rely on us to secure their compliance with law. It's about ensuring that the kinds of traditional protections that we've all had, not just for years, but for centuries for information that is stored on paper actually persists when we move our information to the cloud. To make that effective, we need to do several things societally and with governments. We need to keep information secure. We need technology that keeps information secure. We need government policy that keeps information secure. We need to address these problems in a way that both acknowledges and ensures that data can move across borders. And there are few places in the world where the global nature of this technology is more apparent than here in Ireland, when you see a company like Microsoft using our data center not only to serve the people of Ireland but to serve the people across Europe and in Africa and in the Middle East. That's why we were so focused as a company on the development of the new Privacy Shield between Europe and the United States. It's why we were the first company to stand up and say that we would certify that our data centers would comply with the new EU Privacy Shield, and it's why we were the first company to then go do the architectural work to make that certification effective Trust has really been in the headlines for three years now. But as we've thought about the issues, we've concluded that, in fact, our needs are a lot broader than trust alone. We need to build a cloud that's responsible as well. We need to build a cloud that respects and protects human rights, even amidst the equally important work to protect public safety. It requires new steps that we all take together to protect people online. It requires new steps that we think about the implications of a cloud-based era for the environment and for sustainability. That's why we as a company announced earlier this year new principles that would guide our work as we go forward. We committed ourselves every year to get better when it comes to our use of renewable energy. We committed to be more transparent. We shared with the world that today 44 percent of the electricity that flows into our data centers comes from renewable energy sources, either solar or wind or hydro. We committed that by 2018 that number will cross the 50 percent threshold, and early in the next decade it will cross the 60 percent threshold, and we will continue to get better and better from there. But we need government policy to focus on this as well. And given the promise of artificial intelligence, this too is an area where laws will need to be modernized. We need laws that promote the use of artificial intelligence, but we need laws that recognize the vital, ethical considerations that need to be at the heart of how we societally move AI forward in the future. If we do a good job in this area, it helps actually I think create the foundation for the third and perhaps the most important issue as well. You can argue that one of the defining issues of the year 2016 is, in fact, one of the defining issues of our time. How do we ensure that we can have innovation and economic growth that is genuinely inclusive. If one wants to have a healthy digital economy one needs to build a learning economy. One needs to start by investing in the skills that the next generation of people will need to succeed, skills like coding, fields like computer science. But one cannot stop with the next generation. We live in a time when many people of all generations are going to be called upon to learn new skills and sometimes find new jobs and even enter new careers. And we need to think about how technology and the private sector and civil society and government can come together to make that easier for people to pursue. Similarly, we need to ensure that this new technology benefits not only companies that are older and larger, but new companies and smaller businesses, as well. We need to ensure that the benefits of technology and economic growth are not confined to people who live in the major metropolitan areas, but that they actually do what they should, they reduce distances and barriers for people who are working in more rural areas. And as we think about inclusion, as we think about the needs of the young and old, as we think about people in cities and in towns, there's another vital group we need to think about, as well. It's people with disabilities. Did you know that there are 1.2 billion people in the world who have some type of disability? There are 300 million people in the world who are visually impaired. There are other people who have other forms of physical disability. There are people who suffer from some kind of cognitive disability. And yet what is amazing about every one of these people is the incredible potential they have to do great things in their lives. We simply must do our best work and we need to take new steps to come together with governments to ensure that technology advances the lives of this vital group. Technology can do amazing things. I think it should inspire us to raise our own ambition. I think we should aspire not only to contribute to scientific knowledge, but to find a cure, to create a day when people who are blind can use technology to see in new ways, when people who cannot walk can benefit from technology to stand on their own two feet. Fundamentally as a company when we think about what this fourth industrial revolution can offer, when we think about the clear goals that come out of creating a cloud that is trusted and responsible and inclusive we know this. Progress will come not by building higher walls, but by constructing broader bridges. We need to construct the kinds of bridges not only between nations, but to the future, that will be broad enough for everyone to move forward. Thank you very much.

Monday, 21 October 2024

Add Resiliency to Your Applications with GitHub Copilot for Visual Studio 2022

let's say you're writing an application that calls out to a web API and that web API crashes find out how you can make your application Not Crash by writing some code with Copilot all right so this is the web application that we're going to make not crash it has a bunch of pizza menus on it and what this does we have one web application calling out to a web API that returns well pizzas and when I go over here and I keep on clicking refresh it refreshes pizza's just fine but what I wanted to do now is go through and introduce an error into my web API that Returns the menu of pizzas so right here as you can see I have just a minimal web API that has returning pizzas and so what I'm going to do here is introduce using some co-pilot to help me out an air so I'm going to type in a comment and I'm just going to say generate a random number between one and two because I can never remember how to use the random number generator all right and it doesn't remember for me between one and two let's see if it does it now all right so how about we just do VAR random equals new random and see if it does it here all right so now we have it then if random number is one I'm going to want to return a 503 error so all I'm doing now is setting up my web API so it returns an error every time that it's a random number generator is number one and if it comes back be number two we're gonna return good so just setting things up any copilot help me out writing that by me prompting it just a little bit all right so I'm going to restart my web application and we're going to go over to the Swagger tooling and see it air out hopefully roughly every other time that we call it coming back up Swagger that's my cart here's my pizzas I'm gonna try it out real quick execute go down here and I did I got a 503 execute 503 and now I got the 200 to come back so it's airing out roughly every now and then so we're implementing some transient errors coming back from our web API and so what I really don't want to have happen then is my web application you can see right here has crash it tried calling out to my web API got that 503 and crashed but if I refresh it eventually it'll come back up like right here because it actually got the good response back so what I want to have happen and this is the key what we're all here today to see is to make sure our web app stays up by implementing some kind of retry policy to try that web app web API again keep on going to that transient error resolves itself oh hey back to the code and so what I want to do then is right here this get menu method is the one that is responsible for calling out to the pizza service to return to menu and so the first thing I'm going to ask is I'm going to actually open up GitHub copilot chat and I'm just going to want to say what's ah good.net Library for doing retries of http error and see what it comes up for me and it says when it's done typing everything poly so I'm going to go through and bring in poly for my packages to my web project browse through the little poly you bet and as it brings it all back in I'm going to jump back over to copilot chat for just a second and it actually is going to show me something pretty neat in that it shows me how to implement knows what I want to try or wait and retry async it's already guessing by where my code is and what it what what it thinks I want to do but I'm going to save here and then I'm going to highlight the code I'm going to right click on it and I'm going to say hey ask Copilot how can I retry this code when an HTTP error occurs copilot thinks about it and then gives me a way to do it so I don't like the way that it just gave me to do it I want to actually use poly to do it so one of these things about when you're using copilot or copilot chat is that you want to Trust but verify the code that it brings back and so what it has here let me open it up just a little bit more is that if it fails three times you know go back you know while retries less than three I want to use poly I want poly to do all the work for me I don't want to have to think about it myself so let's actually do that for us let's try it one more time right click ask Copilot have Ollie create a poly policy to retry when HTTP exception occurs how about that and let's see what a copilot comes up with this time make this a little bit larger so we can see what's going on and then I'll scroll up because I want to get the menu and here we go what I'm going to do is I'm just going to copy this in topic comment on what I had and then put the new one in make sure I actually copy it from the copilot chat happy paste is very hard for me let's see if I can get it now roll C TRL V and here we go and so what it's saying you know what we're gonna try a wait and retry a sync policy first time's gonna be three seconds next time is five one second three five seconds five seconds and then retry and it's saying you know what all the pizzas that might be null here so initially I'm just going to say new list Pizza so again trust but verify so let's start it up and see if what copilot gave us works there were Bill Bears what did I do wrong new expression after the type let's see line 35. have to do my parentheses all right let's go again start everything spins up so let's try our Swagger tooling out try it out let's see we should just be getting 200 values back code 200 we should not see a 503 coming back at all but we or we should still see the 503 coming back from here because we're calling directly to the web API web API is still an error what we shouldn't have happen is our web app should be catching those and continuing on assuming that we don't get three errors in a row looks good so far let's refresh good good still looks like we fixed it all right there we go so you've seen now actually a couple good points here you saw that how we use copilot and GitHub copilot chat to introduce well we how we use it to find a random number and then introduce a random error into our code to return a 503 status code and then how we use copilot chat put in the poly nuget Library so we can have a retry policy inside of our web code to retry whenever our web API blew up but the cool thing that you saw is that sometimes co-pilot and copilot chat aren't 100 correct so you have to trust but verify and we saw that oh what a return the first time wasn't what we thought it would do or was so we went through tried it again and it did give us something that worked better so press but verify sometimes everything's great sometimes you're just on the start of it so anyways at the end of the day we got it working and so there we have it making sure our application can call a web API not fail even when web API on us blows up

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