1 00:00:00,330 --> 00:00:01,332 So I wanna do a couple of things. 2 00:00:01,332 --> 00:00:03,910 I'm gonna jump back and forth between the command line and Visual Studio. 3 00:00:03,910 --> 00:00:07,759 But I wanna make sure that people who don't have Visual Studio understand that 4 00:00:07,759 --> 00:00:11,197 everything I'm doing can be done whether you're on a Mac or a Ubuntu or 5 00:00:11,197 --> 00:00:12,556 whatever makes you happy. 6 00:00:12,556 --> 00:00:18,850 So for example, here I am at the Command Prompt and I typed dotnet new mvc. 7 00:00:18,850 --> 00:00:21,819 I could type dotnet new angular or dotnet new this and that. 8 00:00:21,819 --> 00:00:26,980 And I went and created a web application, so here's my web app. 9 00:00:26,980 --> 00:00:30,921 This is a model view controllers style ASP.NET Core application. 10 00:00:30,921 --> 00:00:35,376 And this is the same web app that I would get if I were to come into 11 00:00:35,376 --> 00:00:41,440 Visual Studio and say, File > New > Project, pick .NET Core and hit OK. 12 00:00:41,440 --> 00:00:45,637 So here I am in another web app that is in Visual Studio. 13 00:00:45,637 --> 00:00:49,385 And I get that same experience, all right? 14 00:00:49,385 --> 00:00:52,390 I just wanna point out, I've got my Controllers and my Views. 15 00:00:52,390 --> 00:00:54,841 I come out to the command line, same kinda thing. 16 00:00:54,841 --> 00:00:58,171 So two different deploys in two different ways. 17 00:00:58,171 --> 00:01:01,122 There's in fact many different ways to deploy your application, but 18 00:01:01,122 --> 00:01:02,680 these are the two most popular ones. 19 00:01:03,880 --> 00:01:09,510 From within Visual Studio, I can right-click and I can say, Publish, okay? 20 00:01:09,510 --> 00:01:13,670 When I say Publish, it pops up this dialog box with a couple of options. 21 00:01:13,670 --> 00:01:18,297 And it's important to point out this arrow here that says I can scroll further 22 00:01:18,297 --> 00:01:19,162 to the right. 23 00:01:19,162 --> 00:01:21,920 If I click on that, I can go all the way to the right. 24 00:01:21,920 --> 00:01:23,814 And you'll notice that we actually hid something there. 25 00:01:23,814 --> 00:01:26,570 We hid Microsoft Azure Virtual Machines. 26 00:01:26,570 --> 00:01:29,120 It's not that we hid it because we don't ever want you to use it. 27 00:01:29,120 --> 00:01:31,395 But it's just not the most popular way to do things. 28 00:01:31,395 --> 00:01:34,304 If you remember that first slide at the beginning, 29 00:01:34,304 --> 00:01:36,730 this is the lowest level way to do things. 30 00:01:36,730 --> 00:01:40,639 Now, if you click on that, we'll make you a virtual machine, we'll set up 31 00:01:40,639 --> 00:01:44,565 a web server, and we will set up publishing, so that you can be successful. 32 00:01:44,565 --> 00:01:47,196 So the result will be a website in the cloud, 33 00:01:47,196 --> 00:01:51,440 except it's on a virtual machine that you are now in charge of. 34 00:01:51,440 --> 00:01:53,810 It's free and wonderful, but it's free like a puppy. 35 00:01:53,810 --> 00:01:55,980 You have to feed it and you have to deal with it. 36 00:01:55,980 --> 00:01:58,284 So be aware that it's there, but 37 00:01:58,284 --> 00:02:02,744 probably not the easiest thing to do if you're a web developer. 38 00:02:02,744 --> 00:02:04,740 I could also publish, of course, to a folder. 39 00:02:05,820 --> 00:02:08,174 I could publish to a local web server or 40 00:02:08,174 --> 00:02:12,083 even use FTP if I do insist on using cheap or commodity hosting. 41 00:02:12,083 --> 00:02:15,295 What I'm gonna do is I'm gonna click Microsoft Azure App Service. 42 00:02:17,310 --> 00:02:21,466 I can select an existing App Service if I've already made one in the Azure portal. 43 00:02:21,466 --> 00:02:25,192 But I'm just gonna sit here in Visual Studio and say Create New and 44 00:02:25,192 --> 00:02:26,283 then hit Publish. 45 00:02:26,283 --> 00:02:28,640 Now up here it's saying enter your credentials. 46 00:02:28,640 --> 00:02:34,823 I'll actually reenter my credentials, mine have expired. 47 00:02:34,823 --> 00:02:38,941 And when I log in, I'm just using my same login that I use for Azure. 48 00:02:49,860 --> 00:02:53,672 So as we log in, it's going off and getting my subscriptions and 49 00:02:53,672 --> 00:02:55,372 my information from Azure. 50 00:02:55,372 --> 00:02:59,113 You see here, now it's gonna find out what active subscriptions I have. 51 00:02:59,113 --> 00:03:00,841 I can use my 3-month free trial, and 52 00:03:00,841 --> 00:03:03,810 you could certainly do that as well if you signed up for one. 53 00:03:03,810 --> 00:03:08,877 But I also have an MSDN or a Microsoft Developer subscription account, 54 00:03:08,877 --> 00:03:10,573 so I'm gonna use that. 55 00:03:10,573 --> 00:03:12,970 And then I can create what's called a resource group, 56 00:03:12,970 --> 00:03:14,280 or I can pick an existing one. 57 00:03:14,280 --> 00:03:16,678 A resource group is really just, 58 00:03:16,678 --> 00:03:20,713 imagine I draw a dotted line around a bunch of websites. 59 00:03:20,713 --> 00:03:23,990 If I have one website, well then, I just have a box around one of them. 60 00:03:23,990 --> 00:03:27,650 But if I was gonna make the great new American startup, I might have five or 61 00:03:27,650 --> 00:03:28,426 ten websites. 62 00:03:28,426 --> 00:03:30,820 I'm gonna draw a line around them and I'll name them. 63 00:03:30,820 --> 00:03:34,644 And I'll be able to refer to them as a group of resources. 64 00:03:34,644 --> 00:03:36,920 Then an App Service plan, now this is a little confusing, 65 00:03:36,920 --> 00:03:39,760 because you've got some codes here that don't quite make sense. 66 00:03:39,760 --> 00:03:42,071 You've got F1 and S1. 67 00:03:42,071 --> 00:03:44,750 F is for free, so that is a free. 68 00:03:44,750 --> 00:03:49,745 And there's 1, 2, 3, 4, this is number 1, this is the basic free account.. 69 00:03:49,745 --> 00:03:53,279 I have a standard account, and I can go and make one from here as well. 70 00:03:53,279 --> 00:03:56,588 If you go here, you can see the codes. 71 00:03:56,588 --> 00:04:02,260 S1 is a standard virtual machine with 1 core and about 2 GB of RAM. 72 00:04:02,260 --> 00:04:05,915 And then P is for performance, and those are bigger, stronger, 73 00:04:05,915 --> 00:04:08,183 faster and of course, more expensive. 74 00:04:08,183 --> 00:04:10,110 Now B is for basic. 75 00:04:10,110 --> 00:04:13,960 The difference between standard and basic is load balancing and backup and 76 00:04:13,960 --> 00:04:16,120 some of the more advanced features. 77 00:04:16,120 --> 00:04:18,932 Free is a little slow for my taste. 78 00:04:18,932 --> 00:04:20,830 I would recommend people try Shared or B1. 79 00:04:22,220 --> 00:04:24,741 Here we are now, we're talking about virtual machines, 80 00:04:24,741 --> 00:04:26,138 that can be a little confusing. 81 00:04:26,138 --> 00:04:28,670 Didn't he tell us we weren't gonna talk about those? 82 00:04:28,670 --> 00:04:32,673 This is where, it'll save you money, and it'll make you a better developer, 83 00:04:32,673 --> 00:04:35,858 if you understand that there is a virtual machine underneath. 84 00:04:35,858 --> 00:04:37,230 How do you best utilize that? 85 00:04:37,230 --> 00:04:41,692 So for example, I'm gonna pick DefaultServerFarm, S1, 86 00:04:41,692 --> 00:04:47,564 a standard virtual machine, and we are reminded that it has almost 2 GB of RAM. 87 00:04:47,564 --> 00:04:51,033 I don't need 2 GB of RAM for my website. 88 00:04:51,033 --> 00:04:53,067 I don't, it's overkill. 89 00:04:53,067 --> 00:04:57,080 But that doesn't mean one App Service plan equals one web app. 90 00:04:57,080 --> 00:04:59,174 In fact, I can have hundreds. 91 00:04:59,174 --> 00:05:04,056 I can have as many web apps in my App Service plan as I have the memory to 92 00:05:04,056 --> 00:05:04,580 do it. 93 00:05:05,610 --> 00:05:08,721 Now, if I were doing free, that doesn't make any sense. 94 00:05:08,721 --> 00:05:10,050 It's really one to one. 95 00:05:10,050 --> 00:05:14,938 Shared means I'm on a computer or a virtual machine with somebody else. 96 00:05:14,938 --> 00:05:17,930 But even with a basic, you can have dozens and dozens of websites. 97 00:05:17,930 --> 00:05:22,740 So in your experience, as you move through all of the great Treehouse tutorials, 98 00:05:22,740 --> 00:05:25,613 make a Basic 1, make a Basic 2, and use those. 99 00:05:25,613 --> 00:05:30,052 And then, put all of your samples and all of the things that you're gonna build as 100 00:05:30,052 --> 00:05:33,920 you go through this experience with us, in the same App Service plan. 101 00:05:33,920 --> 00:05:37,025 So I'm using the same resource group and the same App Service plan. 102 00:05:37,025 --> 00:05:40,510 And I can name my web application whatever makes me happy. 103 00:05:41,610 --> 00:05:46,125 So now I'm gonna hit Create, Now if I had clicked Services, 104 00:05:46,125 --> 00:05:49,429 that's where I could sign up for things like a SQL Server and a database. 105 00:05:49,429 --> 00:05:53,390 And that would be something that would be the back end for my application. 106 00:05:53,390 --> 00:05:58,752 I also could have clicked change type and selected a mobile app or an API app. 107 00:05:58,752 --> 00:06:01,670 And there's all kinds of great stuff you can make with Azure App Service. 108 00:06:01,670 --> 00:06:05,205 But in this case, we're just gonna make a web application. 109 00:06:05,205 --> 00:06:07,101 So now it's setting up your profile. 110 00:06:07,101 --> 00:06:11,240 And your profile is all of the stuff that you need in order to publish. 111 00:06:11,240 --> 00:06:13,302 And you can import and export profiles. 112 00:06:13,302 --> 00:06:15,397 You can give profiles to someone. 113 00:06:15,397 --> 00:06:19,374 You'll notice earlier, when we clicked Publish, there was an option for 114 00:06:19,374 --> 00:06:20,331 import profile. 115 00:06:20,331 --> 00:06:24,476 That's a way for you to securely and safely pass around your passwords, and 116 00:06:24,476 --> 00:06:28,494 the ability to publish to your web application without giving people your 117 00:06:28,494 --> 00:06:30,220 Microsoft login. 118 00:06:30,220 --> 00:06:34,869 Now you notice here that we did a build, and now it's doing a publish. 119 00:06:34,869 --> 00:06:36,157 It's adding directories. 120 00:06:36,157 --> 00:06:39,241 It's sending information up to Azure right now. 121 00:06:39,241 --> 00:06:44,342 [SOUND] And now, I didn't do that, it automatically launched the browser. 122 00:06:44,342 --> 00:06:47,191 And notice that it put it at my funky URL. 123 00:06:47,191 --> 00:06:51,520 Now the funky URL doesn't really matter, that's an automatically generated URL. 124 00:06:51,520 --> 00:06:55,762 I'm gonna probably register a domain and then point it at that funky URL. 125 00:06:55,762 --> 00:06:57,810 So I'll never really see that again. 126 00:06:57,810 --> 00:06:59,736 So don't get too hung up on that. 127 00:06:59,736 --> 00:07:01,107 And there you go, 128 00:07:01,107 --> 00:07:07,150 I've got an ASP.NET Core application running in the cloud at this funky URL. 129 00:07:07,150 --> 00:07:12,465 And then I could go and set up my DNS, my domain name services and point my 130 00:07:12,465 --> 00:07:19,210 super sample application.teamtreehouse.com to my application and we'll be all set. 131 00:07:19,210 --> 00:07:22,430 However, I did use Visual Studio. 132 00:07:22,430 --> 00:07:24,283 Some of you may not be using Visual Studio, 133 00:07:24,283 --> 00:07:26,921 so we're gonna show you how to do that from the command line. 134 00:07:26,921 --> 00:07:29,940 But I just wanna remind you, again, you can have different profiles. 135 00:07:29,940 --> 00:07:34,824 And one of the other things to be thinking about is you could have dev and test and 136 00:07:34,824 --> 00:07:35,493 staging. 137 00:07:35,493 --> 00:07:39,350 You could have multiple Azure websites for one application. 138 00:07:39,350 --> 00:07:43,100 So here I've got funky URL, but I could have dev, test, staging. 139 00:07:43,100 --> 00:07:47,240 Create another published target, then I might wanna publish this to staging, 140 00:07:47,240 --> 00:07:51,396 test it out, have my friends look at it, and then switch it over to production. 141 00:07:51,396 --> 00:07:52,890 I can do that really easily. 142 00:07:52,890 --> 00:07:56,916 Or I can import a profile that someone else gave me, like this. 143 00:07:56,916 --> 00:08:00,860 That hides all of your passwords and all the information that you need. 144 00:08:00,860 --> 00:08:03,222 And I also want to point out configuration. 145 00:08:03,222 --> 00:08:05,562 I'm doing my work here in debug mode. 146 00:08:05,562 --> 00:08:10,440 You might want to send debug up for staging and then release into production, 147 00:08:10,440 --> 00:08:12,090 totally up to you. 148 00:08:12,090 --> 00:08:14,943 But you also get all these information here. 149 00:08:14,943 --> 00:08:16,957 Wanna point this out, if I say View Details, 150 00:08:16,957 --> 00:08:20,040 I click Web Publish Activity go to View Details. 151 00:08:20,040 --> 00:08:21,711 If anything went wrong, 152 00:08:21,711 --> 00:08:25,616 I could see that here in the logs as it sends those files up. 153 00:08:25,616 --> 00:08:27,287 And of course, nothing did go wrong. 154 00:08:27,287 --> 00:08:28,620 We had a successful publish.