>> Hi. My name is Christian Nwamba,
and I'm a Senior Cloud Advocate at Microsoft.
I'm super excited to show you how to
deploy your Azure Functions to
Azure at the Cloud using Visual Studio Code.
If you've been following this series,
there is a high chance that you
have the repository that John had been
walking with or rather the project that John
has set up with you in the previous videos.
But if you don't, just head to GitHub and clone
this repository which I'll
paste a link in the description for you,.
First of all from the repository,
I already did that,
so I'll just click on the link,
and then I'm going to copy the repository.
Head back to Visual Studio Code.
Click on this gits tab the source control tab,
which would show us
these options to either open a folder or clone a repository.
In this case, I want to clone the repository,
so I will just click on the "Clone Repository" button,
paste the URL we've copied, and hit "Enter".
Now, Visual Studio Code will ask you
which folder would you like to clone this repository into.
I'm just going to do that in my dev folder,
create a new folder called,
Johnpapa, and then select
this repository location where VS Code
should clone the new John Papa's repo into.
Once you've done this,
Visual Studio Code would ask you,
do you want to clone this repository?
Or do you want to open this newly clone repository into
a new VS Code window
or into this particular window we're working with?
In this case, I'm just going to go with this particular window.
As you can see, we have John Papa's repository
set up for us to deploy.
But before we get ahead of ourselves and start trying to deploy,
let's actually ensure that this is working locally first.
To do so, we need to,
first of all, install the dependencies,
so run npm install on this project directory and hit "Enter".
Next, close the terminal and search for debug.
It starts debugging in the command palette.
If you hit "Enter" this would start to run our application.
After a few seconds,
you should see that we have an endpoint
to click on and test if our API's actually working.
If we click on this endpoint,
we would get a list of all the products which probably you
have seen in the previous videos
while following along with this series.
Now, at least this ensures
that this repository is in good shape and it's working.
We can go ahead and start trying to deploy it to Azure.
To deploy this function to Azure,
I head back to Visual Studio Code,
close the terminal, stop the debugger.
Open the command palette with Command Shift P or F and search
for Azure Function deploy,
choose the deploy to function app and hit "Enter".
You'll be asked if you want to create a new function in Azure.
In this case, that`s what we want.
If we have existing
Azure Function projectory deploy in Azure account,
they will be stable as well.
In this case, I don't have any.
I just have only the option to create a new function app in Azure.
Hit "Enter" and pick a globally unique name for this function.
Globally unique basically means
that you cannot choose another name
that some other Azure client has chosen for an Azure Function.
The best way to avoid this is to add numbers at
the end of your Azure Function name.
In this case, I'm just going to add a random number to it,
let's say 2343, hit "Enter" and then choose the runtime stack.
In this case, we want it to be a node for our deployment.
Once you do that data, you'll be asked to choose
the location for this deployment,
you should choose something very close to you.
In my case, I'm just going to choose a random location
or just the first one which is Central US.
Then the deployment would start and you should see the
notification pop-up telling you
that your deployment is in progress.
Once the deployment is complete,
click on the "View Out" button.
If you see a link to the just deployed Azure function,
if you click on that link,
open it in your browser,
you should see the same results you saw when we
are testing our local host.
But this time we actually have
a publicly available endpoint that you can share with
friends or anyone that you want to see your Azure Functions API.
[MUSIC]