Secure .NET microservices with Azure Container Apps and DAPR

Albert Starreveld
VX Company
Published in
6 min readNov 1, 2022

--

The concept of microservices sounds fairly easy. And it is. Until you start adding requirements. For example, here are some common real-life scenarios:

  • We want to authenticate users with SSO (OAuth2/OpenID Connect). And we don’t want to store access tokens in the front end anymore because it’s 2022 and we’re worried about the third-party cookie problem.
  • We want to scale out and in instead of scaling up and down. And we want to scale automatically.
  • We want to have service-to-service communication. (Don’t ask why this is a common requirement…)
  • We want our developers to be able to work on a microservice locally without having to spin up and connect to infrastructure that runs in the cloud. (Like Azure Service Bus, for example.)

I tried addressing these issues in a proof-of-concept that’s described in this article.

Fortunately, there’s no need for a tailor-made, one-of-a-kind architecture to solve all this. Microsoft has this open-source GitHub repo called eShopOnDapr. It demonstrates what a distributed app in a container app environment looks like. That’s also the base of the solution I’m describing in this post. This is what it looks like:

Figure 1: A microservices architecture with DAPR in Azure Container Apps

Authenticating the end-user on the…

--

--

Albert Starreveld
VX Company

Passionate about cloud native software development. Only by sharing knowledge and code we can take software development to the next level!