.NET Aspire Made Easy MEAP V08

.NET Aspire Made Easy MEAP V08

.NET Aspire Made Easy MEAP V08
Автор: Sazanavets Fiodar
Дата выхода: 2026
Издательство: Manning Publications Co.
Количество страниц: 276
Размер файла: 2,6 МБ
Тип файла: PDF
Добавил: codelibs
 Проверить на вирусы  Дополнительные материалы 

.NET Aspire Made Easy MEAP V08....1

copyright....2

welcome....3

brief contents....4

Chapter 1: Getting Started with Aspire in .NET....5

1.1 Introduction to distributed systems....6

1.1.1 Advantages of using distributed systems....8

1.1.2 Disadvantages of using distributed systems....9

1.2 Overview of orchestration....10

1.2.1 Key aspects of orchestration....11

1.3 How Aspire changes the game....12

1.4 Getting started with the Aspire Starter Project....13

1.5 Orchestrating with Aspire....15

1.6 Setting Up Aspire Orchestrator....17

1.6.1 Installing Aspire dependencies....17

1.6.2 Host application startup....18

1.6.3 Registering the UI application....18

1.7 Introducing Service Defaults....19

1.7.1 Adding extension methods....20

1.7.2 Using the extension methods....24

1.8 Service discovery in Aspire....24

1.8.1 Registering service discovery components....25

1.8.2 Enabling service discovery....25

1.8.3 Using service discovery....25

1.9 Summary....26

Chapter 2: Managing Infrastructure Components With Containers and Integrations....27

2.1 Docker containers overview....28

2.2 Keycloak overview....29

2.3 Initial setup....29

2.4 Adding a Keycloak container to .NET Aspire host....30

2.4.1 Configuring web front-end app....38

2.4.2 Configuring API service....42

2.4.3 Other service types .NET Aspire can host....48

2.5 How .NET Aspire integration libraries differ from containers....49

2.6 Configuring .NET Aspire integrations on the host....50

2.6.1 Connecting to an integration from a hosted service....51

2.6.2 Viewing integrations in the dashboard....51

2.7 Building a .NET Aspire integration library....52

2.7.1 Building an integration component....53

2.7.2 Launching a custom integration from Aspire Host....56

2.8 Summary....58

Chapter 3: Using Database and Storage Components....59

3.1 Connecting Aspire to an existing database....60

3.2 SQL Database components basics....60

3.2.1 Working with SQL data model....61

3.2.2 Displaying the DTO information in the UI....63

3.3 Hosting an SQL Server component....66

3.3.1 Consuming an SQL Server integration....70

3.3.2 Using Entity Framework....76

3.3.3 Integrating with Azure SQL Server....81

3.4 Hosting an Oracle component....82

3.4.1 Oracle client integration....82

3.5 Hosting a PostgreSQL component....83

3.5.1 PostgreSQL client integrations....83

3.6 Introduction to NoSQL....87

3.6.1 Introduction to MongoDB....88

3.6.2 Hosting a MongoDB component....89

3.6.3 Working with a MongoDB client....89

3.6.4 Other NoSQL components....94

3.6.5 Hosting a Cosmos DB component....95

3.6.6 Connecting to Cosmos DB....96

3.7 Azure Storage integration....97

3.7.1 Hosting Azure Storage components....97

3.7.2 Interacting with Azure Table Storage....98

3.7.3 Integrating with Azure Blob Storage....101

3.8 Summary....106

Chapter 4: Adding Order Tracking Functionality with SignalR....108

4.1 What is SignalR....109

4.2 Introduction to OpenLayers....109

4.3 Building a delivery tracking system....110

4.3.1 Setting up a SignalR hub....110

4.3.2 Registering a SignalR hub....112

4.3.3 Simulating location updates....112

4.4 Building the Front-end Map UI....114

4.4.1 Registering front-end dependencies....117

4.4.2 Building the interactive UI....118

4.5 Summary....123

Chapter 5: Building a ChatGPT clone with Aspire, Ollama, and Semantic Kernel....124

5.1 Hosting an LLM anywhere with Ollama....125

5.1.1 Integrating Ollama with Aspire....125

5.2 Adding Semantic Kernel....128

5.2.1 Building the chatbot back-end....129

5.2.2 Adding Semantic Kernel back-end logic....131

5.3 Finalizing the user interface....136

5.3.1 Adding SignalR JavaScript client....136

5.3.2 Building the chat page....140

5.3.3 Adding SignalR client to the page....141

5.4 Summary....143

Chapter 6: Integration Testing and Monitoring....145

6.1 Components of monitoring systems....146

6.1.1 Logging....146

6.1.2 Metrics....147

6.1.3 Traces....147

6.2 Monitoring .NET Aspire applications....147

6.3 Configuring the telemetry....148

6.4 Viewing information on the dashboard....150

6.5 Health checks in .NET Aspire....152

6.5.1 Service statuses on .NET Aspire dashboard....153

6.5.2 Enabling health checks inside .NET Aspire apps....155

6.5.3 Mapping health check endpoints....156

6.5.4 Monitoring app health in production....156

6.6 Setting up integration tests in Aspire....157

6.6.1 Adding a test project....158

6.6.2 Installing required dependencies for testing....159

6.6.3 Adding Aspire integration tests....159

6.6.4 Using different testing frameworks....162

6.6.5 Expanding test functionality....163

6.6.6 What about component testing?....166

6.7 Summary....169

Chapter 7: Components for Messaging and Caching....170

7.1 Working with RabbitMQ....171

7.1.1 Hosting a RabbitMQ component....173

7.1.2 Adding order-processing functionality....173

7.1.3 Sending messages via RabbitMQ....182

7.1.4 Consuming RabbitMQ messages....188

7.2 Working with Azure Queue Storage....192

7.2.1 Hosting an emulated Azure Queue Storage component....192

7.2.2 Sending messages via Azure Queue Storage....193

7.2.3 Consuming Azure Queue Storage messages....194

7.3 Overview of distributed cache and lock....195

7.4 Setting up Redis for caching and locking....196

7.4.1 Installing a Redis Component....197

7.4.2 Installing the Redis client for distributed caching....197

7.4.3 Using a distributed cache....198

7.4.4 Using a distributed lock....200

7.5 Managing Redis cache....206

7.6 Summary....207

Chapter 8: Application Security in Aspire....209

8.1 A brief introduction to Single Sign-on....210

8.1.1 Solution setup....212

8.2 Using service discovery in Single Sign-on....212

8.3 Enforcing UI authentication....214

8.3.1 Partially enforcing security....219

8.4 Enforcing API authentication....225

8.4.1 Passing a JWT To API....227

8.5 Securing the Aspire dashboard....229

8.6 Summary....230

Chapter 9: Deploying Aspire apps to production....232

9.1 Pre-deployment modifications of Aspire-hosted systems....233

9.1.1 Running multiple instances of a service....233

9.1.2 Running environment-specific services....235

9.1.3 Managing database migrations....237

9.1.4 Modifying the dashboard....240

9.2 Preparing .NET Aspire for deployment....243

9.3 Deploying to Azure Container Apps....246

9.3.1 Using the Azure Developer CLI....247

9.3.2 Deploying From Visual Studio....248

9.3.3 Obtaining the deployment files....250

9.3.4 Converting Aspire manifest to Terraform....251

9.4 Converting .NET Aspire manifest to Kubernetes....251

9.4.1 Using Aspir8....252

9.4.2 Deploying to a Kubernetes cluster....253

9.5 Building CI/CD pipelines for Aspire....254

9.5.1 Creating a GitHub Actions pipeline....255

9.5.2 Creating an Azure DevOps pipeline....259

9.5.3 Building pipelines for Kubernetes deployment....265

9.6 Summary....270

Appendix A. Setting up the development environment....272

A.1 Minimal system requirements....272

A.2 Installing .NET Aspire project templates....273

A.3 Creating a .NET Aspire project....274

Write distributed apps naturally on your local machine using .NET Aspire!

.NET Aspire radically simplifies the process of building distributed applications! With this powerful tool, you can design, code, and run distributed systems on your local dev machine, even replicating cloud services such as Azure Cosmos DB and Azure Storage. Aspire includes the templates and packages you need to create a complete distributed environment on your local machine, including Kubernetes orchestration, observability, and database integration, all from your familiar Visual Studio IDE.

In .NET Aspire Made Easy you’ll discover:

  • The anatomy of a .NET Aspire application
  • How to set up and use the Aspire dashboard
  • Hosting Docker containers in Aspire
  • Detailed examples of Aspire integrations—from databases to distributed caches
  • Deploying Aspire apps to production with Azure Container Apps and Kubernetes

The groundbreaking .NET Aspire framework makes it easy to locally launch distributed applications in a single process, so you can run apps in development the same way they’ll work in production. .NET Aspire Made Easy teaches you to use this powerful framework to build reliable distributed apps without flaky emulators or the need to disable half your services.

About the book

In .NET Aspire Made Easy you’ll discover the fundamentals of Aspire: how Aspire code is structured, how its components all work together, and how to integrate Aspire apps with databases, message brokers, and other infrastructure. The book is packed with solutions to common and not-so-common problems—from making service discovery work with SignalR clients, to deploying Aspire applications in cloud environments. Throughout, you’ll get your hands dirty with real-world examples of large-scale applications, including an e-commerce app and a social media platform.

About the reader

For .NET developers who know C#. No experience with distributed applications needed.


Похожее:

Список отзывов:

Нет отзывов к книге.