 All right, everybody, how's it going? .NETConf 2019, we got Hamidah here to talk to us about microservice.NET microservices in Docker. Take it away, Hamidah. Hello. Hello, everybody. Hello. My name is Hamidah Rebei. I am Microsoft MVP in Developer Technologies, and today I will present a session about architecting my microservices in .NET Core and using Docker ecosystem. So I will share my screen to start. Not showing up yet. Oh, there it is. So during the session, we learned how to work with the microservice architecture pattern and Docker containers using the .NET Core 3 platform to build distributed system. We will start by talking about the transition from monolithic architecture to an architecture that consists out of small and independent services that you can scale independently on your different software cycle from development test to production environments. Before talking about microservices, we need to understand the difference between traditional application approach and microservices application approach. Any application is built as a collection of services and can be developed, tested, versioned, deployed, and scaled. For monolithic application, scale is done by cloning the app on multiple server. Here, if we say server, we means VMs, virtual machines. But for microservices, scale is done by deploying each server independently with multiple instance across servers or VM. We will start by presenting monolithic application approach based on a live application here. We have the presentation live that presents for us UI, user interface. It can be web, mobile, or desktop application. The service layer is responsible for handling HTTP requests and they're spending with either HTML or Gism or XML for web APIs, for example. The business logic is here with the treatment, we can say the processor of our application. The database access layer is a data access object responsible for access to the database. Despite having a logical modular architecture, the application is packaged and deployed as a monolithic. Monolithic application are more of a single complete package having all the related needed components and service encapsulated on one package. But for microservices, the idea, it's really simple. It comes here to split your application into a set of smaller interconnected services instead of building a single monolithic application and each microservices is a small application that has its own exagon architecture consisting of business logic along with various adapter. So microservices can expose or as for example for the case of API, RPC or message-based API and mass services consume APIs provided by other services. A microservice are deployed and dependently with their own database their service. So they're underlined. Here, as you can see, we have many technologies and many patterns. But if you want to use a microservice, we have more and more patterns like bounded context that we know before us. We use it like domain-driven design, secure s, domain events, mediator. We have many, many patterns that we still can use it with microservices. And we have many technologies. Today, we will present Docker containers for example, and we'll talk a little bit about the orchestrator. Developer consider microservice as architecture style that promotes the development of complex application as a suite of small services based on business capability and multiple independent subsystem in the form of anonymous services. And the following picture show the microservices architecture style. Here, we can find the various components that we can find in a microservice architecture. For example, we start from the clients that communicate with API gateway that serve as a client and points. We'll talk about that after. And we have the identity provider that manage the identity information. It's related about authentication within the computer network. And the API gateway is communicated with our services. Here, we have four, for example, services. And we find service discovery, management, static content. It's like a page and CDN. Here, we'll talk about the importance of API gateway in microservices. It's a seat between the client and services. It acts as a reverse proxy, routing the request from the client to the services. It may also perform various cross-cutting tasks such as authentication, we find SSL offloading, SSL termination, rate limiting, et cetera. If you don't deploy a gateway, the client must send request directly to the front-end services. It creates a coupling between the client and the backends and the client needs to know how the individual services are decomposed that makes it harder to maintain the client and also harder to refactor the services. Now we need to deploy our services. We consider that we created each service. So we build our microservice architecture. And to do that, we will use, for example, Docker container. So what's Docker? Docker is technology that allows the creation and use of container and server developer and the sysadmin to easy deploy their application in sandbox to run on the host operating system. To start our demo, we need to have a Windows 10 professional enterprise because we can't install the Docker desktop for Windows in Windows 10 home. We need Visual Studio 2019, but 2017, it supports Docker and Docker for desktop for Windows and Docker tools. Now we'll try to start creating ASP.NET Core 3 solution, but before we will try to architecture. I will go now to the demo. Here, I have an old solution created from four years ago. This old solution is based on Wave API created by Wave API, the old way of Wave API. As you can see here, we have the service layer. It includes many controls. I have many controls to manage my application here. And we have the business part here. It's divided by application and domain. We have the infrastructure, this is the database. It's a layered application. And I have the web parts. It's a web AngularJS inside NVC4. It's all the application, as I said. And I would like to do a microservice architecture here. And to start here, I created a blank project here. It's a blank project and already created some web API for my APIs, but we will do that again now. So here in Visual Studio 2019, I have a blank solution and I will add a project here. And we choose isp.net web application. For example, for me, I choose here, I have configuration service user accounts. I go back to the old one. I will choose, for example, here, contact API. I would like that this control will be separate services as API. So I would say here, contact service, for example. And here, create. And here we have isp.net core three. That's already launched from today's. We will use this. And here, as you can see, in advance it starts, we are requested to say enable docker support here. Requires docker the desktop. Here, I have the application, the docker application desktop. As you can see here, it's docker is already running. And here we can choose between Windows and Linux. For me, I will keep Windows because I am in Windows container here. But if we change here to Linux, we need to switch to Linux container in docker desktop. Here I will choose API. We click on create here. And here, as you can see, our docker file is already created. And if you want to check here, the app settings. So we have on what we need to launch docker. And here we can launch docker here. We click on docker to be able to see, to deploy my web API on docker. My tool will be in my machine locally in docker desktop. So here it's already launched. Okay. So because it's not the... We need to say that's the set up project to be primary one. So because it was on the web. But here we can launch docker and we get it. So we were waiting just to see. Okay. Okay. So we will try to check the image in docker. Waiting to work. Here we go to comment line. We say docker images. And here we have our contactors, our image. This is the image on docker. And we can create more than one image for the same web API. It's really important than one of a bunch of docker containers and microservices. Sorry. And we can do the same thing for web API, for the presentation layer. For example, if you want to create... If you want to create, for example, here, I want to create a NPC new project. And we can do the same thing here. And you can say, for example, here, this is web part for service, for example, you can create and you can choose MVC here. And we check enable docker support. But we can't create. We can have the same thing here. The docker file will be created. We set it as start the project. And we can launch it on docker. It will be a web application. But it will be... If we check again docker image, we will find this project. And we try to check here. This is one, first one. This is the other one, but we find it. So we go back to our application presentation here. So in previous demo, we started from an old application that includes many layers, many services, too, in the service layer. And we created a new solution, blank solution. And we added... We are able to add more and then API and web application. And this is one to start our microservices. And we deploy this in a local. But we needed to deploy this in the cloud. And in Azure, we talk about cloud, we talk about Azure containers in Azure. Here we have the app services that we know to deploy many applications. The service fabric is... It's an container and orchestrator, too. Kubernetes, too. It's an orchestrator and container. And we have a container instance and batch. In our case, we'll try to use a registry, container registry in Azure to deploy. It's easy from Visual Studio to do it. So we go back to our application just to show you how we can do that. So we start from here. We can choose a web or any web API application. Here we choose publish. And as you can see here, we find our publish target that we can use it. We have the app services, the container registry. The container registry is dedicated to deploy our images to push them into Azure. And we can create a new one here from Visual Studio. It will be created in our Azure portal. Or we can select from existing Azure container. If we already have the container created in Azure portal, we can add it. And we can use the Docker app. It's dedicated to Docker. Or we can use a custom server that we configured in a hoster. So here we click create. We create our profile. And we give the DNS prefix because here we will create a name and our subscription. We define research group and click on create part here. So it's deploying stack. It takes a few times because it's deploying into Azure to create our container. Container registry includes our container that you need. It can be grouped using your research group here. And it's here. When we click to publish, it will be published in our portal of Azure. And we can after go through CI CD pipeline or create app services to its web application to show it. Or if we include Swader, for example, for IPI to display our IPI, what we have. So we go back to our presentation here. So when we talk about containers, Docker, we need to talk about Orchestrator in Azure or here. For example, here we have two known Orchestrator in Azure, but the use is different. So if we use Kubernetes with Docker or Service Fabric, you need to know the choice. It depends from your microservice. It's really based on container only or it's based on plain process, state of services. And you'll find the Linux and Windows. It's the same. It's not a problem. And as you know here, Kubernetes, it's open source for automation deployment, scaling and operating of application. And we can pay in Azure for VMs in cluster and to create, to have the space, pay as you go here. And it's IS container infrastructure. And the same for Service Fabrics. So this session was an overview about microservices with Docker. Microservices allow to evolve, deploy, and scale part of application independently. But we can't use this architecture for small application because it's dedicated to distributed software challenge and a challenge for scalable and long-term evolving application. Thank you. If you have any questions, please. And you can send your questions to my Twitter and you can find more detailed source code in my GitHub about this example and other example. Hey, Amida, thank you so much. We've been looking on the chat and we don't see any questions. So thank you for sharing your Twitter. So again, if anybody has any questions, go ahead and use Twitter to ask Amida those questions. The GitHub repo is right there. So we can share that. Thank you so much. That's great. And thank you so much for taking the time to share your knowledge and your experience with us. We really appreciate that. People like you is what makes our community strong and makes us better. All right? Yes. Awesome. So all right, everybody, we are going to be going into our next speaker. And let me check that here. We have Santosh talking about Cosmos DV for ASP.net. So we'll get that going here. We'll be right back.