Building Generative AI apps with .NET 8 and Semantic Kernel

Sophia Lagerkrans-Pandey

Today’s we’d like to share a blog post from two members of the .NET team, Jordan Matthiesen and Luis Quintanilla, focused on Building Generative AI apps with .NET 8 – .NET Blog (

The future of AI is here, and .NET is ready for it! With .NET 8, you can create amazing applications that integrate language models in your new and existing projects. You can go from an idea to a solution using the tools, services and frameworks you love. We’ve made it easier than ever to learn, build, and deploy your LLM (Large Language Model) applications.

Learn from samples, build with Semantic Kernel, use tools like OpenAI, Deploy with .NET Aspire, Monitor in production

Why should I care about building apps with AI?

If you haven’t started exploring AI solutions yet, here are some compelling reasons to do so:

  • Increasing User Engagement and Retention: Offer more relevant and satisfying interactions.
  • Boost Productivity and Efficiency: Reduce errors and save time.
  • Create New Business Opportunities: Deliver innovative and value-added services.
  • Gaining a Competitive Edge: Stay ahead of market trends and meet customer expectations.

These are just a few of the many benefits of integrating AI into your solutions. Let’s dive into the .NET developer experience today.

How to get started

If you’re new to AI development, check out the new .NET + AI documentation and samples. Included here are also a set of quickstart guides that will help you get hands on with the code and try things out for yourself, using Open AI models with the Azure OpenAI SDK, or the Semantic Kernel library., using Open AI models with the Azure OpenAI SDK, or the Semantic Kernel library.

To explore more samples that utilize AI services available in Azure, take a look at the Azure Developer templates for .NET and AI that were recently expanded with new examples.

What is Semantic Kernel and why should I use it?

In many of our samples, you’ll see us using Semantic Kernel (SK) – SK is an open-source library that lets you easily build AI solutions that can call your existing code. As a highly extensible SDK, you can use Semantic Kernel to work with models from OpenAIAzure OpenAIHugging Face, and more. You can also connect to popular vector stores like Qdrant, Milivus, Azure AI Search, and a growing list of others.

While you can work with various models and vector stores using their own .NET SDKs and REST endpoints, Semantic Kernel makes it easier to do while minimizing the impact to your code. It provides a common set of abstractions you can use to access models and vector stores using dependency injection in .NET; so, you can swap different components out as you experiment and iterate on your apps.

Monitoring your application locally and in production

At Build we also demonstrated how to debug and diagnose your AI solutions, including monitoring in production. Semantic Kernel supports end-to-end traceability and debugging of AI calls to help you diagnose performance, quality, and cost. SK builds on top of the OpenTelemetry (OTLP) protocol, making it easy to monitor your application using any store or reporting tool that supports it.

.NET Aspire also offers robust support for debugging and diagnosing your applications. By building on top of the .NET OpenTelemetry SDK, a .NET implementation of the OpenTelemetry observability framework, .NET Aspire simplifies the configuration of Logging, Tracing, and Metrics. At development time, the .NET Aspire dashboard makes it easy to visualize your logs, traces, and metrics. When it’s time to deploy your application to production, you can leverage tools and services like Prometheus and Azure Monitor.

View of .NET Aspire dashboard showing telemetry for a chat call, showing details like model used and count of tokens used

Read more at the full blog here: Building Generative AI apps with .NET 8 – .NET Blog (

Next Steps:

We’d love to chat with you on your AI journey. Talk with our team by filling out a brief survey.

We’re always interested in hearing from you. If you have feedback, questions or want to discuss further, feel free to reach out to us and the community on the discussion boards on GitHub! We would also love your support, if you’ve enjoyed using Semantic Kernel, give us a star on GitHub.

1 comment

Leave a comment

  • 承昊 周 0


    As far as I know, the razor page is almost unused, while many friends are using the aspx page.
    It’s strange why Netcore has to give up the aspx that many people use and instead make something that no one uses?
    Razor is just HTML, and to achieve its functionality, it requires a lot of collaboration from Ajax, Vue, and controller. It needs to be developed using VScode.
    For our small team of around 10 people, the “onclick=backend code” in aspx is too convenient, while razor invisibly increases our workload several times.
    From the perspective of small teams and practicality, we hope that Netcore supports the ASPX approach, or Razor supports directly binding backend code.

    please Support ASPX page on .netcore.
    how many people are using razor-page?it is a html.
    i know very more persons are using ASPX-page. i don’t known why netcore not support aspx?
    design for using,not for designing.

Feedback usabilla icon