1 00:00:00,000 --> 00:00:04,806 [MUSIC] 2 00:00:04,806 --> 00:00:08,657 Hi friends, I'm Scott Hanselman, I work at Microsoft on ASP.NET Core and 3 00:00:08,657 --> 00:00:10,360 open source .NET Core. 4 00:00:10,360 --> 00:00:15,261 And I'm gonna show you Azure App Service, and we're gonna talk about deploying or 5 00:00:15,261 --> 00:00:18,355 publishing an ASP.NET Core application to Azure. 6 00:00:18,355 --> 00:00:22,000 Now there's a lot of stuff going on in Azure and it can be kind of confusing. 7 00:00:22,000 --> 00:00:26,887 So I'm gonna try to explain the difference between when you hear PaaS, 8 00:00:26,887 --> 00:00:31,129 Platform as a Service or IaaS, Infrastructure as a Service. 9 00:00:31,129 --> 00:00:32,640 You know, what is App Service? 10 00:00:32,640 --> 00:00:34,340 How do you get a website up into the cloud? 11 00:00:34,340 --> 00:00:38,306 And, how is that different from just setting up a virtual machine somewhere and 12 00:00:38,306 --> 00:00:39,619 then publishing to that? 13 00:00:39,619 --> 00:00:45,080 I also wanna point people to try.azurewewbsites.net. 14 00:00:45,080 --> 00:00:48,830 If you don't have an Azure account and you're not really interested in doing 15 00:00:48,830 --> 00:00:52,180 a trial but you still are interested in following along or 16 00:00:52,180 --> 00:00:55,720 trying out Azure App Service, you can do it up there without a credit card and 17 00:00:55,720 --> 00:00:58,520 it gives you a time-limited App Service. 18 00:00:58,520 --> 00:01:01,450 Basically, it gives you a couple of hours of App Service. 19 00:01:01,450 --> 00:01:06,466 You can go in here, you can pick your Web App, you can say I want ASP.NET Core 1.0, 20 00:01:06,466 --> 00:01:09,822 pick Node, pick Java, whatever makes you happy. 21 00:01:09,822 --> 00:01:12,700 And then go and create that and it will just let you sign in, 22 00:01:12,700 --> 00:01:17,810 you can use your GitHub, use your Google+, and will make you a little tiny free 23 00:01:17,810 --> 00:01:21,020 website that you can then play with and it'll expire in a couple of hours. 24 00:01:21,020 --> 00:01:23,314 So it's a nice no money, no effort, 25 00:01:23,314 --> 00:01:26,890 no commitment way to try out Azure App Service. 26 00:01:26,890 --> 00:01:28,260 All right, so let's do this. 27 00:01:28,260 --> 00:01:30,064 I'm gonna just pop over here to PowerPoint. 28 00:01:30,064 --> 00:01:33,134 Cuz I know that we all love to see PowerPoint when we're learning about code 29 00:01:33,134 --> 00:01:35,340 but trust me, it'll be short and it'll be worth it. 30 00:01:36,400 --> 00:01:40,660 These are some of the things that you get when you come to Azure. 31 00:01:40,660 --> 00:01:44,520 This is the standard boxes and lines dialog, boxes and 32 00:01:44,520 --> 00:01:46,280 lines slides that people see. 33 00:01:46,280 --> 00:01:50,914 Azure Storage, that's that global storage, it's like a disk for everybody that's up 34 00:01:50,914 --> 00:01:55,020 there in the Internet, is the base of Azure, that where everything happens. 35 00:01:55,020 --> 00:01:58,964 So when you make a virtual machine in Azure, when you go into Azure and 36 00:01:58,964 --> 00:02:03,656 you do File > New Virtual Machine, that virtual machine gets stored somewhere, 37 00:02:03,656 --> 00:02:05,890 it gets put in Azure Storage. 38 00:02:05,890 --> 00:02:08,250 Now there are other boxes that we're not gonna talk about, 39 00:02:08,250 --> 00:02:10,230 we're gonna talk about web sites, right? 40 00:02:10,230 --> 00:02:13,250 Azure App Service, where you're gonna put your web site. 41 00:02:13,250 --> 00:02:17,403 That of course sits on a virtual machine, right? 42 00:02:17,403 --> 00:02:19,990 A virtual machine has to be there always, right? 43 00:02:19,990 --> 00:02:24,480 And a virtual machine, of course, lives on a physical machine that is, in this case 44 00:02:24,480 --> 00:02:30,030 though, hidden from you by Azure, and your disk is hidden from you by Azure Storage. 45 00:02:30,030 --> 00:02:34,830 So there’s a series of kind of what we call lies or layers of abstraction 46 00:02:34,830 --> 00:02:39,393 between you and the real metal, but that’s the magic of the cloud. 47 00:02:39,393 --> 00:02:44,244 And that is really the difference between a cloud-based host like Azure and 48 00:02:44,244 --> 00:02:46,762 your more cheaper commodity hosting. 49 00:02:48,120 --> 00:02:49,740 One way to look at it is, 50 00:02:49,740 --> 00:02:55,000 if I use a host in my local city I can visit my computer, right? 51 00:02:55,000 --> 00:03:00,040 You could go and buy a cheap host and then go downtown, find that computer, 52 00:03:00,040 --> 00:03:03,950 and find the disk that your site is running on. 53 00:03:03,950 --> 00:03:08,140 You could say, show me my computer, and they would take you into a data center and 54 00:03:08,140 --> 00:03:10,290 point to it, and they'd say there it is. 55 00:03:10,290 --> 00:03:14,113 That's nice because you can feel good about your disk and you can see it, but 56 00:03:14,113 --> 00:03:17,713 it's also bad because if that disk dies, then your website goes down. 57 00:03:17,713 --> 00:03:22,107 One of the great things about the cloud is that Azure Storage is hiding all of 58 00:03:22,107 --> 00:03:27,150 the complexities of the disk from you and also doing what's called georeplication. 59 00:03:27,150 --> 00:03:32,710 It's putting all of the bytes that you put on a disk, in fact, on three disks. 60 00:03:32,710 --> 00:03:35,400 Your site exists in three places at all times, so 61 00:03:35,400 --> 00:03:38,200 you're guaranteed not to lose your stuff. 62 00:03:38,200 --> 00:03:40,806 That's a really important aspect of publishing to Azure. 63 00:03:40,806 --> 00:03:43,800 And it's one of the many ways that it differs from commodity hosting. 64 00:03:44,860 --> 00:03:47,650 So let's look at it a simpler way, all right? 65 00:03:47,650 --> 00:03:51,670 If I made a virtual machine on Azure, I can really do anything I want to. 66 00:03:51,670 --> 00:03:54,885 I could put .NET on it, .NET Core like we're gonna do today. 67 00:03:54,885 --> 00:03:57,620 But I could put anything, cuz I own it, right? 68 00:03:57,620 --> 00:03:59,800 It's like buying your own home. 69 00:03:59,800 --> 00:04:02,980 You can do whatever crazy stuff you want to inside your home and 70 00:04:02,980 --> 00:04:04,760 that is your right, okay? 71 00:04:04,760 --> 00:04:08,170 But you manage your home, you own it, you manage it. 72 00:04:08,170 --> 00:04:10,845 And if you do something stupid that breaks the house, well, 73 00:04:10,845 --> 00:04:13,371 you're gonna have to fix the house and it's your fault. 74 00:04:13,371 --> 00:04:15,320 It's not Azure's fault. 75 00:04:15,320 --> 00:04:21,140 But some people, they want a more of an Uber or a Airbnb style where, 76 00:04:21,140 --> 00:04:23,930 you know I don't really wanna think about my house or my car. 77 00:04:23,930 --> 00:04:25,680 I just want a website. 78 00:04:25,680 --> 00:04:27,000 It does limit you a little bit. 79 00:04:27,000 --> 00:04:31,200 You can't do anything you want but you can still do .NET and Node and Java and 80 00:04:31,200 --> 00:04:33,340 PHP and Python and on and on. 81 00:04:33,340 --> 00:04:38,630 But then Azure will manage the operating system for you, manage all of the updates. 82 00:04:38,630 --> 00:04:43,610 So if something comes out like a new bad bug with a creative name, you don't 83 00:04:43,610 --> 00:04:47,240 have to wake up in the middle of the night and go and patch your virtual machine. 84 00:04:47,240 --> 00:04:51,342 Just as if your roof starts leaking, you don't have to get on the roof, right? 85 00:04:51,342 --> 00:04:52,086 You're gonna go and 86 00:04:52,086 --> 00:04:54,960 you're gonna call the landlord and let them deal with that for you. 87 00:04:54,960 --> 00:04:58,500 So that's another way that this differs from commodity hosting, 88 00:04:58,500 --> 00:05:01,270 is that Azure handles stuff for you. 89 00:05:01,270 --> 00:05:04,480 You're a web developer, not a homeowner, and 90 00:05:04,480 --> 00:05:08,270 you'd really like just to think about your web application and run it up there. 91 00:05:08,270 --> 00:05:13,070 So let's do that and see some of the secrets of how that works. 92 00:05:13,070 --> 00:05:17,110 But also, let's remind ourselves that no matter what we do up here in the web site 93 00:05:17,110 --> 00:05:21,040 world, there is always a virtual machine underneath us. 94 00:05:21,040 --> 00:05:22,600 Just as when you rent a house, 95 00:05:22,600 --> 00:05:25,660 there is a landlord out there that has to think about that house. 96 00:05:25,660 --> 00:05:28,920 So you'll be a better developer and you'll be a smarter developer, 97 00:05:28,920 --> 00:05:33,090 if you can live in both worlds and understand that both worlds exist.