Microservice Deployments on Azure Container Apps using Visual Studio

Darshan Raviprakash
Version 1
Published in
3 min readJan 4, 2023
Photo by Teng Yuhong on Unsplash

Background

Is your application based on microservices architecture? Are you looking at the deployment of multiple microservices? If so, there are many options to host such as Azure Container Apps, App Services, Azure Functions, Azure Container Instances and Azure Kubernetes Service.

There is no perfect solution and is to be opted as per the use case. Below I will showcase .NET API deployment using Visual Studio on Azure Container Apps. Follow me for further articles where I do the comparison between various services mentioned above.

Azure Container Apps enables you to build serverless microservices based on containers. Key features of Azure Container Apps are as below:

  • Optimised for running general-purpose containers
  • Powered by Kubernetes and open-source technologies like Dapr, KEDA etc.
  • Enables event-driven application architectures by supporting scaled-based traffic and pulling event sources like queues etc.
  • Hosting long-running background processes

Applications built on Azure Container Apps can dynamically scale based on the following characteristics:

  • HTTP traffic
  • Event-driven processing
  • CPU or memory load
  • Any KEDA-supported scaler

Azure Container Apps enables executing application code packaged in any container and is unopinionated about runtime or programming model. With Container Apps, you enjoy the benefits of running containers while leaving behind the concerns of managing cloud infrastructure and complex container orchestrators.

We will take a look at the deployment of .NET WEB API to Azure Container Apps using visual studio in the below steps:

Pre-requisites to deploy .NET Web API to Azure Container Apps

  • Get Visual Studio 2022 with the latest updates. Ensure VS is the latest as deployment to the container app is available in the latest version.
  • Install Docker Desktop

Once you have the above installed and set up and developed an API in visual studio, it’s time to publish. Create Publish profile in Visual Studio. Select the Azure Container Apps(Linux) as shown below.

Create Azure Container Apps by selecting Resource Group and Container Apps Environment. Refer to this link to create an Azure Container App through the Azure portal.

Every Container App runs in a container app environment, and this allows multiple apps to run side by side, and this helps in administrative tasks like networking and resource configuration.

The Creation of Container Apps may take several minutes. After that select the newly created Azure Container App and click on Next.

Now, we will have the option to select or create Container Registry. The Registry is where we store container images and artifacts. Once Container Registry is created and selected, we are ready to create Publish profile.

· Publish the Web API to Azure Container Apps.

Select the Publish Profile selected previously and click on Publish button.

Publish will take a couple of minutes. Once publishing is successful, API endpoints can be accessible via the containers.

Conclusion

This article is a starting point for you to try out the Azure Container Apps deployment of .NET WebAPI using visual studio. This is a brief short article and follow-up articles to come on an in-depth assessment of various options available.

About the author:
Darshan Raviprakash is a Senior .Net Developer here at Version 1.

--

--

Darshan Raviprakash
Version 1

Darshan Raviprakash is a Microsoft Technical Lead currently @Version1 with experience in microsoft technolgies