[MUSIC]
>> Welcome everybody. How are we doing?
Hello. We've got a pretty interesting day ahead of us today.
There's a couple of things we need to do.
I did not provision the Redis Server, which is my own fault.
I realized like I want to
do all of this on stream as much as I can.
There are definitely some things that I can't do live.
Last time we left off,
we set up a flexible server a
Postgres SQL flexible Server on Azure.
We were able to get all of that in Terraform, which was awesome.
I haven't touched this database at all.
It's still sitting here. You can see
that it's been collecting metrics.
What we need to do now is that we do
need to create this Redis Server.
Then after that we're going to actually be
migrating our API Server.
Let's go ahead and hop into it.
We need to create Azure Redis Server is going to do that.
I'm going to sign it is it automatically
signs it to you if you drag it,
that's nice. What do we want?
We want to create a Redis Server.
Let's go into the portal here for a second.
Let's go ahead and look and see what they have
for offering when it comes to Redis,
create, Redis cache,
we're going to do that as well.
Then we'll go ahead and take a look at this stuff here.
We've got subscription as usual,
and then we've got our resource group.
Right now, this is going to be whatever this will be quirk-dev.
Right now, I don't even think we have
250 megabytes of cache being used.
We're going to mean to make sure that we have
a Basic C0. Let's go to networking.
Let's keep on basic then that's fine.
Let's go to networking again.
Let's take a look at private endpoint.
Now, private endpoint is basically what
we've already done with our database.
What we're going to do is, we're going to link this into
our network so that it can exist on our subnet.
I'm going to be real.
I don't really like the paywall
around networking security requirements.
The premium-tier, is the only one that does that.
Let's look at networking isolation options in general.
We do want to have a good understanding of
how network isolation works with Redis.
The limitations here are
network security groups are disabled for private endpoints.
However, if there are other resources on the subnet,
NSG enforcement will apply to those resources.
Currently portal console support
and persistence of firewall storage accounts are not supported.
The next one in this case, which is what we're going
to be using is Azure Private Link.
The idea here is that because,
it is supported on basic, standard and premium,
what we can do with a private link at least is say hey,
we're going to make sure that this resource is
disabled from public network access.
Then we will poke a hole into
our subnet so that it's almost like an emulated.
Let's go ahead and do that.
Now what we're going to do is we're going to
go Terraform, Azure, Redis.
Now remember, we're using Terraform for all of our stuff.
Resource group, Redis cache.
This is basically what we want.
Go ahead and go back here, and we're going to say touch.
We're going to create a file really quickly in
this file is going to be called redis_cache.tf.
Let's go ahead and create a resource group here.
We definitely want to create a resource group for
everything that we have as long as we can.
We're going to go here and we're going to
create our new resource group,
and for this we're going to say redis.
We're following the same model here.
We have our network resource group,
we have our database resource group,
and then we have our redis resource group.
Let's focus on the main stuff.
For example, this is going to be self local.workspace,
meaning that the name of this reticence we'll be quirk-dev.
At this point, we have
a redis instance or the ability to provision a redis,
instance that is going to be in
this resource group will then be provisioned in Azure somewhere.
If we think about it really carefully,
we're missing some stuff.
Like for starters, we want to make sure that
this is not publicly accessible.
Public network access enabled.
Look at this defaults to true with Terraform.
We want to disable this.
If I ran that,
I would have accidentally,
potentially provisioned a public reticence.
Let's make sure that this is set to false.
I really do like resource groups.
It is a really neat concept.
I don't know if it's a 100 percent required,
but I really do like it a lot.
Let's look up storage accounts.
We're going to go to Terraform storage account.
We know we've already got our resource group,
we're going to go and copy this,
go ahead and go to storage account, and there we go.
I've got our storage account now and we're going to call
this the redis storage account.
We could do quirk,
and then instead of workspace,
there's also an environment variable.
What we'll do here,
is this is where all of our storage accounts will go.
If we need to create another one in
the future, that's where it'll go.
Now, you're going to notice that one of the things we
wanted to do before was also networking.
What we need to do too,
is we need to make sure that this is on a subnet.
What we're going to want to do is we're also going to make
sure that we attach this to the virtual network.
We have our database subnet here.
Let's go ahead and create a new subnet.
This one is going to be our storage account subnet.
The subnets need to be in
the same resource group as the network itself name,
and then the location is going to be storage account location.
The subnet here would be
storage account because we
want the storage account that go in this subnet.
This is okay for now. I'm trying
to think if there's anything else I need.
I know that I need a subnet.
I know that I've already got
the resource group with the network that are virtual network.
Remember, our virtual networks' right here,
and this is our virtual network for the whole workspace.
Then we've got our subnet for databases,
we've got our subnet for storage accounts.
Let's go ahead and get this merged in because I want to
start getting some of this Terraform automation actually running.
Actually going to go ahead and go to
the resource group here and I'm going to remove the redis stuff.
Now we're only creating the storage account and
the resource group for the storage accounts.
The storage account subnet. Let's go ahead and do this.
I need to move the redis stuff.
I'm going to move redis cache
out of the directory for the time being
because I want to commit
without that. Let's go ahead and push this up.
When I push this up, we're going to go back to
our repos and in here we should have a Terraform.
There we go. There's our new poll request.
When I create this merge request,
what's going to happen is in a few moments,
we're going to see updates from Terraform Cloud actually come in.
It's going to see my changes here they are.
It's going to see my changes and it's going to
immediately start running those plans to
see if they air out or anything
like that. Let's take a look at here.
Terraform will perform the following actions.
Azure Storage account will be created.
Here's our resource group, or a storage account.
It'll be called quirk-dev storage account for
the resource group and then finally we've got the subnet itself.
Virtual name, quirk-dev. Looks good to me.
Let's see if this is going to run.
Let's go ahead and complete this really quickly.
We're not going to complete the work item,
but we are going to go ahead and delete
the feature branch, squash, and merge.
What this should do is this should merge the pull request.
There's our plan. Now I can go to "Run" and
you can see here there's our merge and so again,
we're right back to that same thing where you can see.
We had some stuff change, no big deal.
So the only thing I'm wondering about
right now is if I need this subnet,
I think I still may need it.
I'm going to go ahead and apply this.
Next thing we need to do is we need to add the redis stuff.
I'm just going to grab that, bring that back in.
The resource group. redis is good.
Here's what we need to do now.
Where it says this nc thing.
What we want to do is we want to say storage account itself,
primary blob endpoint. That's what we want.
We want it to set the default endpoint protocols,
https, the blob endpoint is
our storage account self primary blob end point.
The account name is the storage account self.name and
then account key is
the Azure storage account self primary access key.
That should mean that we can do that.
There's a couple of other things we need to do,
which is we're going to need to figure out how
to set up a private link with it.
Let's go back to Azure cache for
redis and we're going to go to networking tab.
Now we want to private endpoints,
so we need to create a private endpoints.
Let's go to Terraform.
This is going to be the redis private endpoint and
the name on it is going to be local workspace redis.
Let's take a look at how exactly this is supposed to work.
We're going to go with Dev database right now
because it'll be Dev redis, but that's fine.
The name for the endpoint we'll call it
quirk to deploy the private endpoint we're going to do,
quirk-dev virtual network subnet.
It's pretty much like how the database is actually.
If we go to the PostgreSQL flexible server,
we can see here that it depends on
the private DNS is known virtual network link.
Then if we flip these and we look at our virtual network link,
I should now be able to say that DNS known is the redis name.
The network is the same network
and then the resource group is redis.
So let's take a look here. This looks good.
Basically what's happening here is we get
our resource group, [inaudible].
We then get our storage account and then
basically we create our redis cache right there.
You can see here's our connection string,
which is sensitive, which is awesome.
I'm going to go ahead and merge this and let's see if we
can get this and you can see it ran for both,
makes sure that it works in both Dev and prod.
Let's go ahead and merge this in and we're going to get
the resource group and the actual server itself created.
Let's give it a shot. Let's see if it'll work confirm and apply.
This is now going to essentially create all of those resources in
the Dev environment and we should
see them appear momentarily in the dashboard.
I'm going to refresh.
Let's go ahead and fix this so that we
can get this redis server up and running.
Basically, all I had to do is abandon it and then
reinstated or whatever in every triggered the web hook.
Resource group redis changed.
It hasn't is just a small API update.
Here we go, create, so it's going to try creating that cache again,
all of this is
disabled now we don't have to worry about any of this,
and it's also going to destroy
the subnet we don't need anymore either.
We're going to approve this and then I'm going to complete,
and I'm going to complete merge.
Now that that's done,
we should essentially now be able to provision our redis instance,
have it available to us to configure.
We can then see how we set up
private endpoints and all that good stuff.
I mean, I'm very confident at this point this is going to work.
I was like does it even shown up.
It is in fact showing up.
Here's our redis cache.
We now have our redis instance deployed and if I click on it,
we can see it's right here
and we were able to actually finish this.
I want to show you guys why I
created my issue first or my user story first,
I now have a user story, its User Story
24, called Create Azure, Redis Server,
because I started it at the beginning,
I was able to attach all of my work to it.
One thing that's interesting about this,
as I said, this was four story points.
I was wrong. This was probably more about six story points.
I can see how this whole thing went
and I can see this ago. This wasn't a four.
This amount of branching and trying
things does not make this a four to me.
This is at least a five and there we go.
We have our second issue resolved,
our first one was creating our
Azure PostgresSQL Server and then our
Azure Redis Server and now through that process,
we've got our Dev environment fully
automated and I can easily go into Azure and I can say,
hey, there's my Azure Cache or Redis.
The next thing that we have to do is migrate the API Repository.
This is the first repository of the many that we have to do.
We didn't get done what I wanted to get done today,
we did, we got the Redis Server demo,
which is awesome when we learned a ton from it and I'm really
happy that like we literally got to where we are.
I also wanted to do the API Repository as well
as at least try and get our hands into pipelines.
Thank you guys. Bye.