[MUSIC]
>> We love a good demo,
and this one promises to be great.
Here to bring us through
container-based development with Visual Studio Code,
please welcome, Christof Marti.
Christof, it's so great to get a chance
to talk to you. How are you?
>> Doing great. Thanks, Maira.
Imagine joining a new project and
trying out some new department tool for technology stack.
Now, one of the first hurdles is
usually that you need to install
one or several tools on your local machine just to
get started with the most basic, Hello World, example.
Today, many projects in
stock images are automated and reproducible deployments.
Now, imagine using Docker images to
also codify the development setup,
and then create containers for development from these.
This is what development containers are about.
Now, let me show you what
this looks like in a short demo.
First of all, you need
the Remote - Containers extension installed in
VSCode and Docker on your system.
For the demo, we're going to look at
a simple Azure function
that just returns a list of products.
Now, if you wanted to run and debug that locally,
which I have to install the Azure Functions tools.
But instead of doing that,
we'll now add the devcontainer configuration.
I'm going to the screen remote indicator
here, in the lower left,
and "Add Development Container
Configuration" for "Azure Functions and Node".
This adds two files to my workspace.
The main configuration file is
devcontainer.json that comes with
a lot of options among others.
You can list the extensions you
want to have installed in the container.
This also references the Docker file,
which in this case just pulls in the Azure Functions
base, which you want to work from. With that in place,
I can now reopen this folder in a container.
The window reloads the containers in-built
and after a short time we'll see the same files again.
But now we're looking at the files within
the containers because the local folder is mounted
inside the container and
only the VSCode windows is still local,
everything else runs inside the container.
We also see the Azure Functions extension
is now installed.
When we check on the command line,
we see the Azure Function CRM is now available.
Going back to our Azure Function example,
can now set the breakpoint,
and then we can launch the Azure Function and
actually very simple HTML front
and using the same launch configuration
as we would if we run this locally.
See at the bottom, Azure Function started.
In the first notification telling us
the Azure Function is now listening on its port.
After that, there's the port
3,000 being listened by the frontend,
I'm going to preview that in the integrated browser.
That's loading the frontend,
the frontend will then trigger the backend.
Taking a little longer than usual up here,
and there we are loading,
and we hit the breakpoint in the Azure Function.
Now, we can debug the function as we normally would like.
We can inspect local variables,
can step in or step over functions just as we know it.
This is what devcontainers is about and can do for you.
>> Thanks for sharing that with us, Christof.
I have some questions for you.
What if I want to use a different technology stack?
>> We've briefly seen that there's
a whole list of configurations included for
various technology stacks and
you can choose one of these and
just use that and modify it to meet your needs.
Or you can start from
scratch and maybe use your own Docker file
if you have one and add a devcontainer.json to it.
>> One of the key benefits that we can keep
our development tool separate from our local machine?
>> Yes, and that actually becomes
particularly important when you have
various projects which require
different versions of the same tools.
With devcontainers, each project can have
its own installation of development tools.
Another major benefit is that you can easily share
your development setup with your team by
checking in the devcontainer configuration.
Also, imagine how much easier it gets to
onboard new members to the team when all
they need is the Remote - Containers extension
in VSCode and Docker installed.
>> That's great. What are some of
the recent improvements and what
can we expect in the future?
>> Recently, the focus has been on
replicating the same level
of support for configuration in GitHub Codespaces.
Codespaces, they'll come with full support for
devcontainer configuration that we've
been looking at here,
and that will make it easy to transition between
running devcontainers locally and in the cloud.
Then one popular request for
Remote - Containers is to improve its support,
programming devcontainers on SSH service,
we're also looking forward to improving that.
>> My last question here,
what is the easiest way to
try and evaluate devcontainers?
>> Well, definitely go and install
the Remote - Containers extension in VSCode.
That will also help you with
the installation of Docker
if you don't have that already,
and then just open one of our sample repositories.
You'll find the corresponding command when you
click on that green remote indicator,
you've seen in the demo,
you get that once the extension is installed.
>> To learn more, be sure to
visit the link on the screen.
Thanks so much for joining us, Christof.