WEBVTT

00:00.020 --> 00:00.350
Okay.

00:00.350 --> 00:06.260
What we're going to take a look at now is the publishing platform that we are going to publish our application

00:06.290 --> 00:07.040
onto.

00:07.070 --> 00:09.320
Now we're going to use Azure for this.

00:09.320 --> 00:13.520
And Azure sounds expensive, but it isn't really.

00:13.520 --> 00:16.400
And there is free options that you can use.

00:16.400 --> 00:20.120
So just search for Azure and we'll go to the Azure link.

00:20.120 --> 00:27.350
And whilst it can be expensive there like I mentioned, there's also free options that we can use.

00:27.350 --> 00:32.120
And what we'll use to publish our application is their free services.

00:32.120 --> 00:38.570
And if we take a look at the pricing options in Azure before we go any further, then we've got some

00:38.570 --> 00:41.060
free Azure services we can look at.

00:41.090 --> 00:46.820
Now some of them are free for a specific time, and some of them are always free.

00:46.820 --> 00:49.100
So there's two groups as they mentioned here.

00:49.100 --> 00:50.900
Some are free for the first 12 months.

00:50.900 --> 00:52.430
That's to get you started.

00:52.430 --> 00:55.910
And 65 other services are free always.

00:55.910 --> 00:58.880
Now let's take a look at what we're going to use inside here.

00:58.880 --> 01:01.850
We're going to be using an Azure SQL database.

01:01.850 --> 01:04.620
And this is in the free always category.

01:04.620 --> 01:09.210
But there are some significant limitations with this.

01:09.660 --> 01:16.740
100,000 V core seconds sounds like a lot, but it's actually a day and a half, maybe two days at most

01:16.770 --> 01:18.540
of full time usage.

01:18.690 --> 01:25.860
Now, when your SQL server database is not being queried, then it goes into a pause mode that doesn't

01:25.860 --> 01:27.210
count towards those seconds.

01:27.210 --> 01:33.150
So technically, if it's really lightweight and you're just using it for testing as we're doing on this

01:33.150 --> 01:35.970
training course, then that will be fine.

01:35.970 --> 01:40.680
You'll be able to test our production worthy application free of charge, no charge.

01:40.680 --> 01:46.980
And there's no once the 100,000 seconds has gone, then they start charging you.

01:47.010 --> 01:52.170
They'll just literally stop the database from working until the following calendar month.

01:52.170 --> 01:57.360
So that guarantees that you will not pay anything for Azure if you use this option.

01:57.360 --> 01:59.670
Now you're only allowed one of these.

01:59.670 --> 02:02.100
You're not allowed two, three, four or whatever.

02:02.130 --> 02:03.510
Only one.

02:03.720 --> 02:08.490
So it's not great, but it will allow us to test our database free of charge.

02:08.520 --> 02:15.090
Also, what you get if you've not signed up to Azure before, is you will get free credits that you

02:15.090 --> 02:16.650
can use during the first month.

02:16.650 --> 02:21.870
I think it's $200 or whatever, but we're not touching anything that costs money.

02:21.900 --> 02:27.570
Well, I'll have to because I've already used up my free Azure SQL database, so I'll have to use a

02:27.570 --> 02:31.140
paid for version, but you will have the option to use a free one.

02:31.170 --> 02:37.020
What we're also going to use is the Azure App Service, which is also free always.

02:37.080 --> 02:44.580
And this allows us up to ten web, mobile or API apps with one gig of storage and one hour per day.

02:44.610 --> 02:51.930
Again, limitations are in place on this as well, but it will adequately allow us to test our application

02:51.930 --> 02:53.610
on a production platform.

02:53.640 --> 02:58.860
Now, once upon a time, there were three sort of genuinely free services that we could use without

02:58.860 --> 03:04.890
providing a credit card and just providing our email address and verifying our email.

03:04.920 --> 03:11.610
Those services are gone And you can thank crypto miners for that, who used and abused every free service

03:11.610 --> 03:13.800
out there for their processing time.

03:13.800 --> 03:17.640
And these companies have just put a stop to it now.

03:17.670 --> 03:22.860
There's no such thing where we could deploy our app and it would be always online.

03:22.890 --> 03:30.750
Not high performance, but it would be online, working 24 hours a day, 365 days a year without us

03:30.750 --> 03:31.740
paying anything.

03:31.770 --> 03:34.830
They're all gone now, so we have to use something else.

03:34.830 --> 03:40.710
And Azure is probably the best compromise I've found, because it's not a platform that's going to suddenly

03:40.710 --> 03:42.330
change everything overnight.

03:42.330 --> 03:48.450
It's pretty stable, pretty mature, and it is a production worthy platform to host our application.

03:48.450 --> 03:52.020
So we're going to take a look at how we can deploy our code to this.

03:52.020 --> 03:55.680
And because it's a Microsoft owned platform, that means deploying a.

03:55.860 --> 03:58.440
Net application is supported.

03:58.440 --> 04:03.690
We don't need to dockerize our dotnet application to get it deployed onto Azure.

04:03.720 --> 04:11.690
So the first step is to either create an account or to sign in if you already have an account.

04:11.690 --> 04:17.540
So I'm going to go ahead and sign in, and then I'll pick up this registration after I've gone through

04:17.540 --> 04:19.070
the sign in process.

04:19.100 --> 04:23.960
Once you're into Azure, you should be presented with something that looks similar to this.

04:23.990 --> 04:29.810
Obviously I've used this before, so I've got several resources listed inside here.

04:29.810 --> 04:35.540
But for what we're doing, we're going to constrain all of our resources we're using inside a resource

04:35.540 --> 04:35.960
group.

04:35.960 --> 04:42.860
So click on Resource Groups and then click create to create a resource group specifically for the projects

04:42.860 --> 04:44.120
that we're working on.

04:44.150 --> 04:48.950
Now depending on your subscription you might see something different to myself here.

04:49.340 --> 04:51.020
I've got a pay as you go account.

04:51.050 --> 04:52.430
So that's what I'm going to be using.

04:52.430 --> 04:59.570
And the resource group I'm going to set it to restore RG.

05:00.230 --> 05:04.730
And I'm just going to say V2 so that it's different to anything that I've created before.

05:04.730 --> 05:13.290
And just pick a region closest to yourself to ensure you don't have too much latency between yourself,

05:13.320 --> 05:16.620
your developer machine, and where this is being hosted.

05:16.620 --> 05:20.220
So I'm just going to pick Southeast Asia because that's where I'm currently residing.

05:20.220 --> 05:22.770
And I'll click Review and Create.

05:22.770 --> 05:29.190
And this goes ahead and creates this resource group after we click the create button.

05:29.190 --> 05:34.530
And great, now it has been created, we can click the button to go to the resource group.

05:34.530 --> 05:40.560
And then inside here we can create resources specific for this particular application.

05:40.560 --> 05:44.070
So the first thing I'm going to create I'll click the create button.

05:44.100 --> 05:49.920
We'll get taken to the marketplace and plenty of different options inside here.

05:49.920 --> 05:57.660
And what we want to look for is an app service which is no longer on the front screen or web app.

05:57.690 --> 06:01.140
Actually, to be more specific, that's what we want to create here.

06:01.230 --> 06:02.430
So we'll have to search for it.

06:02.430 --> 06:07.650
So I'm just going to search the marketplace for web app.

06:08.880 --> 06:12.210
And we're going to select this one web app.

06:12.210 --> 06:15.790
And we'll click create and click Web App.

06:16.840 --> 06:19.720
And then it takes us to a form that we can complete.

06:20.560 --> 06:25.240
So the Azure subscription for me might be free trial for yourself.

06:25.270 --> 06:28.990
The resource group we're going to put it inside the one we've just created.

06:29.020 --> 06:34.630
The web app name is going to be the address our URL for our published application.

06:34.630 --> 06:41.650
So I'm going to take a look to see if I can use something like Resource or Restore course.

06:41.650 --> 06:46.150
And I don't like that.

06:47.350 --> 06:54.130
Let's see if I uncheck this then it's going to give me just restore course dot Azurewebsites.

06:54.310 --> 06:54.580
Net.

06:54.610 --> 06:55.930
It will need to be unique.

06:55.960 --> 07:00.820
You won't be able to use this same one as myself, because this is going to be the address where mine

07:00.820 --> 07:01.690
is hosted.

07:01.690 --> 07:07.420
If you enable this then it's going to give you something unique by default, but it's going to be a

07:07.420 --> 07:11.200
pretty ugly URL, so feel free to experiment with this.

07:11.230 --> 07:13.390
What we're going to publish is our code.

07:13.390 --> 07:13.750
It's a.

07:13.900 --> 07:15.010
Net application.

07:15.010 --> 07:17.370
And then we can select a runtime stack.

07:17.370 --> 07:20.070
And we're going for dotnet nine.

07:20.070 --> 07:24.600
And because it's a Microsoft platform I'm going to select windows.

07:24.600 --> 07:30.450
And then the region I'm going to select the same region that I selected for the resource group.

07:30.450 --> 07:32.190
Just keep everything the same.

07:32.220 --> 07:35.580
Otherwise you might experience latency issues.

07:35.580 --> 07:37.170
Then we get the pricing plan.

07:37.200 --> 07:39.450
Now we want to choose the free plan.

07:39.480 --> 07:48.690
So let's take a look and we can use and I've got other ones from other resource groups inside here.

07:48.690 --> 07:55.950
So we'll create a new one and we'll call it restore Dash v2.

07:55.950 --> 07:57.240
Or at least I will.

07:57.240 --> 07:59.940
And I'm okay to select this.

07:59.940 --> 08:01.530
So I'll click okay.

08:01.530 --> 08:04.110
And then we can select a pricing plan.

08:04.110 --> 08:11.610
And if we click the drop down then we can select the free F1 plan which costs zero per month.

08:11.610 --> 08:14.730
So be careful please when you're using these forms.

08:14.730 --> 08:19.600
And make sure you don't get caught out with their default selections, which is always going to be a

08:19.600 --> 08:20.860
paid for option.

08:20.860 --> 08:24.220
And then we can click Review and Create.

08:24.220 --> 08:26.380
And this is going to create our web app.

08:26.380 --> 08:29.230
And we'll click the create button.

08:29.230 --> 08:32.980
And this might take a moment to create our web application.

08:32.980 --> 08:37.990
So I'll come back and pick up once this has deployed and been created.

08:37.990 --> 08:41.530
And once it has been created we should see something like this.

08:41.530 --> 08:43.930
And we can click the go to resource button.

08:43.930 --> 08:47.110
And this will take us to our web application.

08:47.110 --> 08:52.780
And what this should give us is a link that we can click on to go and view our website as it is right

08:52.780 --> 08:53.170
now.

08:53.170 --> 08:54.880
And we haven't deployed any code to this.

08:54.880 --> 08:58.360
So I'm just going to right click the default domain and open in a new tab.

08:58.360 --> 09:04.120
And what this will display is the default page for a web app that doesn't have any code deployed to

09:04.150 --> 09:04.660
it.

09:04.660 --> 09:06.730
So that's working just fine.

09:07.030 --> 09:11.830
And what we'll also create if we go back to our resource group.

09:12.790 --> 09:19.560
And Azure is a busy, busy platform with many, many different links to click on.

09:19.560 --> 09:23.310
And how do I get back to my resource group from here?

09:23.670 --> 09:32.610
Doesn't appear to be a way, so I'll go to restore RG v2, and we can see our assets that we have inside

09:32.610 --> 09:33.780
this resource group.

09:33.780 --> 09:40.560
And next I'll create the database or database server.

09:40.560 --> 09:42.270
So I'm going to click create.

09:42.270 --> 09:44.910
And we need to look for SQL.

09:45.210 --> 09:50.070
And I'll select SQL database because that's what we need.

09:50.070 --> 09:56.640
And if we don't have a SQL server already it will create one at the same time as part of this form.

09:56.640 --> 10:02.310
So I want a SQL database and I'm going to click create SQL database.

10:03.210 --> 10:09.030
Now this is where things might be slightly different for myself to yourself, because I'm not going

10:09.060 --> 10:14.310
to see the pop up that asks me if I want to use a free SQL server.

10:14.340 --> 10:19.800
There will be a point as we go through this form where you can choose to create that free one that I

10:19.800 --> 10:23.140
was referring to when we were looking at the pricing.

10:23.140 --> 10:28.450
So in the resource group this is going to go in restore Rv2.

10:28.540 --> 10:31.600
And then we can give our database a name.

10:31.600 --> 10:34.390
I'll just say restore DB as the name.

10:34.390 --> 10:38.350
And then we can select the server or we can create a new server.

10:38.380 --> 10:46.870
Now if you select Create New then what should pop up around about this time is the option to use that

10:46.870 --> 10:49.120
free one that I was referring to.

10:49.150 --> 10:54.460
And I'm not actually going to create a new server for this.

10:54.490 --> 10:55.420
In fact, I will.

10:55.450 --> 10:56.770
I can always change it later.

10:56.770 --> 11:01.600
I'll demonstrate as closely as possible to what I'm asking you to do.

11:01.600 --> 11:10.840
So I'm going to pick the location the same as where the application is being deployed to, as our web

11:10.870 --> 11:15.850
app is going to be communicating with our database on a continuous basis.

11:15.850 --> 11:19.300
So to reduce latency, you do want this in the same location.

11:19.300 --> 11:20.920
We need to give this a unique server name.

11:20.920 --> 11:26.930
So I'm going to say restore Dash That v2, SQL and location.

11:26.930 --> 11:35.180
And then as far as authentication goes, select use SQL server or use SQL authentication.

11:35.180 --> 11:38.630
And we give our server an admin login name.

11:38.630 --> 11:43.220
And I'm just going to say app dash user.

11:44.090 --> 11:49.730
And then give it a password and make this password secure.

11:49.760 --> 11:55.730
So do note it down locally to yourself because you will need to use this inside your connection string.

11:55.760 --> 12:00.410
I'm just going to go for a simple one, because I'm going to dispose of this server anyway soon.

12:00.620 --> 12:05.240
And I don't want to blur things out if I can avoid it.

12:05.240 --> 12:07.340
So I'm going to click okay.

12:07.820 --> 12:10.700
And this is going to create the SQL server.

12:11.390 --> 12:13.430
Do we want to use SQL Elastic Pool?

12:13.430 --> 12:20.660
I'm going to say no we're going to use development workload and then the Compute plus storage.

12:20.690 --> 12:24.260
Again if you're using the free version you don't need to worry about this.

12:24.260 --> 12:27.160
But this one's going to be probably expensive.

12:27.160 --> 12:33.370
So I'm going to configure the database and I'm going to pick the cheapest possible option.

12:33.370 --> 12:36.970
And this one is fairly cheap I guess.

12:36.970 --> 12:38.800
But let's see.

12:39.610 --> 12:43.270
I'm sure there's a basic option.

12:43.360 --> 12:47.500
And I think this is as cheap as we can get it for SQL server.

12:47.500 --> 12:55.270
So I'm going to apply this and just have locally redundant backup storage.

12:55.330 --> 12:58.210
And I think that's about as small as I can get it.

12:58.210 --> 13:03.850
So I'm going to review and create and click create.

13:04.720 --> 13:06.790
And it's underway.

13:06.790 --> 13:10.690
So once again I'll pause the video and come back once this has completed.

13:10.690 --> 13:13.780
And once that has been created you should see something like this.

13:13.780 --> 13:17.620
And then we can go to our resource and we can see our database.

13:17.620 --> 13:20.500
Now we've got a bit of configuration to go with this.

13:20.500 --> 13:25.180
We need to tell our web application about our connection string for our database.

13:25.180 --> 13:28.600
And we'll take a look at our configuration for this next.
