hi and welcome in another episode of cloud in five minutes
today I want to show you how to create and deploy a dotnet core website to
Azure from a Linux machine also if you prefer, I have an English version of this video
just click here in the top right corner
hello again let me introduce myself I'm Frank Busch a Microsoft Azure MVP based
at Montreal in Canada in today's demo what I want to do is create a dotnet
core website using an angular template and deploy it to a sure we'll do all
that from a Linux machine let's get started okay so in today's demo I will
be using Ubuntu machine version 1604 I'm already in the folder where I want to
create my application so let's do it so to do that I will create I will use
the command dotnet new angular we have multiple template today we'll use
angular and I'm specifying the name of it so it will be Frank and goo demo so
run that okay so now the app is created let's go in it and now what we need to
do is we need to update the NPM package so to do that I will use the command
with sudo to be sure that everything is present but everything is here I needed
to clean my screen because I had the typo in my command so but this is all of
it so now we'll edit the application to be sure that you know we're deploying
our version so I like to use Visual Studio code so now just just need to do
the code dot to open a tab in a folder mode just like that perfect so here I
have all the structure of our application now let's go in the
application like get and let's go an ohm and an ohm component and setup l word
let's put ello and let's put angular demo let's put Frank angular team or
la perfect so now I have everything set up so the first way I'm gonna show you
how to deploy is using a git repository so it's very interesting and practical
if you're in the dev environment because every time you push your modification
the application will be build and publish deploy so to do that I will use
the compatibility with get of Visual Studio so just go here and I need to in
it so just initialize a repository and that's it
so now everything is in there so I will change everything so voila and yes
everything perfect so everything is now checked in locally so now what I need to
do is go in here and create a web app and get that get repo from there and had
it as a remote I could do it in a portal but let's use the azure CLI functions
okay so let's go back in the terminal I will clear my screen so everything is I
mean for you what we need to do is create a resource group every deployment
start with that so as your a group create and I'm calling mine cloud five
minutes and I'm using the location that is close to mine of course use the
location that is close to you now what we need to do is create a service plan
so to do it we use the app service plan create and I'm specifying my name here
and I'm putting in the same resource group that we just create I'm using this
Q free just to be free of charge of course but in a realist raishin we'll
use something like standard or basic voila let's clear the screen to keep it
up so the next command I need to create is the web application so let's paste
data is and take a little bit more space okay well okay so the next command is to
create web applications I'm creating the web
applications specifying the resource group and the plan that we just created
I'm specifying also the name of my application and one thing that is
different than the usual maybe is I'm specifying the runtime here I'm since
I'm using the template angular I want the runtime to be node you have a
command if you want to know all a runtime that is available you could do
it it's runtimes list so let's execute that perfect
so now let's clean again my screen every time you create a web application you
have a local repository like local in Azure in a cloud so now what I want to
do is try to get those information so we'll create a deployment here and I
will specify the user in the password voila and now I will use this command to
get the URL at that get repository and use it as a remote to my local one on my
machine voila so I will use this URL in this
command so git remote add a sure that will be the name of my remote repository
in imagine that URL so the next command of course is to do the push so let's do
this I'm pushing to the Azure so first it asked my password yeah so of course
by pushing to the remote repository I'm triggering the build and the deployment
so that will take a little while so we'll let you have a look and we'll
return just after
you
okay so it just finished so now we should be good to check go in a portal
check if it everything is created so this is my resource group let's open it
you should see yeah perfect so the app and the plan so let's open a new tab and
let's go to the website fantastic hello Frank
angular demo so it worked this worked perfectly so every time you push your
changes then all everything is build and deploy so that worked perfectly in a dev
environment so of course in a prod and pre-prom environment since you want to
reuse the same artifact you could configure a CI see the environment and
for example the STS or any other system but today I want to show you a quick way
to do it without those tools so first let's go back in your application and
via AVS code to do some little change so here I am so let's just change it to be
sure that it's a new version so take to letting take - and I save so now what I
want to do is I want to package the application so let's clear my screen
here so now I will use the command dotnet publish and I'm specifying the
configuration release
I use the zoo because I want to be sure that all the permission that is required
to package everything if I need to download or something whatever Wow
not that long so let's just clean the screen again so next command I want to
do is I want to create my zip file and oh yeah I didn't specify the middle I
want to show you so it will be the zip deploy so we package everything in a zip
and we'll use the CUDA interface to deploy it automatically so right now
what I want to do is go in this folder I was just creating in the bin release and
I will go in that folder and zip everything to do that I will use the
command zip recursive with the name of my application of course I need to do
command I need the sudo permission perfect everything is zipped so let's go
in this folder so this is my app folder so now let's go and bin and release and
here and publish and here I have my zip file so now what we need to do is go in
the koodoo interface so to go in the koodoo interface let's open back the
browser so if you notice the URL of the CUDA interface is the same as my web app
except that between the application name and the domain name have this SC M so
this is the interface the way I remember it is super console management but
that's not what I mean of course I'm because I was already registered in the
portal it automatically logged me in otherwise it will have asked the
credentials so now I'm here what I want to do is just drag and drop this zip
file over that structure here so drop here to zip now I can check it's
deploying perfect so deploy is successful so now if we go back to the
application and fresh voilá take two so everything is
done work perfectly a little bit much a little bit faster but of course
everything was pre-built so that's why it was fast so voila - way to deploy
your application of course today I was using a Linux machine but it will work
perfectly on Windows on Mac I just want to prove it that it's functional on
Linux of course it will suggest to use a stronger mètode' then drag and dropping
files but it works so but if you are interested you could use VSDs to do all
those things I hope you like this video and I hope it was useful so again this
week I have two suggestions the first one is as a rocks a nice YouTube channel
from my buddy Kiba yet that is also an MVP Basin
material it's an English it's really good
have a look and the second one is another great video of Cloudy with 5
myths thanks for watching see you next time
you