Using Azure Container Apps for small .NET services

Posted: (EET/GMT+2)

 

Azure has many ways to run containerized applications, and the Azure Container Apps feature is one of them; it is a more light-weight option than full AKS, for example. Now, if you need to run a small .NET service in Azure, Azure Container Apps might be your choice. Let's call it "ACA" for now.

ACA runs containerized applications, but avoids most of the operational setup normally needed with AKS.

For a small ASP.NET Core API, the quick path is az containerapp up. Here's an example:

az login

az extension add --name containerapp --upgrade

az provider register --namespace Microsoft.App
az provider register --namespace Microsoft.OperationalInsights

From the application folder, deploy the service:

az containerapp up \
    --name my-api \
    --resource-group my-containerapps-rg \
    --location westeurope \
    --source . \
    --ingress external

The command builds the container image, pushes it to Azure Container Registry, creates the Container Apps environment if needed, and deploys the application.

After deployment, the command prints the application URL.

This is good for getting started, but review the generated resources afterwards. The defaults are useful for a first deployment, not always the final production configuration.

You can check the deployed app with:

az containerapp show \
    --name my-api \
    --resource-group my-containerapps-rg \
    --query properties.configuration.ingress.fqdn

And to view logs, say:

az containerapp logs show \
    --name my-api \
    --resource-group my-containerapps-rg \
    --follow

Container Apps is especially useful for:

  • small HTTP APIs
  • background workers
  • internal tools
  • event-driven services
  • services that do not need full Kubernetes control.

If you already have a Dockerfile, keep it in the project root. The deployment command can use it during the image build.

For production, also review scaling, secrets, managed identity, networking, and logging.

For example, assign a managed identity:

az containerapp identity assign \
    --name my-api \
    --resource-group my-containerapps-rg \
    --system-assigned

This lets the application access Azure resources without storing long-lived secrets in configuration files.

Azure Container Apps is not a replacement for every AKS environment. But for small .NET services, it is often enough infrastructure without becoming the infrastructure project itself.