Posts

Azure Open AI: Generating SQL Statement from the Prompt and executing it

Image
In this article, we will implement the process of generating SQL Statements from the simple English language prompt.  AI Prompt is an input send to the AI model to guide its response. In a simple language we can define Prompt as a beginning of the conversation so that the appropriate response can be received. The accuracy of the response is depending on the appropriate prompt input to the model. The AI model is capable enough to understand and compile the prompt and generate response. In different context the prompt can be set in different format, e.g. Technical Prompt for expecting technical answers, Creative Prompt for expecting a story or a poem, and the Simple Prompt for simple translation. OfCourse for the accurate response the prompt must be accurate.  In the Line-of-Business (LOB) applications we have the data mostly stored in the Relational Databases. To extract information from various table from database, we need to write complex queries with joins across tables (if ...

Azure AI Search: Indexers and Indexes using C# Code

Image
In this article, we will implement the Azure AI Search Service Data Source, Index, and Indexer creation using the C# code. We will implement the process using the ASP.NET Core 9 APIs. The application targets not only to configure Azure AI Search but also the application exposes API endpoints to perform search operations on the Data Source configured with Azure AI Search.  Formally known as Azure Cognitive Search, the Azure AI Search is an enterprise-ready information retrieval system. We can build the heterogeneous contents information ingestion into search index e.g. Documents, Relational Data, etc to query so that the data can be retrieved. Teh Azure AI Service is designed for high-performance and scalability. Some of the features of Azure AI Search are as follows: Rich Indexing capabilities with content transformation, data chunking, vectorization for RAG. Vector and full-text search for data retrieval with efficiency. Advanced Query syntax Integration with other Azure Cloud hos...

ASP.NET Core 9: File Upload using APIs with IFormFile and Anti-Forgery Token

Image
In this micro article, we will be discussing the important change in File Upload feature in ASP.NET Core 9 for IFormFile. I have already written an article for File upload using Minimal APIs on this link . This article is an enhancement in that article. In ASP.NET Core 9, a strict anti-forgery validation for file uploads for IFormFile. While using Minimal APIs endpoints, for file upload using IFormFile or IFormFileCollection, we need to pass an Anti-Forgery token into the HTTP request header. This token will be validated before completing the file upload operations.   The Minimal API must use the Anti Forgery Token Service as well as the Anti Forgery Token Middleware else the exception will be thrown. The reason behind the change is for the security precaution for the API that consumes data posted form the form. Although we can disable the Anti Forgery token it is not recommended, please avoid it for the production.  In the Minimal API project created with ASP.NET Core 9,...

ASP.NET Core: Using YARP (Yet Another Reverse Proxy) for ASP.NET Core Apps to create API Gateways

Image
In this article, we will understand and use the YARP (Yet Another Reverse Proxy). This is highly customizable reverse proxy library for .NET. This is especially designed to provide easy but yes secure, scalable, flexible and robust framework for modern ASP.NET Core API Applications. The ASP.NET Core is one of the bests technologies to design, develop highly powerful, secure, and high performant web applications. Being a cross-platform technology, we can build complex server-side solutions using ASP.NET Core. Once of such complex solution is building Microservices application or the server-side application with multiple autonomous APIs. In such solutions we need to host these Microservices or autonomous APIs on separate hosts with separate IP addresses. With multiple services/API hosted, the client application like Browser Clients or Mobile Clients need to know host addresses of each of the service. This increases the complexity of the entire solution. E.g. if any of the service is chan...

ASP.NET Core 9: Implementing Distributed Caching using SQL Server

Image
ASP.NET Core is one of the best technologies for building modern web apps. Since it is cross-platform and lightweight, it's been used by several applications and products for building applications. Most of these applications are high-traffic and they run on multi-server deployment with load-balanced across these servers. In such environments managing data traffic for reading data from database server(s) with respect to various requests could be a challenge. In the deployment architecture the data availability must be guaranteed. Another important features of ASP.NET Core is that the use of ASP.NET Core in Microservices architectures. In case of Microservices, it is important to part of the application pattern to share data across Microservices using Asynchornous communication across them.  To handle the high data availability as well as data communication across Microservices implementation in ASP.NET Core applications, we should consider using the Caching feature of ASP.NET Core. ...