We will learn about the Containerization of .NET Core Web API using Docker and then deploy it on Azure Container Registry and then run that image into the Azure Container Instance.

Agenda

Prerequisites

Overview

Deploy and Run .NET Core 7 Web API on Azure Container Registry and Container Instance

Implementation of .NET Core Web API

Step 1

Create a new .NET Core 7 Web API

Deploy and Run .NET Core 7 Web API on Azure Container Registry and Container Instance

Step 2

Configure your application

Deploy and Run .NET Core 7 Web API on Azure Container Registry and Container Instance

Step 3

Provide additional information

Deploy and Run .NET Core 7 Web API on Azure Container Registry and Container Instance

Step 4

Add docker support inside the application using Visual Studio

Deploy and Run .NET Core 7 Web API on Azure Container Registry and Container Instance

Deploy and Run .NET Core 7 Web API on Azure Container Registry and Container Instance

Deploy and Run .NET Core 7 Web API on Azure Container Registry and Container Instance

Step 5

Run the application using the docker (Note: Make sure Docker Desktop is installed and running on your machine)

Deploy application image on Azure Container Registry

Step 1

Login on Azure Portal

Step 2

Create Resource Group

Deploy and Run .NET Core 7 Web API on Azure Container Registry and Container Instance

Deploy and Run .NET Core 7 Web API on Azure Container Registry and Container Instance

Deploy and Run .NET Core 7 Web API on Azure Container Registry and Container Instance

Step 3

After that, Create a new Azure Container Registry

Deploy and Run .NET Core 7 Web API on Azure Container Registry and Container Instance

Deploy and Run .NET Core 7 Web API on Azure Container Registry and Container Instance

Deploy and Run .NET Core 7 Web API on Azure Container Registry and Container Instance

Deploy and Run .NET Core 7 Web API on Azure Container Registry and Container Instance

Deploy and Run .NET Core 7 Web API on Azure Container Registry and Container Instance

Step 4

Next, right-click on the application solution and click on publish

Deploy and Run .NET Core 7 Web API on Azure Container Registry and Container Instance

Step 5

Click on Docker Container Registry and press Next

Deploy and Run .NET Core 7 Web API on Azure Container Registry and Container Instance

Step 6

Select Azure Container Registry and Click Next

Deploy and Run .NET Core 7 Web API on Azure Container Registry and Container Instance

Step 7

After that, select the subscription and container registry which we created earlier and click on finish

Deploy and Run .NET Core 7 Web API on Azure Container Registry and Container Instance

Step 8

Next, click on Publish and it will upload a docker image on the azure container registry

Deploy and Run .NET Core 7 Web API on Azure Container Registry and Container Instance

Deploy and Run .NET Core 7 Web API on Azure Container Registry and Container Instance

Deploy and Run .NET Core 7 Web API on Azure Container Registry and Container Instance

Step 9

Here you can see application image details inside the repository section of our container registry on the Azure portal

Deploy and Run .NET Core 7 Web API on Azure Container Registry and Container Instance

Deploy and Run .NET Core 7 Web API on Azure Container Registry and Container Instance

Deploy and Run .NET Core 7 Web API on Azure Container Registry and Container Instance

Deploy and Run .NET Core 7 Web API on Azure Container Registry and Container Instance

Run application image inside Azure Container Instance

Step 1

Create Container Instance

Deploy and Run .NET Core 7 Web API on Azure Container Registry and Container Instance

Deploy and Run .NET Core 7 Web API on Azure Container Registry and Container Instance

Step 2

Configure container registry and a few details related to that.

Deploy and Run .NET Core 7 Web API on Azure Container Registry and Container Instance

(Note: Sometimes we got issues while configuring the container registry and we need to provide admin user access for that go to the container registry and inside the access key section and enable the admin user as I shown below)

Deploy and Run .NET Core 7 Web API on Azure Container Registry and Container Instance

Step 3

After that, we can see Public IP using that we can able to access our application

Deploy and Run .NET Core 7 Web API on Azure Container Registry and Container Instance

Step 4

Open the browser and hit the URL

Deploy and Run .NET Core 7 Web API on Azure Container Registry and Container Instance

Conclusion

Here we discuss the Containerization of applications using Azure container registry and instance. Also, the step-by-step like how to create the resource and run it on Azure.

Happy Learning!