Posts

Showing posts from November, 2024

Azure Blob Storage: Streaming the Azure Blob Storage Videos using Shared Access Signature (SAS) Token in the Blazor Web Application

Image
In this article, we will implement an access of the Videos stored in Azure Blob Storage using SAS Tokens and play these videos in Blazor Server Applications without downloading them. The Azure Blob Storage is a scalable, cost-effective, and secure object storage solution for the cloud. We can storage binary files like documents, videos, spreadsheets, etc. in Blob storage and we can access them as on when we need it. The scalability feature of Blob storage helps to store and access large amount of unstructured data that is encrypted at rest and in transit using Microsoft Entra ID as well as with Role-Based Access Control. The Blob storage offer Durability that is designed with geo-replication options. The Blob storage offers Multiple storage tiers like Hot, Cool, and Archive to optimize costs based on data access patterns.     The Common Uses of Blob Storage are as follows: Data Lake for Data analytics needs. Content Storage and Delivery to serve documents, media files as well as image

ASP.NET Core 8: Using the Conditional Middleware

Image
In ASP.NET Core middleware provides facility to manage the logic in HTTP Runtime Pipeline that is to be executed in each HTTP request. The logic e.g. Exception Handler, Authentication, Authorization, etc. These middlewares helps to define and manage behavior of the ASP.NET Core application. But sometimes we need to dynamically define the behavior of the ASP.NET Core application e.g. if we are developing APIs in ASP.NET Core where we want to log only POST/PUT/DELETE requests then it is very important to detect the HTTP request type and then based on that we need to log such request. In this case, it is very important to manage the behavior of the Middleware based on the condition.       In this article, we will implement a custom logger middleware, and we will load it using the UseWhen() extension method of an IApplicationBuilder interface. We will log POST/PUT/DELETE requests in SQL Server database. The request will be logged in the RequestLogger  table. The table definition is shown i