Often times when working with Azure Blob Storage you don’t want to expose access to the service directly but rather have requests go through your own API. This allows you to control access and hide the underlying service. However, you need to be careful to not put unnecessary extra load on your service during file operations by buffering up- or downloads in memory. You may not notice this at first for smaller files like images, but I can severely impact your service performance when larger files are in play.
Continue reading Streaming File Downloads from Azure Blob Storage through ASP.NET CoreTag: aspnet
Allow Client Credentials Flow in ASP.NET & Microsoft.Identity.Web
For authenticating Entra ID users & services in ASP.NET you’re probably using the Microsoft.Identity.Web with some initialization code looking something like this in your Program.cs:

This will configure authentication based on the values stored in your appsettings’ “AzureAd” section. And it should work fine with “normal” users, but it will not accept Tokens from a Client Credentials Flow that might be used for Service-to-Service communications.
Continue reading Allow Client Credentials Flow in ASP.NET & Microsoft.Identity.WebService-to-Service comminucation with Refit & Client Credentials Flow for Entra ID
For a recent project I needed my ASP.NET Core backend service to talk to an external license server using the Entra ID Client Credentials Flow for authentication. For these scenarios I like using Refit to generate the required http client logic. And adding auth for Entra ID is pretty straight forward as well if you know which libraries to use.
Continue reading Service-to-Service comminucation with Refit & Client Credentials Flow for Entra ID