Book description
Unlock efficiency in software development by learning microservices with C#, .NET and Azure
Key Features
- Benefit from step-by-step project-based guidance on how to develop a full-fledged microservices application
- Gain extensive knowledge of microservices by covering essential concepts, tools, and methodologies
- Use essential Microsoft Azure cloud-native services and as alternatives for on-premises environments
- Purchase of the print or Kindle book includes a free PDF eBook
Book Description
Pragmatic Microservices with C# and Azure introduces .NET Aspire for microservices, focusing on defining an app model, utilizing service discovery, and integrating with Azure's native cloud services. Written by a Microsoft MVP and seasoned software architect with over two decades of experience in .NET, this book will help you get to grips with robust service development using .NET features like minimal APIs, gRPC, and SignalR for real-time communication.
Aside from covering essential aspects of DevOps, including testing methodologies such as unit, integration, and load testing, you’ll also explore logging and monitoring including OpenTelemetry using tools like Azure Log Analytics, Application Insights, Prometheus, and Grafana. You'll learn about asynchronous communication leveraging queues and events through Azure Event Hub and Apache.
Throughout the book, theoretical aspects will be complemented by practical skills gained from building and deploying a fully functional microservices-based application. By the end, you’ll possess a deep understanding of microservices architecture, hands-on experience with various .NET technologies and Azure services, and the ability to design, build, deploy, and manage microservices applications effectively in both on-premises and cloud environments.
What you will learn
- Understand the advantages and practical applications of microservices
- Utilize the cloud-ready .NET Aspire stack and tools for efficient development
- Create robust RESTful APIs using ASP.NET Core minimal APIs
- Implement seamless database integration with both relational and NoSQL databases
- Containerize microservices with Docker for better scalability and management
- Deploy microservices to the Azure Container Apps environment and Kubernetes for robust cloud solutions
- Implement logging, metrics, and distributed tracing to ensure reliability and performance
Who this book is for
This book is for software developers, architects, and engineers who are interested in adopting microservices architecture using the .NET framework and Microsoft Azure. Both intermediate and advanced developers who have a foundational understanding of C#, ASP.NET Core, and cloud computing concepts will find this book helpful.
Table of contents
- Pragmatic Microservices with C# and Azure
- Contributors
- About the author
- About the reviewers
- Preface
- Part 1: Creating Microservices with .NET
- Chapter 1: Introduction to .NET Aspire and Microservices
-
Chapter 2: Minimal APIs – Creating REST Services
- Technical requirements
- The game models
-
The minimal APIs project
- Creating the Web API project
- Exploring WebApplicationBuilder and WebApplication
- Implementing the repository
- Creating game objects initialized with random values
- Creating data transfer objects
- Implementing the games service
- Converting transfer objects to and from the object model
- Creating endpoints for the Games API service
- Configuring JSON serialization
- Creating endpoint filters
- Running the service
- OpenAPI information
- Testing the service
- Enabling .NET Aspire
- Summary
- Further reading
-
Chapter 3: Writing Data to Relational and NoSQL Databases
- Technical requirements
- Exploring the models for database mapping
-
Using EF Core with SQL Server
- Creating a data class library using SQL Server
- Creating an EF Core context for SQL Server
- Customizing the mapping of simple properties
- Creating value conversion to map complex properties
- Defining relations between games and moves
- Implementing the repository contract
- Configuring user secrets
- Configuring the application model with SQL Server
- Configuring the DI container with the minimal APIs project
- Creating migrations with EF Core
-
Using EF Core with Azure Cosmos DB
- Creating a class library project for EF Core with NoSQL
- Creating an EF Core context for Azure Cosmos DB
- Creating a value converter to convert complex types
- Creating embedded entities
- Implementing the repository contract
- Configuring the application model with Azure Cosmos DB
- Configuring the DI container
- Summary
- Further reading
- Chapter 4: Creating Libraries for Client Applications
- Part 2: Hosting and Deploying
- Chapter 5: Containerization of Microservices
- Chapter 6: Microsoft Azure for Hosting Applications
-
Chapter 7: Flexible Configurations
- Technical requirements
- Experiencing .NET configurations
- Using configurations with Azure Container Apps
- Using configurations with Azure App Configuration
- Storing secrets with Azure Key Vault
- Reducing the need for secrets with managed identities
- Using environments with Azure App Configuration
- Summary
- Further reading
- Chapter 8: CI/CD – Publishing with GitHub Actions
-
Chapter 9: Authentication and Authorization with Services and Clients
- Technical requirements
- Choosing an identity solution
- Creating an Azure AD B2C tenant
- Securing an API
- Authentication using Microsoft Identity with ASP.NET Core web applications
- Specifying authentication with Azure Container Apps
- Using ASP.NET Core Identity to store user information in a local database
- Summary
- Further reading
- Part 3: Troubleshooting and Scaling
- Chapter 10: All About Testing the Solution
- Chapter 11: Logging and Monitoring
- Chapter 12: Scaling Services
- Part 4: More communication options
- Chapter 13: Real-Time Messaging with SignalR
- Chapter 14: gRPC for Binary Communication
- Chapter 15: Asynchronous Communication with Messages and Events
- Chapter 16: Running Applications On-Premises and in the Cloud
- Index
- Other Books You May Enjoy
Product information
- Title: Pragmatic Microservices with C# and Azure
- Author(s):
- Release date: May 2024
- Publisher(s): Packt Publishing
- ISBN: 9781835088296
You might also like
book
Pro Microservices in .NET 6: With Examples Using ASP.NET Core 6, MassTransit, and Kubernetes
Know the fundamentals of creating and deploying microservices using .NET 6 and gain insight from prescriptive …
book
Azure for Developers - Second Edition
Develop cloud applications based on the most popular Azure services, including hosting web applications, running containers, …
book
Microservices in .NET, Second Edition
In Microservices in .NET, Second Edition you will learn how to: Build scalable microservices that are …
book
Beginning Azure Functions: Building Scalable and Serverless Apps
Start creating highly scalable apps and monitoring your Azure functions in production using Azure Functions 4.0. …