Join us on May 5 with Mustafa Toroman to learn about Containers in Azure.
ABSTRACT
Containers are everywhere and there are so many options to choose from. All cloud providers are offering their version of this amazing service. But In Azure, you can choose between ACI, AKS, SF, App Service.
AGENDA
Containers overview, Setting up CI/CD for containers
LEARNING OBJECTS:
Here we'll discuss what is the difference between them when to use what and benefit from the right choice at the right time.
Mustafa Toroman: https://www.c-sharpcorner.com/members/mustafa-toroman
C# Corner - Community of Software and Data Developers
https://www.c-sharpcorner.com
#csharpcorner #mvpshow #live #chsarpcornerlive
Show More Show Less View Video Transcript
0:00
Thank you
0:29
Hi everyone, welcome back to C Sharp Corner Live Show. I'm host Stephen Simon and we are back with another episode of C Sharp Corner MVP Show
0:38
If you are joining us for the very first time, we do this live show every day and I often say that we do so many live shows that we stream 8 days in a week
0:49
Can you imagine that? We do so many live shows and conferences. For the year 2021, we are committed to 21 conferences and I think we will even reach 25 conferences
1:00
I don't know how I'm doing it. I'm so lonely. But all right. So one thing that what we did for the month of May made that we really dropped the number for live shows and conferences as we now focus on helping people here in India who are suffering from COVID. We are helping them with oxygen cans, food supplies, shelter, ambulance and any way possible
1:24
So our team at C Sharp Corner are not much focused for the live shows and other stuff
1:30
with that we do. And we are using all our poses to go ahead and help people who are in need
1:36
There are many, many people dying in India. The other day it was around, if I'm not wrong, 500, around 5 lakhs people died
1:46
I don't know how much that's an international number. 5 lakhs people died in just one day
1:51
And the daily cases that we get is close to 400,000. So people watching across the globe, please stay safe
1:58
The code is still not gone. Take good care of yourself. Wear a mask. Have a social distance
2:04
And yeah, this time is tough. And this shall go too. With that, I'm really, really excited for this show today as I get to host, I can say, my old mate
2:15
Someone I met online, right? All these pandemic fans that I made through these virtual meetings
2:21
It's going to be a really, really exciting show. uh he is a mustafa he's both microsoft mfp and c sharp mvp uh we're going to talk a lot more about
2:29
him but a quick general announcement that i would definitely like to do is uh on every monday we do
2:36
azure ai show uh that way we talk about the entire ecosystem of azure um it may be azure ml ml ops and
2:43
all that then on tuesday we have product showcase show or coffee with pros pros uh product showcase
2:50
is where we feature a particular product i think in the coming weeks we're going to talk about ai
2:55
product uh then in the coffee with pros is more like a simple video podcast uh chit chat uh kind
3:01
of not technical i kind of like that show then on wednesday we do an mvp show the time has changed
3:07
right we are a little early today it's not 10 a.m but 9 a.m then on wednesday again we do bi-weekly
3:14
an AI photo show that's run by Microsoft two AI MVPs, Eve Bhadi and Hogan. They talk about all you
3:20
need to know about data science. They have covered mathematics and now they're talking about R and
3:25
Python. Then on Thursday, we have a bit of AI show that's by Amy Boyd and Hank. They are cloud
3:32
advocates at Microsoft. Every Thursday at 1.30 PM, Indian time zone, they interview one of the guests
3:38
from the ai uh field uh they talk about the job some really cool questions and the best part is
3:44
after the live show ends they also have and microsoft teams meeting where you can go ahead
3:49
and talk to speakers uh talk to hosts and just actually chat with them right that that's pretty
3:54
cool they call it ai cafe i really love that then on thursday we have ask many things shows uh it's
4:00
one of the popular shows we have crossed well over like 33 34 episodes uh where we invite people
4:07
do a talk show followed by some slides and demos it's still not over yet right i cannot stop
4:12
announcing the live shows that we do on fridays we do good-minded shows at 12 p.m eastern um again
4:19
we are just focused to go ahead and promote people for uh awareness for the go-it the last week was
4:24
we talked about how you can go ahead and take help from the local authorities and maybe even help them
4:30
so that's what we're doing with that show these days and the final one that we have is rocking
4:35
the code world with dotnet day that streams every saturday at 10 am pacific mind it it's 10 am
4:40
pacific with david who is i think 14 times microsoft mvp and interviews people from the
4:46
dotnet ecosystem he has interviewed scott hunter mckenford heavens max torcheson uh kathleen dollard
4:54
jerry belickness and and many other amazing guys yeah and we have some really amazing
5:01
conferences coming up too so just stay tuned at c sharp corner and also on our social media
5:06
platforms hi deepak welcome good evening yeah it's evening here in india so without any further ado
5:12
let's go ahead and talk about today's show for today's guest we have mustafa mustafa is both as
5:17
i said microsoft mvp and and c shop corner mvp and ideally he's a solution architect you can often
5:24
find him speaking in many many virtual conferences and online events behind the scenes he did say
5:30
that he doesn't post all of them so i just don't know how many events he are doing okay uh so he's
5:36
a great company leader i've been thinking about a long time and i'm really excited for him so let's
5:40
go and invite our speaker okay guest actually mustafa hi mustafa welcome to the world uh c-sharp
5:49
on mp show how are you doing uh waiting for you to announce me i'm excited to be here excited to be
5:55
on the show i learned a lot of new things i didn't know that you have like a stream every day i i
6:02
wasn't aware of that that's that's so cool like i don't know how you manage to do it every single day
6:09
it's it's crazy yeah me too i i i too don't know how i do it as you know i i do a lot of speaking
6:17
i i do a lot of conferences but having a show every day and that's that's totally another
6:23
Getting guests is sometimes challenging, right? Yeah. Calendars are tough. So glad that you accepted the invitation
6:31
Mustapha, really appreciate it. Oh, cool. Where are you joining us from
6:35
I'm located in Sarajevo, in Bosnia and Herzegovina. Okay, I don't know what you just said
6:42
This is a very unique place, right? So maybe I'll repeat. Where I'm located, where I live, is Sarajevo in Bosnia and Herzegovina
6:51
That's where I live. Okay, that's a quite unique place. I hope I get to visit that day someday, right
6:59
Yeah, I hope, like, I usually travel a lot, both for work and for conferences
7:07
Unfortunately, this last year and a half, everything went crazy. But I hope that this will soon be behind us
7:16
And I met a lot of, like, really nice, cool people, you included, last year
7:21
So I really hoping that this will go away and that I will be able to travel to real events and visit you at your home Yeah at your home as you said since you a c on mp right we do this annual developer conference every year here in india
7:36
around 2500 people join it and it's always free for c-shop so we would love to host you here in
7:42
india right you're traveling here in india so i'm really like once this is behind us and once we
7:49
start really traveling again, I would really be happy. I didn't have a chance to visit India yet
7:55
but I really hope this will come to pass relatively soon. Let's hope next year
8:01
Yeah, yeah. All right. All right, Mustafa. So, you are an MVP, right? Let's talk a little bit
8:07
about an MVP. Usually whenever we go ahead, even to someone who is not an MVP, right, who doesn't
8:12
understand MVP, when they hear the C-Chuck on MVP or Microsoft MVP, the very first thought that they
8:18
get hey you guys work for microsoft like that that is the very first thing even now in the
8:23
comments so could you could you give a quick brief on what is an mvp anyway so yeah so as you said i
8:32
have both microsoft mvp and c sharp or uh c sharp order mvp award i got uh these recent years and
8:41
that's that's correct when people say microsoft mvp they assume microsoft that's not true i'm just
8:47
like fun of their technology. I like using the attack. And MVP is basically, it comes from
8:55
community. It's a reward, it's appreciation for your effort to help others to gain knowledge. So
9:04
that's what I see the MVP award sending from. I got over the years, I've been in this business
9:11
for a long time and got a lot of those like awards or something but mvp both c-shark corner
9:18
and microsoft mvp awards really have a special meaning to me because they are part of my community
9:25
activity they are part of me helping others learn what i already know so that's something really cool
9:34
and that's what i really love about this mvp part yeah definitely it's all about the community right
9:41
anything that you do beyond your day-to-day job to go ahead and help people right and that's how
9:48
yeah one one really cool like the proudest moment of my life was like um that was december 2 2019
9:58
just before everything started i was in conference in prague and after my session after uh after i
10:05
the session, and I think this was similar to, no, it was Azure and Databases, but never mind
10:13
I thought maybe it was a similar session to this one, but it's not. So after the session, the guy walks up to me and says, okay, I just wanted to thank you
10:23
I read your book, and because of that book, I got my current job
10:29
That was kind of the proudest moment of my life. I felt like I really helped someone
10:33
I like someone really came up to me and said I got a job because I read something you wrote that
10:39
was so cool and that's the that's what that MVP stands for like helping people and that's
10:46
what I'm really proud for the MVP awards as well yeah definitely it always feels good you don't
10:51
even you don't even actually get to know that how many people you have helped right when you go in
10:56
and write articles videos and write books you don't even get an idea to how many people you
11:00
of help and one day one day if someone just reaches out to you that hey that that thing that
11:05
you posted or that article that book really helped me a lot so it's always good to get to hear from
11:11
from the people who read our content also Mustafa you did mention about the book right and I know
11:16
you love to write books yeah I'm just writing a new one okay I really am really excited to
11:25
go ahead and read that book when it gets completed, right? So, Mustafa, without any further ado, right
11:31
So, today's topic is about... Actually, what today's topic is, actually? So, we are going to talk about containers in Azure
11:40
Like, everyone is aware that containers are a really cool thing and everyone is talking about it
11:46
And usually not aware, like, we are not aware of all what containers are actually helping us with
11:55
We are going to discuss why we want containers in the first place
12:00
And when it comes to Azure, it's really cool place for containers
12:04
We have several different options. We can go different types of containers, different setups, different services
12:12
So we're going to discuss what are our options out there and maybe like also explain a bit
12:18
how to choose the proper thing for you, like what do you want to use, how we want to use it, and so on
12:24
And finally, once we go through the container set and everything, we're also going to show how to use Azure DevOps to set up CIC pipeline for your container
12:34
so you can deploy them fast and easy. That sounds interesting, right
12:40
So everyone who's watching, if you have any questions throughout the session, just keep the comments coming in
12:44
I will make sure that we take it towards the end. I think Mustafa will be more than happy to go in and answer them, right
12:49
So without any further ado, Mustafa, I can go ahead and add your screen
12:55
Right. And feel free to go ahead and get started whenever you want. Okay
12:59
Thank you. Thanks. So as we said, topic is containers in Azure
13:06
And we are going to walk. I'm going to walk you through it
13:10
I'm going to explain how and why. We kind of already did an explanation of who I am
13:18
So I'm not going to lose any more time on it. So before we begin, before we step into the containers, let's see why containers in the first place
13:28
Why do we actually need them? Why did we want to use
13:32
Who came up with the containers? So what questions do containers answer
13:38
They remove that it works on my machine thing. I've been in this industry for a very long time
13:46
I've been working with different technologies, different setups, different methodologies over the years
13:53
And I would be a very rich man if I got like a single dollar for every time I heard it works on my machine
14:01
So containers are there to eliminate this part that works on my machine
14:08
They say, like, how containers came to work is like when client was complaining that application is not working and developers said it works on developer's machine, the company just decided we'll ship the developer's machine and our clients can use that
14:30
So, basically, that's where idea for all the containers come from in any place
14:34
So another thing is that with containers, we want every environment to look the same
14:40
We want every environment to be an exact replica of the previous one
14:45
We want to always have the same setting, same configuration, so that we know that we are not depending
14:54
on any of the system variables for the solution to work We also have options to have increased velocity We can make containers run anywhere
15:05
It's basically, that's a really cool thing about containers. They can run on anything
15:10
And where they actually can run. So there are several options for containers to run
15:17
We can run them on Linux. We can run them on Windows. We can run them on any of the clouds
15:22
And this is also really important part on why we want to do containers in the first place, because having containers running on multiple platforms and on multiple clouds removes the dependency on a specific cloud provider
15:44
We are not locking ourselves in with some specific cloud solution provider solution, so we cannot move anywhere
15:56
A lot of companies are hesitant in engaging with cloud because they don't want to be locked in
16:05
If I start using any of the clouds and I start using their specific solutions, I cannot move anywhere from there
16:14
and they can blackmail me. They can increase the prices. They can do whatever they want
16:20
I cannot move from there because my solution will not work anywhere else
16:24
With containers, we are eliminating that threat. You don't have to be concerned about what kind of setup
16:32
what kind of different options cloud solution providers offer. We can basically use containers and move them anywhere
16:44
Like if I have a container on Azure, I can just easily pick it up and redeploy to AWS in a matter of a few minutes
16:52
Or I can just pick it up from AWS and then move it to Google Cloud as well
16:57
That's what this container option gives us. It's a multi-cloud approach where we can just walk from one cloud to another with any constraints
17:07
And finally, also it's really cool that we can run containers on different devices
17:12
We have option to run it on drones, Raspberry Pis, any of the IoT devices
17:17
So it's also a really cool thing, and it's also a really cool option on how you can use the setup
17:25
Now, how do containers compare to virtual machines? This is something I got a lot over the years
17:33
The question I had, especially in the beginning of the containers is
17:39
Well, we have virtual machines. Why do we need containers in the first place
17:44
Well, there's a big difference. So what happens with the containers, like with the virtual machines
17:51
Sorry. With virtual machines, we are sharing infrastructure. And then on top of that, we are sharing host operating systems
18:00
So we have a hypervisor. It can be Hyper-V or VMware or whatever
18:06
and on top of the hypervisor, we have a guest operating system
18:12
and then all the libraries, binaries, and apps that we want to be run on top of that virtual machine
18:23
But notice here that everything from hypervisor up is unique to that virtual machine
18:29
So each virtual machine has its own operating system, has its own libraries and applications
18:37
so everything is totally separated. Any runtime, stacks, anything that we need needs to be installed
18:46
on that particular virtual machine. And when you say that containers are portable
18:51
people say, yeah, virtual machines are also portable. I just can copy it from one place to another and redeploy it
18:57
Yeah, but copying complete virtual machine also takes time because we are copying everything, everything from operating system to all the
19:09
dependencies that we might have, and then finally copying the application. So on average, a virtual
19:15
machine is going to have anywhere from 50 to 100 gigabytes just for the basic setup, nothing too
19:23
fancy. And it's going to take a lot of time for that to actually run properly, like to copy it
19:30
and start a new virtual machine from the base image. Now, when you look at containers
19:38
we again are sharing infrastructure and we have a shared host operating system
19:43
Now, on top of that, we have container runtime and then we have all the binaries and libraries
19:52
that we require and separate applications. Now, this is where things are getting really interesting
19:59
And this is how we have different layers on the top of the containers
20:06
So let's presume that we are going to run some web application
20:11
in our container. We are going to run some web app that is dependent on Windows OS
20:17
So we are going to have a Windows Server core as a layer 1
20:21
All the containers that we are going to use that are going to use Windows Server core
20:26
as their core, as their basic image, are going to share this image together
20:33
We are not like sharing, having separate operating system for each container
20:39
Then on top of that, for all the containers that are going to require IIS to run
20:45
we're going to share the same layer. All the containers that have IIS requirements
20:51
are going to be the same. Now on top of that, we are going to do binary
20:56
libraries now, if we need ISP.NET, everything, every application that requires ISP.NET is
21:03
going to reshare those together. Like they're going to share that layer too
21:09
And we're going to share all those layers, all those requirements up to the stage that
21:13
we have a unique application. Once we are actually deploying the unique application, then we are doing the separation
21:20
and we are not having the problem of heavy lifting, copying everything together
21:28
Only that single part, only for all the web applications that are sharing same stacks, same technology, same everything
21:35
the only unique part is going to be website part, where we are going to deploy just the app part that
21:43
is going to be unique. This is basically giving us a really lightweight option
21:50
to redeploy. Because once we are adding instances of the containers, like if you want to deploy our application
21:58
we are only deploying that small part. And we are using all those layers that are already there
22:04
So that's it. So one of the things that we are going
22:10
to require to start talking about containers are is container register. So what it is, container registry is basically a repository for storing container images
22:21
All those layers that we seen previously can be placed inside the container image And once we are building our solution building our application we going to see what kind of dependencies we have what kind of options
22:37
we require for our applications to run. And then we are going to have all those layers mentioned
22:47
that needs to be pulled and reused for our application. There are multiple public registries like Docker Hub
22:55
that are free and easy to use. These are basically, Docker Hub is similar to GitHub for containers
23:02
You have a bunch of open source free code that you can reuse and set up in your projects
23:10
For private registries, we also have options to efficient and secure storage
23:16
So private registries are also an option for specific applications that we are building
23:22
Basically Docker Hub is a good place to store something that is open source
23:27
and also to look into the images that are provided by vendors
23:34
Like you have different Microsoft Windows or you have different Linux images
23:40
that are already pre-created there. So what options for containers in Azure do we have
23:49
So we have several ones. We have options for app services that can run containers
23:57
We have service fabric, Kubernetes container instance, and we also have batch
24:02
which is a small part of it, but it's also worthwhile mentioned
24:08
that it's supporting containers as well. But let's start from the beginning
24:14
Service Fabric is probably the oldest available container instance, container service in Azure
24:23
It supports both Windows and Linux containers. It's stateless and stateful microservices
24:30
So both use cases are supported. And you can also deploy it on Azure, on Azure Stack
24:35
and on-prem environments as well. What people don't really know is that Service Fabric is kind of built into Azure Core because a lot of Azure services, for example, Azure SQL database is using Service Fabric in its background
24:55
So Microsoft is using Service Fabric for a lot of services. A lot of Azure services are basically built on top of Service Fabric
25:05
So it's really cool, really good, really dependable service. The only downside for service fabric that I know is lack of support for different programming languages
25:18
As of now, C Sharp, of course, .NET C Sharp is supported, and there's a solid support for Java
25:27
Anything other than that, it's not a really cool place to go
25:30
You can probably make your solution work, but it's not officially supported
25:35
And for any kind of production applications, it's not really recommended to have it because if something goes wrong, Microsoft Support will tell you this scenario is not supported
25:46
Sorry, we cannot help you. So if you're running C Sharp or if you're running Java, you're probably going to go and this is probably a really good option for you
25:57
However, if you're using anything else, if you require any kind of JavaScript or Python or whatever, this is not a really good place for you
26:09
Okay, moving on, another option that we have are Azure Container Instances
26:16
This is the second service we have in Azure. They are really easy to deploy and run
26:24
We can deploy Azure Container Instances in a matter of a few seconds
26:30
They are efficient, relatively cheap. One of the things that is downside for Azure Container Instances is that this is not a managed service
26:42
So basically, for any kind of scaling or auto-healing, we need to have some third-party tool to handle
26:52
In the past, we run Azure Container Instances and then set up Kubernetes on top of that to actually have it managing everything, like having control over nodes, adding additional instances, and so on
27:10
Nowadays, it's not so much like the scenario that we want to go with anymore
27:15
And to be honest, out of the options for containers in Azure, this would probably be the last one I would choose from
27:25
So in general, I wouldn't recommend going with this option since we have different better services running now
27:34
One of those services is Azure App Service. Now, Azure App Service is probably one of my favorite services in Azure
27:43
It's really cool. it's been really dependable one of the older services
27:47
so if you wanted to run a web application or any kind of web API
27:52
Azure App Service is there it's been a good solid service reliable service for many many years
28:01
and I was really like I was really excited when they announced containers there
28:08
that you are going to be able to run containers on top of Azure App Service
28:14
That was a really cool place, and I was really excited about it
28:18
For initial time, what we had were basically Azure App Service Linux containers
28:25
but since recently, it's not quite recently anymore. It's been since the beginning of the pandemic
28:31
We have also support for Windows Server containers as well, so that's a really cool thing
28:38
Azure App Service containers are really cool, easy to deploy, easy to manage
28:45
We have auto-scaling easily set up, the same as for the regular Azure App Service
28:52
However, they are not the scenario that we want to have with complex architecture
29:00
If you have a microservices or something, Azure App Service will probably get too complex to manage
29:06
and it will take a lot of different tools to manage everything
29:14
and have a mapping and everything in place. And probably the last and probably the coolest service
29:24
that we can use right now are Kubernetes and Azure. So Azure Kubernetes service is a really cool one
29:33
The last option for the container that we're introduced in Azure. So we are talking about fully managed Kubernetes service
29:40
We have elastic provisioning, fast end-to-end development. We have identity and access management to the exit directory
29:48
This is also really cool, especially when we are talking about huge environments
29:53
and having multiple Kubernetes clusters. So basically, when we have a single cloud
29:59
cluster and single instance, it's not really a big deal. We can have a management with username and password
30:07
or whatever. But once we go to multiple clusters and having dozens or even hundreds or thousands
30:15
of those services in place, it gets really easier to actually have an identity and access management
30:22
Active Directory in place. And we have orchestration across 29 different regions
30:29
We can deploy it to Azure Stack or IoT as well. Some parts of the orchestration are we have options for the scheduling, affinity and anti-affinity
30:40
We have built-in health monitoring failover. Basically, if health monitoring sees that something is wrong with one of the nodes, it will do automatic failover
30:50
It will do scaling. It has a built-in setup, networking, DNS, auto-discovery for our services
30:59
We have also coordinated upgrades. We have a complete managed service end-to-end, and it's a really cool solution
31:08
Now, let's go with Azure Portal, and let's see there what can be built-in with those
31:20
How can we start with these containers? and I'm gonna show an example or two
31:27
on how you can deploy the application there as well. So if you're gonna work with containers
31:33
probably the first thing that we want to do is having a container registry
31:44
So here it is. I'm gonna build a new container registry. So basically this is where I'm gonna store
31:51
my container, I mean images, before I deploy them, once I build them
31:57
So let's call it C Sharp. My research group is going to be C Sharp
32:02
Let's see for the registry name. This is going to be C Sharp available
32:08
I didn't do something. Let's see. OK. C sharp is or is not available
32:22
I'm going to in the meantime, I'm going to change to West Europe. OK
32:26
I'm choosing the region closest to me, so I'm going to set it up like that. OK
32:33
SKU, I'm going to go with the basic or let's go with standard
32:39
I'm going to delay this afterwards anyway. So that doesn't really matter
32:42
So for this part, having networking with private networking and private endpoints, this is only available
32:52
if you're using Frequentier. If I go with the premium, these options are available
32:56
But I don't really need it right now. So I'm going to go with this option
33:02
Same thing for the encryption. Tags, if you want to do some managing or reporting whatsoever
33:10
Doesn't really matter. I'm just going to deploy this one right now, and we're good
33:22
And we are having it deployed. All right. This will probably take a minute or two
33:30
So OK, this is actually done. OK, that's cool. So before we go to this one, let's deploy another service
33:40
I'm going to deploy app service as well. Or no, let's do Kubernetes first
33:47
Let's do Kubernetes service. And I'm going to deploy Kubernetes right now
33:53
I'm going to use the same resource group. Let's call the cluster T-sharp
34:04
Europe, I'm going to leave everything at default, not adding additional nodes, authorization is good
34:11
networking is good, integration is good, text, all right. Actually, let me show you something
34:17
If I did before the validation, like for the integration, I could
34:23
if I had the container registry that was already pre-built and I had the ready images and everything in there
34:29
what I could do here is connect my container, like my Kubernetes cluster to this container registry
34:37
And this container registry will be able to pull the images automatically once they are deployed
34:42
But I'm going to do it differently. So I'm just going to leave this on the default setting
34:48
and say no integration whatsoever. OK, validation passed. We're going to create it
34:56
And go. All right. All right, this one is deploying. In the meantime, while this is deploying
35:08
let's go with the container registry and just go quickly over it
35:15
So for the container registry, we have our login server. We have a really important part that I need to do right now
35:25
So in the access key, if you are going to use it with Azure App Service, and I'm going to do it a bit later
35:32
you need to enable admin user. So for the deploy using App Service containers
35:39
and the Azure Container Registry, you need to enable admin user to actually run it correctly
35:47
Any other configuration will fail, and it will not be accessible. For running it with Kubernetes, it's not really required
35:56
But for running it with Azure App Service, You need to set it up
36:03
What else do we have here? So basically, besides the login, we have different encryption, identity, networking options
36:11
These are basically depending on the tier and how much you can do with them. But also we have repositories
36:17
We are going to see the containers that are going to be built in and placed in our container registry
36:24
We have also options for webhook to connect to different services, so we can do a push or different options to help us update or change something
36:41
We can use these for multiple options, like for besides for we can do custom headers
36:49
we can do service URI, so we can use these to post it in some kind of like group or like I
36:56
don't know Slack or Teams chat, Teams group, so you get the notification that something's changed
37:02
and so on. Also you can set up replication. Again this is something for the premium SKU
37:09
So if you need highly available solution, you need to go with the premium so you can have a
37:16
secondary location where your container registry is going to be replicated. Okay in the meantime let see where are we with the deployment in progress Okay this is still running All right this is still running In the meantime let go to the repository So I
37:40
have a really simple app, really simple solution in Azure DevOps. This is like no demo application. It's just Node.js
37:50
single line this is just saying hello world on one so basically nothing too
37:58
fancy we have a docker file that says what we need to set up how to build this
38:04
and and that's basically really simple application why I'm using this is
38:10
because I want to have it relatively fast and not to wait for them or to
38:16
execute for a long period of time. So that's basically it. Okay, so let's see where are we with this. This one is still running. This one is still deploying
38:31
So Kubernetes can take a bit to deploy. In the meantime, let's start with the build for our
38:39
application. So let's create the pipeline and I'm going to use classic editor. I'm
38:47
going to use a classic editor. I'm going to get to the aml in some time, but let's
38:53
keep with this one. So I'm going to use this one, this repository main branch. That
38:58
is fine. And I'm going to say, okay, I want to build Docker containers. And in
39:05
In this one then I need to select following. I need to select my Azure subscription
39:10
So I'm gonna select subscription. Eventually. Okay, here we are. Alright. Azure Container Registry. It should recognize my C-Sharp Container Registry. Alright
39:24
This is good. I want to build image based on the Docker file
39:30
Everything cool. I want to push this image to the same repository
39:35
to some same container registry and This is it like basically I just selected the container registries. I want to use I want to do save and queue
39:44
save and run and this should create a New pipeline for me that is currently the point so let's look at the tasks. What is happening with it
40:01
Is still preparing let's see what's going on with my Okay, this one also finished, so this is cool
40:09
I have already this in place, and this is currently running my containers
40:16
So I have Kubernetes in place. I have everything ready for the second stage
40:24
While this is happening, let's do another one, and I'm going to do a web app
40:35
let's go with app service oh never mind okay so in the web app i'm gonna go with uh again same resource group i'm gonna go with uh i don't
40:54
know seeing sharp for this one available yes it is cool I'm gonna go with the
41:05
publish with the doctor containers I'm gonna go with Linux I'm gonna go with
41:09
West Europe just to be closer to my original location so everything runs
41:13
more smoothly I'm gonna change leave this at the default settings single
41:18
container all right we're going to use a quick start that is fine and just
41:26
review and create we are in a hurry we want to do this as soon as possible so
41:31
let's create it and see where this is going on okay so the build image and
41:36
push image are completed and we have our containers in place so let's go to C
41:43
sharp corner. Let's go to container registry and see inside our repository
41:50
we have a new repository, no demo, with the tag 126, but it's just
41:57
randomly generated. And we have our container ready. It's there. It's ready for the setup. Okay, that's good. App Service is done as well. Now, next
42:11
Next thing I'm going to do, I'm going to go and if I refresh, I should see it's your services
42:17
Okay, this one is done. All right. I'm going to go with the Kubernetes and in the Kubernetes section, I'm going to do Deployment Center
42:28
Now, what Deployment Center will do, it will give me an option to connect my code and set up the pipelines for it
42:36
So I'm going to start with Azure repos. And I'm going to say, all right, this is my DevTalks
42:46
I'm going to use Node Demo. That's a good branch. That's fine
42:52
Let's go. It automatically recognizes my Docker file. So I'm going to go with that
42:59
I'm going to go OK. I'm going to use OK, create a new namespace
43:05
And I'm going to use existing container registry. And you're good to go
43:11
I'm going to say, OK, create the pipeline for me. Let's see what happens
43:17
This is a really cool way to set up the deployment. It's easy
43:24
No sweat about it. You just say, this is one service. This is the second one
43:30
Go connect them. And it's really nice that Azure basically does everything
43:35
for you. You don't have to sweat about it and it's easy and quick to set up
43:41
Okay, in the meantime, let's see what's going on here. This one started out
43:48
No, it didn't. Let's see my configuration is going on. That is fine
43:58
Okay, while we are waiting for this to happen, I'm gonna go to the web app
44:07
So for the web app, we can do similar things. Now, this is how we can set up the deployment for, we can just pick up the private registry
44:24
we can provide the server URL, login information, and so on. I'm not going to do it here
44:29
I'm not going to set it up from here. I'm going to actually set up the pipeline, release pipeline, for this to actually happen
44:36
I'm going to set up the release pipeline. No, sorry. I'm going to say, oh, this is actually generated, right
44:47
All right. So this means that my, all right. Good thing I didn start yet because it will complicate things So what happened is basically C when I set up the Kubernetes to do automatic connection it actually started it out
45:06
And this is the CI part. So this is building containers. And after that part is done
45:13
it's going to do a deployment as well. So let's look at this one
45:17
So remember the first task that we did. You remember what we had in there
45:22
We have two tasks. We had the build image and push image to my container registry
45:28
So basically, this is the same task. This is the same one I created initially and that I want to use to deploy
45:35
Now, why am I showing you this? Because it's always going to be the same task
45:41
It's always going to be the same build and push an image to a container registry
45:47
No matter what service in the background we're going to use, no matter what containers we choose to run
45:53
is it Azure Container Instances or Kubernetes or App Service or Service Fabric
45:58
we are always going to build a container and place it in a container registry
46:02
Then next step will be different because we are going to either deploy it to different services
46:11
So that part is different because service configuration is different. But the build part, creating the image and pushing it to container instance is
46:20
uh sorry continue registry is always going to be the same step so that that's what i wanted to to
46:27
tell so uh i can basically the first one the one i created i'm gonna just delete it i'm going to
46:34
delete this one i'm gonna say yeah i don't want this one anymore i have different one one that
46:42
that was already created. So if I go to C-sharp, and I see that this one is done
46:50
everything is fine, everything is running. In the meantime, release started for this one as well
46:57
And actually, the release is finished. So if you go to this task, to this release, and say, OK
47:05
let's see what's happening in there, what's going on in there, I'm going to have multiple tasks
47:11
I'm going to have a kubectl for set image pullsecrets, generating Kubernetes manifest file
47:18
and finally, manifest deploy. So this is basically the task. If I go back to my Kubernetes cluster
47:28
and go to service and ingress, I should see, here it is
47:33
dev talks, some random number. because this is what happens when you do this deployment center preview. OK
47:43
So basically, when you do this, it creates this random space for you
47:49
So I can see the service. And if I go to this IP address, actually, my configuration is on port 8080
48:00
so I need to change the port. Here we are. Hello, world
48:03
All good. All fine. All peachy. All right, so let's go to the next one, next release
48:12
I'm gonna, based on this build, the build we previously had, I'm gonna create initial release
48:20
So I'm gonna do new release. And I'm gonna say that it's basically
48:26
Azure App Service deployment. All right, this is fine. I'm gonna say that it depends on the previous build
48:36
So it can be triggered automatically based on that. So whenever this one is done, it will automatically
48:46
start this one. All right. Now what happens here is I'm going to say that I want to deploy. Fine
48:58
All right. I didn't do something right. This is here. OK. Here
49:05
I need to select subscription. I'm gonna say that I'm gonna do different deployment
49:10
I'm gonna do deployment web app for containers on Linux. I'm gonna select my app service
49:16
So this is C sharp corner, registry name. Okay, I need to go to C sharp
49:23
All right, container registry. I'm gonna use this one. So this is the registry I need to go to
49:32
And I need to provide repository name. So what is my repository name here
49:43
Let's say that it's going to be this one. Let's say that it's going to be node demo
49:51
We're going to use that one. And we're good to go. We can start the deployment
49:56
And this one will actually deploy my container, the same container, it will deploy it actually
50:06
to app services time. So we can go to the app service and just check it out
50:14
Right now it should still be like the default placeholder for the service
50:20
Nothing is deployed yet. And this one is cured. It's running on agent, and it will take a while to set it up
50:29
Now, all this is cool. All this is fine. But there is a better way to set up containers
50:36
and set up the pipelines. I recommend you always go with the Yamaha pipelines
50:42
There are a couple of reasons why. But main one is basically you want
50:47
to treat your pipeline same way as you treat your code. And this is exactly what you get with the YAML pipelines
50:54
YAML pipelines are going to set up your pipelines and store them in your source control together with your code
51:02
And you can see the versioning and everything else you would have for every other file inside your repository
51:09
So this is really cool part where you are handling your deployments as a code again
51:16
You have much better control over it. You have much better insight in the history
51:20
And also, depending on release branches and like feature branches and different versioning options that you can have, you're going to have different options to run your pipeline
51:36
Because pipeline is, as it is treated as a code, it's going to be in the same state as a previous version of the code was
51:45
And you're going to have a situation where if you are going to previous version of the app for some reason to verify something or you need it for some specific reason, and you need to roll back to that specific version and you change your pipeline multiple times since then, you don't have a problem because the pipeline, when you go to that specific version of the code, is going to be in the same state as it was
52:14
when that specific version of code was in use. You don't get that with those classic pipelines
52:19
because classic pipelines are always going to be applied as a latest one
52:24
All right. Too much talk Let see how this actually happens So I going to do a new pipeline And I going to say I going to use Azure repos
52:36
This is the repository I want to use. And I want to deploy it to Kubernetes service
52:41
Now it's going to ask me for a couple of information. It's going to ask me for information where I actually, what I want to use
52:49
I'm going to select my Azure subscription. Okay, I need to verify it
52:54
So this one, I need to verify my MFA. All right, that's just good
53:09
All right. If it sees my cluster, it does. I'm going to do a new namespace
53:17
We're going to call it C-sharp. C sharp, alright. Container registry is gonna be C sharp. Everything good
53:31
everything fine. Let's go. Configuring my YAML file. Now while we're doing this, I'm
53:41
gonna show you this. So basically what we have is really simple. We have app
53:46
folder, docker, ignore, docker file, package lock, package.json, server. That's basically really simple nothing too much in it so once I create the YAML file it
53:58
generated everything for me so I have multiple tasks I have stages in place
54:02
everything is ready what I need to do is save and run now notice that it will
54:07
tell me that it will add these three files to my my repository I'm fine with
54:13
that and I'm gonna say say alright save and run all right that started out now let's check what's going on with my app service
54:31
so this one should finish by now and if I refresh I have an error for some reason
54:39
Let me check what's going on. C sharp. No, that's one. App Service
54:47
Let's see what's going on with my container registry. So, it'll tell me why it doesn't run
55:02
So, it doesn't recognize the login for some reason. All right. Let's try this C sharp image is going to be this one, tag is going to be this one, and we go save
55:19
Let's see what happens now. In the meantime, let's see what's going on with my build
55:26
Okay, it's building, it's pushing. All right
55:36
Again, this is the same task. You can see it's only in different shape
55:41
We are not using classic pipeline. We are using gamma pipeline. But again, we are always going to build our image
55:48
and push it to container registry. It's always going to be the same step there
55:52
OK, what's going on now? Let me stop this one because it will, oh, no
55:58
This is actually a good one. This one is going on. This one
56:04
All right. Pipeline. No demo. All right. Okay. The second stage started
56:10
So it started going to my Kubernetes cluster. Let's see what's going on with this one
56:20
Let's refresh. let's see what happens okay I messed something up somewhere we should continue registering
56:44
does it read it yes it does all right oh let's see what's going on with the other one we don't
56:57
too much time i'm already past the date so let's go with the services we have a new cluster so this
57:06
one is the new one the new instance of the service uh again i need to set up say it's gonna run 80 80
57:16
and we have it ready now quickly i'm gonna do something uh i'm gonna in my pipelines
57:25
so if i go to my pipelines i'm gonna release i'm gonna delete everything so i'm gonna delete this one
57:39
why because i don't want them to be triggered i'm gonna delete this one i'm gonna delete this one
57:44
and i'm only gonna use the the yaml one so uh so i'm gonna delete this one as well
57:51
and then I'm gonna say all right what I'm gonna do right now is gonna be I'm gonna go to my code
58:06
and I'm gonna do change in the server so I'm gonna edit and say hello seeing
58:16
charm corner if I commit this will automatically start the pipeline and the
58:26
pipeline should finish relatively soon so it's doing a build automatically build
58:32
stage started let me see what's going on with this one in the meantime
58:58
container classics this refresh okay download it download it why
59:16
never mind let's go to the pipelines this one is almost done building is almost done
59:28
All right. Building is usually takes a bit. Now, the coolest part is the deployment should be done almost instantly. Why? Because, okay, my container obviously has some kind of dependency. It needs some kind of engine down there to tell you like what's required. It's going to have a Linux server, it's going to have an Nginx and so on
59:54
So those components that are pre-required for my app to actually run
59:58
What happens now, basically is that part is not going to be deployed next time
1:00:04
because it doesn't actually need to download everything for my deployment. It only needs to deploy what has changed
1:00:13
This is also what's really cool about the containers is the speed of deployment that it's bringing
1:00:18
because it's basically, look at it, like imagine that you're building like complete container
1:00:24
and taking everything with operating system and everything to deploy. It actually doesn't do that
1:00:29
It actually creates like download effect, deploy. Everything is done. For some reason, this task is still running, but it should be finished
1:00:37
So if I go to my cluster and if I refresh here, here we are
1:00:44
Everything's changed. It doesn't take a lot of time to deploy a new container
1:00:49
because everything is already there. Everything is already pre-built. and we are only deploying these layers
1:00:58
these packages that have changed since the last deployment. Okay, so that's basically it for what I had today
1:01:07
I don't know if you had any questions. All right, Mustafa, that was a lot to cover in just 45 minutes
1:01:14
Yeah, I tried to speed it up as much as possible. Yeah, that's great
1:01:19
I think you started from very scratch and what it is and you went on to Azure, did pipelines, right
1:01:24
so definitely a great session uh demo dimmers are always there right so we just can't ignore them
1:01:31
so uh we we have we do have many questions uh let's take a few of them uh if it makes sense
1:01:37
um these are going generic maybe let's take this one which restart policy is typically the best
1:01:43
choice for long running task that service request that's really difficult to say like yeah
1:01:52
It really depends on the use case. There are many different options like what kind of tasks
1:02:00
what kind of services you run. What do you use for the long running tasks in the first place And also what are the performance issues Like do you actually need to restart them because they get stuck or uh you need to occasionally refresh or for the each run you
1:02:19
need to restart the service it really depends on multiple factors before you can reach out to me on
1:02:24
twitter and i'll try to to to to yeah i just see more more of more help i wonder muster why don't
1:02:31
you have your your twitter name in the in in the name usually people have it right yeah definitely
1:02:40
okay so i have it somewhere i think in the first slide
1:02:45
that i skipped through i usually have it i think let's see
1:02:53
yeah here it is so here's mine yeah also also i edited your names
1:03:01
That's nice. That's nice. Okay. Thanks. All right. So we have one question. Let's take one question from this
1:03:10
Patricia, she says, do we have option to handle private Docker container
1:03:16
Absolutely. This is exactly why we have Azure Container Registry. This is basically our private Docker Container Registry
1:03:23
We have our own closed world. Like what we deploy in our private container registry, it's not accessible to anyone else
1:03:33
This is our Docker container registry, like private completely. And we don't have it like we don't share it with anyone else
1:03:40
That's great. Let's take one final question. It says, can we create service fabrics for Linux
1:03:46
I think it's Linux. I don't think so. I think this is only for Windows as far as I'm concerned
1:03:53
I don't have experience to the requirements I had. was running it on Windows always
1:04:00
Things might have changed recently. The speed of changes in Azure are incredible
1:04:06
Like every time I start working, I see something new. But let say that as far as I know no it only Windows OK so we have many more questions They are more related to containers Doctors I don think we have a lot of time to take them
1:04:26
Does it make sense? Is there any possibility to do AKS, MySQL, DB, POD, replication, and Azure from one region to another
1:04:33
Ideally, it should be possible. Replication from one region to another? Well, it's..
1:04:41
Yeah, yeah, definitely. If you have like EKS on one side and EKS on another side and have like ports running, the database itself, it should be able, you should be like, it should behave like any other MySQL server whatsoever
1:04:56
Like if you will have it running in any other option, it should be able
1:05:01
Now, what you need to consider in this case is how you set up the storage for your container
1:05:06
Because the default storage for containers is not persistent. Each time you do deployment or rest of the service, you're going to lose the data
1:05:16
So you want to mount some kind of persistent storage for running databases in containers
1:05:23
Definitely. And before we go, we have, I think, one thing you would definitely like to go and talk is your very famous book
1:05:32
That's on Azure Networking Cookbook. Okay. Thanks for sharing that. Yeah, definitely go and check that out
1:05:39
must have said it has been downloaded many many thousand thousand thousands of times
1:05:44
right uh it's free right must have it's entirely free the book is free and it's more available on
1:05:50
multiple languages uh besides english you can download in german japanese spanish and french
1:05:57
that that's amazing so definitely go ahead and check this book by must have he loves to write
1:06:03
books that what he's known in the community right so that was a great session before we go ahead and
1:06:09
continued like apart from all these books mvps technical sessions your dvd full-time job what
1:06:15
are your hobbies what do you do apart from all this uh pretty much nothing else like
1:06:22
makes sense you don get time right so basically i worked for for for for a company full time i do my eight hours diligence I try to be engaged in communities
1:06:37
So I try to at least twice a week deliver a session or write something online or something
1:06:45
So at least twice a week I have some kind of community activity, sometimes even more depending on the period
1:06:51
and on top of that I usually write at least one book
1:06:56
at a time so that's kind of like taking a lot of my time. Let's say
1:07:02
that besides that I enjoy playing guitar, bass guitar to be exact
1:07:07
and also enjoy occasional Xbox game. That's great. These things that we do
1:07:18
right? Playing guitar, Xbox Which is the favorite game? Flight Simulator, did you try that one? Flight Simulator
1:07:25
Oh, that's, yeah, that's an amazing job. Flight Simulator is an excellent game that came out
1:07:33
last year and it's a game changer completely. Like the details Microsoft delivered with that one
1:07:40
like it's completely insane. It's bringing virtual reality to our homes. Yeah, I've seen people sharing a lot of screenshots and their experience
1:07:49
Brilliant lips are amazing. I hope I get some time to play with that
1:07:53
Alright, Mustafa, any final things you want to conclude before we... I took enough of your time. I'm very proud
1:07:59
No, it's okay. That will be it. Thank you, everyone. Stay healthy
1:08:05
Yeah, thank you so much, everyone tuning. Thank you, Mustafa. Thank you so much for your time. I always love to host you. And I think in the next couple of quarters
1:08:11
I'm hosting you a couple of more times too. uh one definitely for the IT security virtual conference that definitely Mustafa is helping us
1:08:19
to organize so thank you so much for that please go ahead and submit your sessions uh if the call
1:08:24
for spirit is still open we would love to host you there too so thank you so much everyone who
1:08:28
has joined uh we'll see you next week some other live show thank you have a nice day and yeah thank
1:08:33
you bye bye


