How to use identity to secure a Web API backend for single page apps
Dotnetthoughts Blog
by Anuraj
4M ago
This post is about how to use Identity to secure a Web API backend for SPAs such as Angular, React, and Vue apps. Unlike ASP.NET Core MVC, Web API projects doesn’t support the --auth Individual option while creating the Web API project from dotnet SDK. We have to manually add the nuget package references. So first we need to create a web api project, we can do that using the following command - ` dotnet new webapi –name Weatherforecast.Api –output Weatherforecast`. Next we need to add reference of different NuGet packages. I am using Sql Server as the backend. dotnet add package Microsoft.Asp ..read more
Visit website
Getting started with .NET Aspire
Dotnetthoughts Blog
by Anuraj
4M ago
This post is about installing dotnet aspire. The .NET Aspire is an opinionated, cloud ready stack for building observable, production ready, distributed apps. .NET Aspire is delivered through a collection of NuGet packages that handle specific cloud-native concerns. Cloud-native apps often consist of small, interconnected pieces or microservices rather than a single, monolithic code base. Cloud-native apps generally consume a large number of services, such as databases, messaging, and caching. For installing .NET Aspire, first we need to install .NET Aspire workload, we can do it by running th ..read more
Visit website
Building Sql Server Database projects with dotnet CLI
Dotnetthoughts Blog
by Anuraj
4M ago
This post is about creating sql server database using dotnet CLI. Install SqlPackage First we need to install the dotnet tool SqlPackage. We can do it by the command - dotnet tool install -g microsoft.sqlpackage. This tool will helps to deploy the database changes to the database. Create a SQL project To create the Sql project, first we need to install the dotnet project templates. To install the Sql project templates we can execute the following command - dotnet new -i Microsoft.Build.Sql.Templates - this will install the Sql project templates from NuGet.org. Once we install the template, we ..read more
Visit website
Integrate OpenAI API in ASP.NET Core
Dotnetthoughts Blog
by Anuraj
4M ago
This post is about integrating Open AI API in ASP.NET Core. We can integrate Open AI using REST API and using Open AI SDK. Configuring Open AI in Azure Portal First we need to create an Azure Open AI instance and deploy a model. Open Azure portal, search for Azure Open AI. And click on Create button. In the Basics screen, we need to select or create new resource group, select Region, configure Name and select Pricing tier - currently Standard S0 only available. In the Network tab, we can select the default one - All networks, including the internet, can access this resource.. We can associate ..read more
Visit website
Integrate OpenAI APIs in ASP.NET Core
Dotnetthoughts Blog
by Anuraj
4M ago
This post is about integrating Open AI APIs in ASP.NET Core. We can integrate Open AI using REST API and using Open AI SDK. Configuring Open AI in Azure Portal First we need to create an Azure Open AI instance and deploy a model. Open Azure portal, search for Azure Open AI. And click on Create button. In the Basics screen, we need to select or create new resource group, select Region, configure Name and select Pricing tier - currently Standard S0 only available. In the Network tab, we can select the default one - All networks, including the internet, can access this resource.. We can associat ..read more
Visit website
Creating Microsoft Teams Applications with Visual Studio and .NET
Dotnetthoughts Blog
by Anuraj
5M ago
This post is about creating Microsoft Teams applications with Visual Studio and .NET. For creating Microsoft Teams applications, I am using the Teams Toolkit - which will make teams apps development simple. It is available in VS Code as well. We also require Microsoft 365 Developer account which we can create free. Installing the Teams Toolkit To install Teams Toolkit, open the Visual Studio Installer, and select modify option, under ASP.NET and Web Development workload, select Microsoft Teams development tools. This will install the required project templates and tools for creating and managi ..read more
Visit website
Create a web API with ASP.NET Core and MongoDB
Dotnetthoughts Blog
by Anuraj
6M ago
This post is about configuring Mongo DB and creating ASP.NET Core Web API to work with Mongo DB using MongoDB.EntityFrameworkCore nuget package. Recently MongoDB team announced a EF Core provider for MongoDB. Earlier this year I blogged about MongoDB and ASP.NET Core using MongoFramework nuget package. In this blog post we are using MongoDB.EntityFrameworkCore nuget package which is from MongoDB. Setting up MongoDB For configuring MongoDB we can use Docker. First we can run the command - docker run --name mongo-db --publish 27017:27017 -v mongovolume:/data/db -d mongo:latest - the --name param ..read more
Visit website
Working with dotnet8 projects in Visual Studio 2022
Dotnetthoughts Blog
by Anuraj
6M ago
Recently Microsoft released .NET 8.0 RC. And when we try to load a .NET 8 Web API project in Visual Studio - we will get a message like this. - The current Visual Studio version does not support targeting .NET 8.0. Either target .NET 7.0 or lower, or use Visual Studio version 17.8 or higher. We can fix this issue by changing the Visual Studio configuration like this. Click on the Tools > Select options. And under Environment, select Preview Features. And in the right side select the Use previews of the .NET SDK (requires restart). Once it is selected, we need to restart the Visual Studio ..read more
Visit website
How to use native AOT to improve performance of ASP.NET Core apps
Dotnetthoughts Blog
by Anuraj
7M ago
This post is about explains what native AOT is and why it is beneficial for ASP.NET Core apps. Native AOT is a deployment model that uses an ahead-of-time compiler to compile IL to native code at the time of publish. Native AOT apps have faster startup time, smaller memory footprints, and can run on machines that don’t have the .NET runtime installed. Please note all the ASP.NET Core features are not currently compatible with native AOT. For instance, ASP.NET Core application types like minimal APIs, gRPC, and worker services are compatible with native AOT, while features such as MVC, Blazor S ..read more
Visit website
Using Docker environment variables at JavaScript runtime
Dotnetthoughts Blog
by Anuraj
8M ago
When creating a container for a single-page application with JavaScript frameworks like Angular, React, or Vue.js, we may have to inject certain configuration variables based the deployment environment. A common scenario is using API endpoint URL for the Javascript application which can vary depend on the environment. In Angular, we can use environment file for this purpose. But again the problem is we have to hard code the API URL in the environment file. In this post we will explore how we can do configure container environment variable in vanilla Javascript. This technique can be used in an ..read more
Visit website

Follow Dotnetthoughts Blog on FeedSpot

Continue with Google
Continue with Apple
OR