Okay.
What we're going to take a look at now is the publishing platform that we are going to publish our application
onto.
Now we're going to use Azure for this.
And Azure sounds expensive, but it isn't really.
And there is free options that you can use.
So just search for Azure and we'll go to the Azure link.
And whilst it can be expensive there like I mentioned, there's also free options that we can use.
And what we'll use to publish our application is their free services.
And if we take a look at the pricing options in Azure before we go any further, then we've got some
free Azure services we can look at.
Now some of them are free for a specific time, and some of them are always free.
So there's two groups as they mentioned here.
Some are free for the first 12 months.
That's to get you started.
And 65 other services are free always.
Now let's take a look at what we're going to use inside here.
We're going to be using an Azure SQL database.
And this is in the free always category.
But there are some significant limitations with this.
100,000 V core seconds sounds like a lot, but it's actually a day and a half, maybe two days at most
of full time usage.
Now, when your SQL server database is not being queried, then it goes into a pause mode that doesn't
count towards those seconds.
So technically, if it's really lightweight and you're just using it for testing as we're doing on this
training course, then that will be fine.
You'll be able to test our production worthy application free of charge, no charge.
And there's no once the 100,000 seconds has gone, then they start charging you.
They'll just literally stop the database from working until the following calendar month.
So that guarantees that you will not pay anything for Azure if you use this option.
Now you're only allowed one of these.
You're not allowed two, three, four or whatever.
Only one.
So it's not great, but it will allow us to test our database free of charge.
Also, what you get if you've not signed up to Azure before, is you will get free credits that you
can use during the first month.
I think it's $200 or whatever, but we're not touching anything that costs money.
Well, I'll have to because I've already used up my free Azure SQL database, so I'll have to use a
paid for version, but you will have the option to use a free one.
What we're also going to use is the Azure App Service, which is also free always.
And this allows us up to ten web, mobile or API apps with one gig of storage and one hour per day.
Again, limitations are in place on this as well, but it will adequately allow us to test our application
on a production platform.
Now, once upon a time, there were three sort of genuinely free services that we could use without
providing a credit card and just providing our email address and verifying our email.
Those services are gone And you can thank crypto miners for that, who used and abused every free service
out there for their processing time.
And these companies have just put a stop to it now.
There's no such thing where we could deploy our app and it would be always online.
Not high performance, but it would be online, working 24 hours a day, 365 days a year without us
paying anything.
They're all gone now, so we have to use something else.
And Azure is probably the best compromise I've found, because it's not a platform that's going to suddenly
change everything overnight.
It's pretty stable, pretty mature, and it is a production worthy platform to host our application.
So we're going to take a look at how we can deploy our code to this.
And because it's a Microsoft owned platform, that means deploying a.
Net application is supported.
We don't need to dockerize our dotnet application to get it deployed onto Azure.
So the first step is to either create an account or to sign in if you already have an account.
So I'm going to go ahead and sign in, and then I'll pick up this registration after I've gone through
the sign in process.
Once you're into Azure, you should be presented with something that looks similar to this.
Obviously I've used this before, so I've got several resources listed inside here.
But for what we're doing, we're going to constrain all of our resources we're using inside a resource
group.
So click on Resource Groups and then click create to create a resource group specifically for the projects
that we're working on.
Now depending on your subscription you might see something different to myself here.
I've got a pay as you go account.
So that's what I'm going to be using.
And the resource group I'm going to set it to restore RG.
And I'm just going to say V2 so that it's different to anything that I've created before.
And just pick a region closest to yourself to ensure you don't have too much latency between yourself,
your developer machine, and where this is being hosted.
So I'm just going to pick Southeast Asia because that's where I'm currently residing.
And I'll click Review and Create.
And this goes ahead and creates this resource group after we click the create button.
And great, now it has been created, we can click the button to go to the resource group.
And then inside here we can create resources specific for this particular application.
So the first thing I'm going to create I'll click the create button.
We'll get taken to the marketplace and plenty of different options inside here.
And what we want to look for is an app service which is no longer on the front screen or web app.
Actually, to be more specific, that's what we want to create here.
So we'll have to search for it.
So I'm just going to search the marketplace for web app.
And we're going to select this one web app.
And we'll click create and click Web App.
And then it takes us to a form that we can complete.
So the Azure subscription for me might be free trial for yourself.
The resource group we're going to put it inside the one we've just created.
The web app name is going to be the address our URL for our published application.
So I'm going to take a look to see if I can use something like Resource or Restore course.
And I don't like that.
Let's see if I uncheck this then it's going to give me just restore course dot Azurewebsites.
Net.
It will need to be unique.
You won't be able to use this same one as myself, because this is going to be the address where mine
is hosted.
If you enable this then it's going to give you something unique by default, but it's going to be a
pretty ugly URL, so feel free to experiment with this.
What we're going to publish is our code.
It's a.
Net application.
And then we can select a runtime stack.
And we're going for dotnet nine.
And because it's a Microsoft platform I'm going to select windows.
And then the region I'm going to select the same region that I selected for the resource group.
Just keep everything the same.
Otherwise you might experience latency issues.
Then we get the pricing plan.
Now we want to choose the free plan.
So let's take a look and we can use and I've got other ones from other resource groups inside here.
So we'll create a new one and we'll call it restore Dash v2.
Or at least I will.
And I'm okay to select this.
So I'll click okay.
And then we can select a pricing plan.
And if we click the drop down then we can select the free F1 plan which costs zero per month.
So be careful please when you're using these forms.
And make sure you don't get caught out with their default selections, which is always going to be a
paid for option.
And then we can click Review and Create.
And this is going to create our web app.
And we'll click the create button.
And this might take a moment to create our web application.
So I'll come back and pick up once this has deployed and been created.
And once it has been created we should see something like this.
And we can click the go to resource button.
And this will take us to our web application.
And what this should give us is a link that we can click on to go and view our website as it is right
now.
And we haven't deployed any code to this.
So I'm just going to right click the default domain and open in a new tab.
And what this will display is the default page for a web app that doesn't have any code deployed to
it.
So that's working just fine.
And what we'll also create if we go back to our resource group.
And Azure is a busy, busy platform with many, many different links to click on.
And how do I get back to my resource group from here?
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
this resource group.
And next I'll create the database or database server.
So I'm going to click create.
And we need to look for SQL.
And I'll select SQL database because that's what we need.
And if we don't have a SQL server already it will create one at the same time as part of this form.
So I want a SQL database and I'm going to click create SQL database.
Now this is where things might be slightly different for myself to yourself, because I'm not going
to see the pop up that asks me if I want to use a free SQL server.
There will be a point as we go through this form where you can choose to create that free one that I
was referring to when we were looking at the pricing.
So in the resource group this is going to go in restore Rv2.
And then we can give our database a name.
I'll just say restore DB as the name.
And then we can select the server or we can create a new server.
Now if you select Create New then what should pop up around about this time is the option to use that
free one that I was referring to.
And I'm not actually going to create a new server for this.
In fact, I will.
I can always change it later.
I'll demonstrate as closely as possible to what I'm asking you to do.
So I'm going to pick the location the same as where the application is being deployed to, as our web
app is going to be communicating with our database on a continuous basis.
So to reduce latency, you do want this in the same location.
We need to give this a unique server name.
So I'm going to say restore Dash That v2, SQL and location.
And then as far as authentication goes, select use SQL server or use SQL authentication.
And we give our server an admin login name.
And I'm just going to say app dash user.
And then give it a password and make this password secure.
So do note it down locally to yourself because you will need to use this inside your connection string.
I'm just going to go for a simple one, because I'm going to dispose of this server anyway soon.
And I don't want to blur things out if I can avoid it.
So I'm going to click okay.
And this is going to create the SQL server.
Do we want to use SQL Elastic Pool?
I'm going to say no we're going to use development workload and then the Compute plus storage.
Again if you're using the free version you don't need to worry about this.
But this one's going to be probably expensive.
So I'm going to configure the database and I'm going to pick the cheapest possible option.
And this one is fairly cheap I guess.
But let's see.
I'm sure there's a basic option.
And I think this is as cheap as we can get it for SQL server.
So I'm going to apply this and just have locally redundant backup storage.
And I think that's about as small as I can get it.
So I'm going to review and create and click create.
And it's underway.
So once again I'll pause the video and come back once this has completed.
And once that has been created you should see something like this.
And then we can go to our resource and we can see our database.
Now we've got a bit of configuration to go with this.
We need to tell our web application about our connection string for our database.
And we'll take a look at our configuration for this next.