Secure .NET microservices with Azure Container Apps and DAPR
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: