Posts

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

Power Apps: Using Collections

Image
Microsoft Power Apps is a suite of applications, services, and a is also a data platform. The best use of the Power Apps is that it offers a rapid development environment to build custom applications as per the business needs. Power Apps are extremely useful when your business user needs a customized application instantly as per the need e.g. Construction Supervisor needs an application where he needs to enter in and out time of Construction worker. A Doctor just needs a small and handy application where he can enter medicine subscribed details to the patient. In these cases, although we can provide a web interface application or may be a mobile application to such business users, but these types of apps take a time to develop with high interactive UI using various server-Side as well as Front-End technologies like ASP.NET Core, Angular, React, etc. But what if the customer only needs a simple but yet powerful UI application with desired functionality? The Power Apps is the solution fo

ASP.NET Core 8: Sending PDF Files from ASP.NET Core API to Angular Client and Open the PDF File in Angular Application

Image
In this article, we will implement the mechanism of sending the PDF file from ASP.NET Core API to Angular client application. The Angular client application will download will open this PDF file directly in the browser. It is always important to show the data stored in PDF document from server application to the client application without explicitly downloading it on the client (User may take a call to further save it). In ASP.NET Core we can make use of the Results  class and its File() method to send file from API in the HTTP GET response. This file response can be received by the Angular Client application in the BLOB response type. In the Angular application, we can use the createObjectURL() method of the window.URL interface object to create string URL so that the file can be directly opened in the browser. The Figure 1 shows the implementation type. Figure 1: The Implementation In ASP.NET Core, we cand use the File() method of the Result class to write the Stream into the HTTP Re