With .NET 8 and .NET conf for right around the corner.
I've been trying to brush up on my skills and learn some new technologies.
There's so much happening in the world of .NET and it's never been easier to
learn all from your browser on any device.
That's right.
You could like go just onto your iPhone and just start coding in the browser.
It's kind of fantastic.
Nothing to install anything at all.
Now, I've done this in the past for like building like backend services
and playing around with some web stuff, but I never really thought
about cloud native development.
Containers and Docker and Kubernetes.
How could I actually do that in the browser?
How I've always known to do this as installing Docker desktop or inside
of WSL, and then getting a bunch of Docker commands on my machine.
And then I got all this images and containers.
It's all over the place.
Well, what if I told you, you can also do that all in the browser and there's
a full learning path updated to .NET 8.
Well, there is, and I'm going to show you how you can learn
cloud native NET development.
All in the browser without installing anything.
So tune in.
Hey everyone, I'm James.
And today we're talking about learning cloud native.
net development, all in the browser.
That's right now.
I'm not a backend developer.
I'm not cloud native developer, not a web developer.
I am a client developer using.
net, but I'm kind of all those things because even my mobile apps and desktop
apps need scalable and resilient cloud native backends and apps that I'm building
in a sort of a microservice type of way.
Now I'm really excited because .NET Conf is.
Coming up next week, or maybe you've already watched this already happens.
I'll put links down there to all of the sessions.
I know cloud native is going to be a hot topic.
In fact, so much that like, if you just go to the NET website and tap
on cloud, like you're going to read all about the awesome things built
into .NET for cloud native technology.
So, which is really, really exciting, but actually going and learning
all this stuff can be complicated.
There's great documentation, there's eBooks, there's great samples
and all this stuff out there.
However, what if you just want to get up and learn directly in the browser?
Well, you can do it with Microsoft.
Learn training.
That's right. There's an entire NET course.
I've probably talked about this already to learn just about anything.
If you're learning C sharp and NET, you know, you can actually get your free.
Uh, free code camp C sharp certification this way by taking the, the learning,
uh, C sharp classes on here.
And there's also this cloud native microservice.
net and ASP.
net core, uh, learning path as well.
And there's a bunch of different things in here, including learning
how to build just your first microservice, learning Kubernetes.
Deploying resilient apps, instrumenting apps, feature flags, uh, you
know, cloud native, uh, deployment with a CICD, all that good stuff.
Now in the past, you had to install Docker and do a bunch of stuff on
your machine and pulled on the code.
Not anymore.
These have all been updated to NET 8 and actually got to work with the
team that was putting this together.
And I got to code review these myself, which is super fun.
And I'm really excited to show you what's brand new.
This is all live happening right now.
So let's say you go into the, build your first, you know, microservice with NET.
Now Microsoft learn, if you've never done it, as long as you're signed in, and I
guess you don't even have to be signed in.
Actually, you're going to start learning right here in the browser.
So this is going to tell you kind of what stuff is, and then you do stuff.
So for example, here, you see like, what are microservices?
Let's build a microservice.
What's a microservice orchestration.
Let's go do that.
And then summary.
So you're learning and then doing, let's just go.
To the doing perfect.
All right, cool.
So this is really, really neat.
Check this out.
This exercise of building a Docker file and building your first
container, a microservice is all done completely in a code space.
That's right.
I've talked about code spaces in the past.
My previous video, I'll put a link up over there about it.
How you can get started building NET applications with.
Awesome templates and containerize your entire dev
environment, which is really cool.
But check this out.
You can use a pre configured GitHub code space, and then you just start coding.
So let me just tap on this link.
Oh, let me open it in a new tab.
That'd probably be a little bit better.
There we go.
Perfect.
And.
Check this out here, uh, here, this is paid for by me.
Now, of course you get a bunch of code space time for free.
So it's not actually costing me anything here.
We can see it's using this repo specifically if you're Microsoft
docs, there's a main branch, and then it's going to configure
one of these default templates.
Now this one here is the Docker, uh, one, but there's a feature flags, Kubernetes
and resiliency one, which are using the.
Other modules too.
So let's go ahead and create the code space.
Now, what this is doing is inside that repo is it's telling GitHub code
spaces, what to use, what extensions to use, what, how to configure the
container and build everything up.
Now this for the first time is going to take, uh, I don't know, 30, 60
seconds or so, so let's just go ahead and let that container and code
space spin up for us automatically.
All right.
We are all set up over here with our code space.
Now this has been all pre configured with NET 8.
So we can see things are running over here.
Uh, C sharp dev kit is here so we can open that, uh, solution if we
so desire, which is really nice.
And we can see that inside of here, we have our data entities.
We have some finished files, products store.
We have a bunch of Docker files that are inside here, which is really cool.
Uh, and, uh, we have all of our dot dev container configuration.
So if you wanted to actually dive a little bit deeper into what's going
on here, you can see everything and all the tools that are being installed
here, which is very, very cool.
So.
Get all that stuff all spun up for you automatically.
So this is really, really neat because now we have everything available to us.
Now, if we want to, we can of course go into the project and we can start running
and debugging this project directly in the code space, like I showed in the
previous video, however, we want to start doing cloud native stuff, right?
So if we look inside this.
Um, uh, application, we have this eShop light app, and then
we have just like a store.
So we have this data entities, uh, over here, which is kind of nice.
We have this little app that's going to spin up.
It's connecting to product endpoints.
Uh, over here, it's using HTTPS, anti forgery, a bunch of stuff
going on here, which is really nice.
Has products as well.
So this is another project inside here.
So we have a backend and a front end, a little database, uh, with
all of our different products and data entities that are coming in.
So we can take a look at that product using entity framework,
uh, which is really, really cool.
And we can also see in our ports tab down here that we have two
ports that have been forwarded.
So that's really neat.
Automatically set up for us.
And that was configured up here.
If I go back into that dev container configuration, we can see down here with
these two ports that are configured.
And then we have the labeling here, which is kind of really nice.
Okay.
So we have this set up and we're kind of ready to go.
What do we need to do next?
Well, if we actually take a look at the learn module, it's going to walk
us through setting up this Docker file.
This here is going to pull the NET 8 image.
This is going to set the working directory.
It's going to copy this project into the working directory.
It's going to do a NET restore.
It's going to copy some things over, and then it's going to
do a NET publish release build.
And then what we're going to do down here is we're going to, again,
not only like we have our data entities, we have our products and
it's going to do the same thing.
So we're going to basically build up both projects and get them going.
And then finally, what we're going to do at the bottom here is we're
going to, uh, again, pull that image.
We're going to set the working directory to the app.
We're going to expose some ports.
Uh, we're going to copy it and then we're going to create our entry point
into our products, which is cool.
At the end of the day, we're going to actually build up our Docker.
Uh, container, uh, over here with this Docker command, uh,
and that file that we specified.
So let's go ahead and open up what it says here is the Dockerfile products.
So if I go back into my projects over here, I have my Dockerfile
products, which is nice.
The store is already set up for me by my products here.
So I'm just going to go ahead and copy in some of this code.
So again, first, this is going to pull and then get the data.
Entities there next up, I'm going to go ahead and copy the
next line in here, which is the products that are required there.
And then finally we are going to go ahead and at this point,
uh, get that products DLL.
So we already have our store, but now we have our data entities, which
the products are using the backend.
And then we have products there, which is cool.
All right.
So now we need to do is go into our terminals.
This is kind of cool.
And what I'm going to do is I'm just going to do scd NET Docker.
Right there.
So that's going to go into that folder.
So again, we have multiple projects in here.
So now we just have this here.
I'm just going to go ahead and run that command.
So I'm just going to copy and paste it here into the terminal.
So this is saying Docker build the products backend for the tag, and then
use this file, Docker file products.
So it's going to go off.
It's going to pull everything that it has showed you.
So it's going to pull that configuration, the Docker image, all this stuff.
And it's going to build up our container.
Right here, which is really cool.
So again, this is going to take a few seconds here as it kind of builds
up, just like we were building our, our dev container for code spaces.
This is now going to build our container for our application.
All right, cool.
It's all built up.
That was actually pretty quick.
And now all I got to do is say Docker images here and what we can see, I'm
just going to go ahead and zoom in a little bit more for us over here.
There we go.
Is that if I go ahead and open this up, we have this latest tag,
everything happening over here.
Uh, right inside of our code space, which is cool.
So I have this latest tag, the product's backend, everything that I need.
So it's pretty cool.
So now all I got to do is just run it.
So I'm just going to copy the command that is over inside of that learn module.
So this is going to say Docker run.
It's going to pass us some commands and then it's going to start running it.
Basically, it's going to run our application inside of the container,
inside of Docker, which is really nice.
Now, this point, this is running.
You can see that we're actually running it over here.
It's listening.
And if you noticed previously, we talked about the ports that were forwarded.
This is pre configured.
And in the learn module, you learn all about this is that
the backend here is running.
So we can see that this port is active.
It has a running process and I can just open this in the browser.
Now this is going to basically do port forwarding.
And we can see that nothing has been found here because this is the backend API.
But add an API slash product in there.
This is going to now return all of those products back to us
automatically that were coming in.
From it, which is really, really cool.
All right.
So we just started our cloud native adventure at this point.
We've built our very first container inside of a code space.
Didn't have to install anything.
We got it running inside of Docker, which is like really, really cool.
So we've started to build the backend.
Now I'm not going to do the rest of the learn module because I want you to do it.
Head over to the links that I put below, and now you'll learn about.
How to actually create a Docker Compose, which is going to bundle up the front
end and the back end, configure them to talk together, and they're all going
to be running inside of the code space.
And then there's so much more that you can do.
In fact, learning about Kubernetes, resiliency, deployment, and so much more.
Anyways, I just really think this is a cool piece of technology
that has been coming out.
I talked about code space before, but actually learning inside the
browser, not having to do anything.
You can be on your iPad, right?
You can be on an Android tablet.
You can be on your phone learning this, which is really neat.
Let me know what you think of.
Education inside the browser, inside of code spaces, getting set
up in minutes to start learning without have to install anything.
I think that this is really the future of education and also beyond education.
I just want to code like this.
I don't want to have to install a bunch of stuff just to go try out a new
project or just be super productive.
And then of course, the cool part is that I can always connect to it
from VS code as well, which is neat.
All right.
Well, that's going to do it for this video.
Let me know what you think.
Check out the links below and I'll see y'all soon and don't
forget NET Conf happening.
So check out those links below too, and join in live for all the NET 8 goodness.
All right.
Peace.