100% found this document useful (1 vote)
846 views

Full Download NET Microservices Architecture for Containerized NET Applications Cesar De La Torre PDF DOCX

The document is a guide on developing microservices-based applications using .NET and Docker containers, focusing on architectural design and implementation. It provides foundational guidance for developers and solution architects, emphasizing a reference application available on GitHub. The guide is updated to cover .NET 7 and is intended for those new to Docker and microservices architecture.

Uploaded by

alversaviaos
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
846 views

Full Download NET Microservices Architecture for Containerized NET Applications Cesar De La Torre PDF DOCX

The document is a guide on developing microservices-based applications using .NET and Docker containers, focusing on architectural design and implementation. It provides foundational guidance for developers and solution architects, emphasizing a reference application available on GitHub. The guide is updated to cover .NET 7 and is intended for those new to Docker and microservices architecture.

Uploaded by

alversaviaos
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 40

Get the full ebook with Bonus Features for a Better Reading Experience on ebookmeta.

com

NET Microservices Architecture for Containerized


NET Applications Cesar De La Torre

https://ebookmeta.com/product/net-microservices-
architecture-for-containerized-net-applications-cesar-de-la-
torre/

OR CLICK HERE

DOWLOAD NOW

Download more ebook instantly today at https://ebookmeta.com


Recommended digital products (PDF, EPUB, MOBI) that
you can download immediately if you are interested.

Microservices in NET Second Edition Christian Horsdal


Gammelgaard

https://ebookmeta.com/product/microservices-in-net-second-edition-
christian-horsdal-gammelgaard/

ebookmeta.com

Pro Dynamic NET 4 0 Applications Data Driven Programming


for the NET Framework 1st Edition Carl Ganz Jr

https://ebookmeta.com/product/pro-dynamic-net-4-0-applications-data-
driven-programming-for-the-net-framework-1st-edition-carl-ganz-jr/

ebookmeta.com

Software Architecture by Example: Using C# and .NET 1st


Edition Paul Michaels

https://ebookmeta.com/product/software-architecture-by-example-using-
c-and-net-1st-edition-paul-michaels-2/

ebookmeta.com

How It Works - Book Of Incredible History, 20th Edition


2023 How It Works

https://ebookmeta.com/product/how-it-works-book-of-incredible-
history-20th-edition-2023-how-it-works/

ebookmeta.com
The Story of the Salem Witch Trials 2nd Edition Bryan F Le
Beau

https://ebookmeta.com/product/the-story-of-the-salem-witch-trials-2nd-
edition-bryan-f-le-beau/

ebookmeta.com

Thief Loxley Prep 2 1st Edition Hattie Jude

https://ebookmeta.com/product/thief-loxley-prep-2-1st-edition-hattie-
jude/

ebookmeta.com

Post-Brexit Europe and UK: Policy Challenges Towards Iran


and the GCC States (Contemporary Gulf Studies)

https://ebookmeta.com/product/post-brexit-europe-and-uk-policy-
challenges-towards-iran-and-the-gcc-states-contemporary-gulf-studies/

ebookmeta.com

Seal Team 13 book 2 Liberation 1st Edition Evan Currie

https://ebookmeta.com/product/seal-team-13-book-2-liberation-1st-
edition-evan-currie/

ebookmeta.com

Champagne Charlie 1st Edition Don Kladstrup Petie


Kladstrup

https://ebookmeta.com/product/champagne-charlie-1st-edition-don-
kladstrup-petie-kladstrup/

ebookmeta.com
Comparative Psychology Evolution and Development of Brain
and Behavior 3rd Edition Mauricio R. Papini

https://ebookmeta.com/product/comparative-psychology-evolution-and-
development-of-brain-and-behavior-3rd-edition-mauricio-r-papini/

ebookmeta.com
EDITION v7.0 - Updated to ASP.NET Core 7.0

Refer changelog for the book updates and community contributions.

This guide is an introduction to developing microservices-based applications and managing them


using containers. It discusses architectural design and implementation approaches using .NET and
Docker containers.

To make it easier to get started, the guide focuses on a reference containerized and microservice-
based application that you can explore. The reference application is available at the
eShopOnContainers GitHub repo.

Action links
• This e-book is also available in a PDF format (English version only) Download

• Clone/Fork the reference application eShopOnContainers on GitHub

• Watch the introductory video

• Get to know the Microservices Architecture right away

Introduction
Enterprises are increasingly realizing cost savings, solving deployment problems, and improving
DevOps and production operations by using containers. Microsoft has been releasing container
innovations for Windows and Linux by creating products like Azure Kubernetes Service and Azure
Service Fabric, and by partnering with industry leaders like Docker, Mesosphere, and Kubernetes.
These products deliver container solutions that help companies build and deploy applications at cloud
speed and scale, whatever their choice of platform or tools.

Docker is becoming the de facto standard in the container industry, supported by the most significant
vendors in the Windows and Linux ecosystems. (Microsoft is one of the main cloud vendors
supporting Docker). In the future, Docker will probably be ubiquitous in any datacenter in the cloud or
on-premises.

In addition, the microservices architecture is emerging as an important approach for distributed


mission-critical applications. In a microservice-based architecture, the application is built on a
collection of services that can be developed, tested, deployed, and versioned independently.

About this guide


This guide is an introduction to developing microservices-based applications and managing them
using containers. It discusses architectural design and implementation approaches using .NET and
Docker containers. To make it easier to get started with containers and microservices, the guide
focuses on a reference containerized and microservice-based application that you can explore. The
sample application is available at the eShopOnContainers GitHub repo.
This guide provides foundational development and architectural guidance primarily at a development
environment level with a focus on two technologies: Docker and .NET. Our intention is that you read
this guide when thinking about your application design without focusing on the infrastructure (cloud
or on-premises) of your production environment. You will make decisions about your infrastructure
later, when you create your production-ready applications. Therefore, this guide is intended to be
infrastructure agnostic and more development-environment-centric.

After you have studied this guide, your next step would be to learn about production-ready
microservices on Microsoft Azure.

Version
This guide has been revised to cover .NET 7 version along with many additional updates related to
the same “wave” of technologies (that is, Azure and additional third-party technologies) coinciding in
time with the .NET 7 release. That’s why the book version has also been updated to version 7.0.

What this guide does not cover


This guide does not focus on the application lifecycle, DevOps, CI/CD pipelines, or team work. The
complementary guide Containerized Docker Application Lifecycle with Microsoft Platform and Tools
focuses on that subject. The current guide also does not provide implementation details on Azure
infrastructure, such as information on specific orchestrators.

Additional resources
• Containerized Docker Application Lifecycle with Microsoft Platform and Tools (downloadable
e-book)
https://aka.ms/dockerlifecycleebook

Who should use this guide


We wrote this guide for developers and solution architects who are new to Docker-based application
development and to microservices-based architecture. This guide is for you if you want to learn how
to architect, design, and implement proof-of-concept applications with Microsoft development
technologies (with special focus on .NET) and with Docker containers.

You will also find this guide useful if you are a technical decision maker, such as an enterprise
architect, who wants an architecture and technology overview before you decide on what approach to
select for new and modern distributed applications.

How to use this guide


The first part of this guide introduces Docker containers, discusses how to choose between .NET 7 and
the .NET Framework as a development framework, and provides an overview of microservices. This
content is for architects and technical decision makers who want an overview but don’t need to focus
on code implementation details.
The second part of the guide starts with the Development process for Docker based applications
section. It focuses on the development and microservice patterns for implementing applications using
.NET and Docker. This section will be of most interest to developers and architects who want to focus
on code and on patterns and implementation details.

Related microservice and container-based reference


application: eShopOnContainers
The eShopOnContainers application is an open-source reference app for .NET and microservices that
is designed to be deployed using Docker containers. The application consists of multiple subsystems,
including several e-store UI front-ends (a Web MVC app, a Web SPA, and a native mobile app). It also
includes the back-end microservices and containers for all required server-side operations.

The purpose of the application is to showcase architectural patterns. IT IS NOT A PRODUCTION-


READY TEMPLATE to start real-world applications. In fact, the application is in a permanent beta
state, as it’s also used to test new potentially interesting technologies as they show up.

Credits
Co-Authors:

Cesar de la Torre, Sr. PM, .NET product team, Microsoft Corp.

Bill Wagner, Sr. Content Developer, C+E, Microsoft Corp.

Mike Rousos, Principal Software Engineer, DevDiv CAT team, Microsoft

Editors:

Mike Pope

Steve Hoag

Participants and reviewers:

Jeffrey Richter, Partner Software Eng, Azure team, Microsoft

Jimmy Bogard, Chief Architect at Headspring

Udi Dahan, Founder & CEO, Particular Software

Jimmy Nilsson, Co-founder and CEO of Factor10

Glenn Condron, Sr. Program Manager, ASP.NET team

Mark Fussell, Principal PM Lead, Azure Service Fabric team, Microsoft

Diego Vega, PM Lead, Entity Framework team, Microsoft

Barry Dorrans, Sr. Security Program Manager

Rowan Miller, Sr. Program Manager, Microsoft


Ankit Asthana, Principal PM Manager, .NET team, Microsoft

Scott Hunter, Partner Director PM, .NET team, Microsoft

Nish Anil, Sr. Program Manager, .NET team, Microsoft

Dylan Reisenberger, Architect and Dev Lead at Polly

Steve “ardalis” Smith - Software Architect and Trainer - Ardalis.com

Ian Cooper, Coding Architect at Brighter

Unai Zorrilla, Architect and Dev Lead at Plain Concepts

Eduard Tomas, Dev Lead at Plain Concepts

Ramon Tomas, Developer at Plain Concepts

David Sanz, Developer at Plain Concepts

Javier Valero, Chief Operating Officer at Grupo Solutio

Pierre Millet, Sr. Consultant, Microsoft

Michael Friis, Product Manager, Docker Inc

Charles Lowell, Software Engineer, VS CAT team, Microsoft

Miguel Veloso, Software Development Engineer at Plain Concepts

Sumit Ghosh, Principal Consultant at Neudesic

Copyright
PUBLISHED BY

Microsoft Developer Division, .NET and Visual Studio product teams

A division of Microsoft Corporation

One Microsoft Way

Redmond, Washington 98052-6399

Copyright © 2023 by Microsoft Corporation

All rights reserved. No part of the contents of this book may be reproduced or transmitted in any
form or by any means without the written permission of the publisher.

This book is provided “as-is” and expresses the author’s views and opinions. The views, opinions and
information expressed in this book, including URL and other Internet website references, may change
without notice.

Some examples depicted herein are provided for illustration only and are fictitious. No real association
or connection is intended or should be inferred.
Microsoft and the trademarks listed at https://www.microsoft.com on the “Trademarks” webpage are
trademarks of the Microsoft group of companies.

Mac and macOS are trademarks of Apple Inc.

The Docker whale logo is a registered trademark of Docker, Inc. Used by permission.

All other marks and logos are property of their respective owners.
Contents
Introduction to Containers and Docker ................................................................................ 1
What is Docker? ........................................................................................................................................................................ 2

Comparing Docker containers with virtual machines ........................................................................................... 3

A simple analogy ................................................................................................................................................................. 4

Docker terminology ................................................................................................................................................................ 5

Docker containers, images, and registries ..................................................................................................................... 7

Choosing Between .NET and .NET Framework for Docker Containers .............................. 9
General guidance ..................................................................................................................................................................... 9

When to choose .NET for Docker containers ............................................................................................................. 10

Developing and deploying cross platform ............................................................................................................ 10

Using containers for new (“green-field”) projects ............................................................................................... 11

Create and deploy microservices on containers .................................................................................................. 11

Deploying high density in scalable systems .......................................................................................................... 11

When to choose .NET Framework for Docker containers ..................................................................................... 12

Migrating existing applications directly to a Windows Server container .................................................. 12

Using third-party .NET libraries or NuGet packages not available for .NET 7 ......................................... 12

Using .NET technologies not available for .NET 7 ............................................................................................... 12

Using a platform or API that doesn’t support .NET 7 ........................................................................................ 13

Porting existing ASP.NET application to .NET 7 ................................................................................................... 13

Decision table: .NET implementations to use for Docker ..................................................................................... 13

What OS to target with .NET containers ...................................................................................................................... 14

Official .NET Docker images ............................................................................................................................................. 16

.NET and Docker image optimizations for development versus production ........................................... 16

Architecting container and microservice-based applications .......................................... 18


Container design principles .............................................................................................................................................. 18

Containerizing monolithic applications ....................................................................................................................... 19

Deploying a monolithic application as a container ............................................................................................ 21

Publishing a single-container-based application to Azure App Service .................................................... 21

i Contents
Manage state and data in Docker applications ........................................................................................................ 22

Service-oriented architecture ........................................................................................................................................... 25

Microservices architecture ................................................................................................................................................. 25

Additional resources ....................................................................................................................................................... 27

Data sovereignty per microservice ................................................................................................................................ 27

The relationship between microservices and the Bounded Context pattern ........................................... 29

Logical architecture versus physical architecture ..................................................................................................... 30

Challenges and solutions for distributed data management .............................................................................. 31

Challenge #1: How to define the boundaries of each microservice ............................................................ 31

Challenge #2: How to create queries that retrieve data from several microservices ............................ 32

Challenge #3: How to achieve consistency across multiple microservices ............................................... 33

Challenge #4: How to design communication across microservice boundaries .................................... 35

Additional resources ....................................................................................................................................................... 36

Identify domain-model boundaries for each microservice .................................................................................. 36

The API gateway pattern versus the Direct client-to-microservice communication .................................. 40

Direct client-to-microservice communication ...................................................................................................... 40

Why consider API Gateways instead of direct client-to-microservice communication ....................... 41

What is the API Gateway pattern? ............................................................................................................................. 42

Main features in the API Gateway pattern ............................................................................................................. 44

Using products with API Gateway features ............................................................................................................ 45

Drawbacks of the API Gateway pattern ................................................................................................................... 47

Additional resources ....................................................................................................................................................... 48

Communication in a microservice architecture ........................................................................................................ 48

Communication types .................................................................................................................................................... 49

Asynchronous microservice integration enforces microservice’s autonomy ........................................... 50

Communication styles .................................................................................................................................................... 52

Asynchronous message-based communication ....................................................................................................... 54

Single-receiver message-based communication ................................................................................................ 55

Multiple-receivers message-based communication .......................................................................................... 56

Asynchronous event-driven communication ........................................................................................................ 56

A note about messaging technologies for production systems ................................................................... 57

Resiliently publishing to the event bus ................................................................................................................... 58

ii Contents
Additional resources ....................................................................................................................................................... 58

Creating, evolving, and versioning microservice APIs and contracts ............................................................... 59

Additional resources ....................................................................................................................................................... 59

Microservices addressability and the service registry ............................................................................................ 60

Additional resources ....................................................................................................................................................... 60

Creating composite UI based on microservices ....................................................................................................... 60

Additional resources ....................................................................................................................................................... 62

Resiliency and high availability in microservices ...................................................................................................... 63

Health management and diagnostics in microservices .................................................................................... 63

Additional resources ....................................................................................................................................................... 65

Orchestrate microservices and multi-container applications for high scalability and availability ....... 66

Software platforms for container clustering, orchestration, and scheduling ........................................... 68

Using container-based orchestrators in Microsoft Azure ................................................................................ 68

Using Azure Kubernetes Service ................................................................................................................................ 69

Development environment for Kubernetes ........................................................................................................... 70

Getting started with Azure Kubernetes Service (AKS) ....................................................................................... 70

Deploy with Helm charts into Kubernetes clusters ............................................................................................. 71

Additional resources ....................................................................................................................................................... 71

Development process for Docker-based applications ....................................................... 72


Development environment for Docker apps ............................................................................................................. 72

Development tool choices: IDE or editor ................................................................................................................ 72

Additional resources ....................................................................................................................................................... 73

.NET languages and frameworks for Docker containers ....................................................................................... 73

Development workflow for Docker apps..................................................................................................................... 73

Workflow for developing Docker container-based applications .................................................................. 73

Step 1. Start coding and create your initial application or service baseline ............................................. 75

Step 2. Create a Dockerfile related to an existing .NET base image ............................................................ 76

Step 3. Create your custom Docker images and embed your application or service in them .......... 83

Step 4. Define your services in docker-compose.yml when building a multi-container Docker


application .......................................................................................................................................................................... 84

Step 5. Build and run your Docker application .................................................................................................... 87

Step 6. Test your Docker application using your local Docker host ............................................................ 89

iii Contents
Simplified workflow when developing containers with Visual Studio ........................................................ 90

Using PowerShell commands in a Dockerfile to set up Windows Containers ......................................... 91

Designing and Developing Multi-Container and Microservice-Based .NET Applications


................................................................................................................................................. 93
Design a microservice-oriented application .............................................................................................................. 93

Application specifications ............................................................................................................................................. 93

Development team context ......................................................................................................................................... 94

Choosing an architecture .............................................................................................................................................. 94

Benefits of a microservice-based solution ............................................................................................................. 97

Downsides of a microservice-based solution ....................................................................................................... 98

External versus internal architecture and design patterns............................................................................... 99

The new world: multiple architectural patterns and polyglot microservices .......................................... 100

Creating a simple data-driven CRUD microservice ............................................................................................... 102

Designing a simple CRUD microservice ................................................................................................................ 102

Implementing a simple CRUD microservice with ASP.NET Core ................................................................. 103

The DB connection string and environment variables used by Docker containers ............................. 109

Generating Swagger description metadata from your ASP.NET Core Web API ................................... 111

Defining your multi-container application with docker-compose.yml ......................................................... 116

Use a database server running as a container ........................................................................................................ 127

SQL Server running as a container with a microservice-related database .............................................. 128

Seeding with test data on Web application startup ......................................................................................... 129

EF Core InMemory database versus SQL Server running as a container ................................................. 132

Using a Redis cache service running in a container ......................................................................................... 132

Implementing event-based communication between microservices (integration events) ................... 133

Using message brokers and service buses for production systems .......................................................... 134

Integration events .......................................................................................................................................................... 135

The event bus .................................................................................................................................................................. 136

Additional resources ..................................................................................................................................................... 138

Implementing an event bus with RabbitMQ for the development or test environment ....................... 138

Implementing a simple publish method with RabbitMQ............................................................................... 139

Implementing the subscription code with the RabbitMQ API ..................................................................... 140

Additional resources ..................................................................................................................................................... 141

iv Contents
Subscribing to events ........................................................................................................................................................ 141

Publishing events through the event bus............................................................................................................. 142

Idempotency in update message events .............................................................................................................. 149

Deduplicating integration event messages ......................................................................................................... 150

Testing ASP.NET Core services and web apps ........................................................................................................ 152

Testing in eShopOnContainers ................................................................................................................................. 155

Implement background tasks in microservices with IHostedService and the BackgroundService class
.................................................................................................................................................................................................... 157

Registering hosted services in your WebHost or Host ................................................................................... 159

The IHostedService interface ..................................................................................................................................... 159

Implementing IHostedService with a custom hosted service class deriving from the
BackgroundService base class................................................................................................................................... 160

Additional resources ..................................................................................................................................................... 163

Implement API Gateways with Ocelot ........................................................................................................................ 163

Architect and design your API Gateways .............................................................................................................. 163

Implementing your API Gateways with Ocelot .................................................................................................. 168

Using Kubernetes Ingress plus Ocelot API Gateways ...................................................................................... 180

Additional cross-cutting features in an Ocelot API Gateway ....................................................................... 181

Tackle Business Complexity in a Microservice with DDD and CQRS Patterns .............. 182
Apply simplified CQRS and DDD patterns in a microservice............................................................................. 184

Additional resources ..................................................................................................................................................... 186

Apply CQRS and CQS approaches in a DDD microservice in eShopOnContainers ................................. 186

CQRS and DDD patterns are not top-level architectures............................................................................... 187

Implement reads/queries in a CQRS microservice ................................................................................................ 188

Use ViewModels specifically made for client apps, independent from domain model constraints
............................................................................................................................................................................................... 189

Use Dapper as a micro ORM to perform queries .............................................................................................. 189

Dynamic versus static ViewModels ......................................................................................................................... 190

Additional resources ..................................................................................................................................................... 193

Design a DDD-oriented microservice ......................................................................................................................... 194

Keep the microservice context boundaries relatively small .......................................................................... 194

Layers in DDD microservices ..................................................................................................................................... 195

v Contents
Design a microservice domain model ........................................................................................................................ 199

The Domain Entity pattern ......................................................................................................................................... 199

Implement a microservice domain model with .NET ............................................................................................ 204

Domain model structure in a custom .NET Standard Library ....................................................................... 204

Structure aggregates in a custom .NET Standard library ............................................................................... 205

Implement domain entities as POCO classes ..................................................................................................... 206

Encapsulate data in the Domain Entities .............................................................................................................. 207

Seedwork (reusable base classes and interfaces for your domain model) .................................................. 210

The custom Entity base class ..................................................................................................................................... 211

Repository contracts (interfaces) in the domain model layer ...................................................................... 212

Additional resources ..................................................................................................................................................... 213

Implement value objects .................................................................................................................................................. 213

Important characteristics of value objects ........................................................................................................... 214

Value object implementation in C# ........................................................................................................................ 215

How to persist value objects in the database with EF Core 2.0 and later ................................................ 217

Persist value objects as owned entity types in EF Core 2.0 and later ........................................................ 218

Additional resources ..................................................................................................................................................... 221

Use enumeration classes instead of enum types ................................................................................................... 221

Implement an Enumeration base class .................................................................................................................. 222

Additional resources ..................................................................................................................................................... 223

Design validations in the domain model layer ....................................................................................................... 223

Implement validations in the domain model layer ........................................................................................... 224

Additional resources ..................................................................................................................................................... 225

Client-side validation (validation in the presentation layers) ............................................................................ 226

Additional resources ..................................................................................................................................................... 227

Domain events: Design and implementation .......................................................................................................... 227

What is a domain event? ............................................................................................................................................. 228

Domain events versus integration events ............................................................................................................ 228

Domain events as a preferred way to trigger side effects across multiple aggregates within the
same domain ................................................................................................................................................................... 229

Implement domain events .......................................................................................................................................... 231

Conclusions on domain events ................................................................................................................................. 237

vi Contents
Additional resources ..................................................................................................................................................... 238

Design the infrastructure persistence layer .............................................................................................................. 238

The Repository pattern ................................................................................................................................................ 238

Additional resources ..................................................................................................................................................... 243

Implement the infrastructure persistence layer with Entity Framework Core ............................................ 243

Introduction to Entity Framework Core ................................................................................................................. 244

Infrastructure in Entity Framework Core from a DDD perspective ............................................................. 244

Implement custom repositories with Entity Framework Core ...................................................................... 246

EF DbContext and IUnitOfWork instance lifetime in your IoC container ................................................. 248

The repository instance lifetime in your IoC container ................................................................................... 249

Table mapping ................................................................................................................................................................ 250

Implement the Query Specification pattern ........................................................................................................ 253

Use NoSQL databases as a persistence infrastructure ......................................................................................... 255

Introduction to Azure Cosmos DB and the native Cosmos DB API ........................................................... 256

Implement .NET code targeting MongoDB and Azure Cosmos DB .......................................................... 258

Design the microservice application layer and Web API .................................................................................... 266

Use SOLID principles and Dependency Injection .............................................................................................. 266

Implement the microservice application layer using the Web API ................................................................. 267

Use Dependency Injection to inject infrastructure objects into your application layer ..................... 267

Implement the Command and Command Handler patterns ....................................................................... 271

The Command process pipeline: how to trigger a command handler ..................................................... 278

Implement the command process pipeline with a mediator pattern (MediatR) .................................. 281

Apply cross-cutting concerns when processing commands with the Behaviors in MediatR .......... 287

Implement resilient applications ....................................................................................... 291


Handle partial failure ......................................................................................................................................................... 292

Strategies to handle partial failure ............................................................................................................................... 294

Additional resources ..................................................................................................................................................... 295

Implement retries with exponential backoff ............................................................................................................ 295

Implement resilient Entity Framework Core SQL connections.......................................................................... 295

Execution strategies and explicit transactions using BeginTransaction and multiple DbContexts296

Additional resources ..................................................................................................................................................... 298

Use IHttpClientFactory to implement resilient HTTP requests ......................................................................... 298

vii Contents
Issues with the original HttpClient class available in .NET ............................................................................. 298

Benefits of using IHttpClientFactory ....................................................................................................................... 299

Multiple ways to use IHttpClientFactory ............................................................................................................... 300

How to use Typed Clients with IHttpClientFactory ........................................................................................... 300

Additional resources ..................................................................................................................................................... 304

Implement HTTP call retries with exponential backoff with IHttpClientFactory and Polly policies ... 304

Add a jitter strategy to the retry policy ................................................................................................................. 305

Additional resources ..................................................................................................................................................... 306

Implement the Circuit Breaker pattern ....................................................................................................................... 306

Implement Circuit Breaker pattern with IHttpClientFactory and Polly ..................................................... 307

Test Http retries and circuit breakers in eShopOnContainers ...................................................................... 308

Additional resources ..................................................................................................................................................... 310

Health monitoring .............................................................................................................................................................. 310

Implement health checks in ASP.NET Core services ........................................................................................ 311

Use watchdogs ................................................................................................................................................................ 315

Health checks when using orchestrators .............................................................................................................. 317

Advanced monitoring: visualization, analysis, and alerts ............................................................................... 317

Additional resources ..................................................................................................................................................... 318

Make secure .NET Microservices and Web Applications ................................................. 319


Implement authentication in .NET microservices and web applications ...................................................... 319

Authenticate with ASP.NET Core Identity ............................................................................................................. 320

Authenticate with external providers ..................................................................................................................... 321

Authenticate with bearer tokens .............................................................................................................................. 323

Authenticate with an OpenID Connect or OAuth 2.0 Identity provider ................................................... 324

Issue security tokens from an ASP.NET Core service ....................................................................................... 325

Consume security tokens ............................................................................................................................................ 326

Additional resources .......................................................................................................................................................... 327

About authorization in .NET microservices and web applications .................................................................. 327

Implement role-based authorization ..................................................................................................................... 328

Implement policy-based authorization ................................................................................................................. 329

Authorization and minimal apis ............................................................................................................................... 330

Additional resources ..................................................................................................................................................... 330

viii Contents
Store application secrets safely during development .......................................................................................... 330

Store secrets in environment variables ................................................................................................................. 331

Store secrets with the ASP.NET Core Secret Manager .................................................................................... 331

Use Azure Key Vault to protect secrets at production time .............................................................................. 332

Additional resources ..................................................................................................................................................... 333

.NET Microservices Architecture key takeaways .............................................................. 334

ix Contents
Other documents randomly have
different content
Skunk Band, 251.

Skunk Song, 196.

Skylark, Missouri, 157.

Slim, cowboy, 119–23.

Small Otter, grandson of Mad Wolf, 74, 243.

Smallpox, 212, 213.

Small Robe Band, 251.

Smoking Star, legend, 92.

Snake Indians, 51, 212.

Snake Tepee, 263.

Snow banners, 150.

Snowberry, shrub, 258.

Snow Tepee, of Mad Wolf, 68;


taboos of, 71;
legend of, 136–38;
decorations, 262, 263.

Societies, men’s, 219–25, 274–77, 284–88, 314.

Songs, Indian, 21, 78;


to Sun, 38;
gambling, 133;
of Sandpiper Dance, 185;
of Tent Caterpillar Dance, 186;
skunk, 196;
night, 203;
love, 203;
contest with songs, 202–04;
mosquito, 222;
dance, 275;
victory, 278;
of kissing dance, 280;
celebration, 281;
wolf, 281;
riding, 282;
sacred, 301–03;
tribal hymn, 308, 309.

Sparrow, Gambel, 160.

Sparrow, lark, 154, 156.

Sparrow, white-crowned, 23, 159, 195.

Speeches, by Mountain Chief, 276, 312;


by Running Crane, 277;
Bear Chief, 307;
Mad Wolf, 315, 316.

Spirits, belief in, 16, 17, 114–18, 134–35, 166, 168, 169, 217, 272.

Spirit world. See Sand Hills.

Spotted Eagle, medicine man, character of, 170;


story by, 171–73, 298, 299, 310–14.

Spruce, Engelmann, 161.

Star Boy, legend, 232–36.

Stories, about a bear, 17;


The Warrior [335]who ate his Foot, 33;
by Mad Wolf, 71;
The Medicine Grizzly, 106;
ghosts, 168–69, 114–18, 134–35;
of Mad Indian, 144–48;
buffalo hunt, 155;
of Swift Eagle, 162;
about the past, 167;
Old Man and the Squirrels, 171–73;
Red Head, 182;
by Brings-Down-the-Sun, 210–18;
war, 311, 312.
Strawberries, 23, 195.

Strikes-on-Both-Sides, daughter of Mad Wolf, 38, 54;


dance by, 66, 68, 69, 75;
favorite of her father, 77;
ghost stories by, 114, 134, 153, 226, 253, 291.

Stuyimi, death of, 268–73.

Suicide, 314.

Sun, the Great Power, 16, 241.

Sun Dance, 21, 82, 88, 192, 217, 241–316.

Sun Dance Bundle, 244.

Sun dogs, 130, 150, 227, 301, 311.

Sunflowers, 21, 258.

Sun Pole, 304, 305, 308, 309, 311.

Sun River, 153.

Swan Dance, 295.

Swans, 124.

Swans, whistling, 153.

Swallows, 185.

Sweat lodge, 77, 298, 299.

Sweet grass, 77, 179, 319, 325.

Sweet Grass Hills, 54, 72, 258.

Taboos, of Beaver Bundle, 45, 71;


of Snow Tepee, 71, 263;
Thunder Tepee, 204, 261;
of Medicine Pipe, 214, 296, 297;
Buffalo Tepees, 262.
Tanning skins, 72, 167, 255.

Taurus, constellation, 143.

Tears-in-Her-Eyes, niece of Mad Wolf, 253, 291.

Temperature, winter, 140, 142;


summer, 185.

Terry, General, 10.

Thimbleberry, 101.

Thrush, olive-backed, 6;
willow, 23, 157, 159, 242.

Thunder, 194, 215, 227, 297, 310.

Thunder Bird, 16, 68, 200, 263, 264, 295.

Thunder Chief, head man of the Bloods, 30.

Thunder Dance, 295.

Thunder Pipe, 214–16.

Thunder Tepee, 201;


taboos of, 202, 204, 264.

Timber-line, 103, 161.

Tobacco, 44, 160, 323.

Tongues, sacred, 244–46, 307, 308, 314.

Torture, self, 314.

Toys, children’s, 74, 196, 226, 254.

Trails, Indian, 20, 25, 100, 111, 129, 166, 170, 185, 210.

Traveling Song, 282.


Traveling-tepee of author, 68;
decorations of, 261, 262.

Triple Divide Mountain, 14.

Trout, 11, 158.

Turnip, prairie, 160, 200, 324.

Twin flower, 6.

Two-Bear-Woman, mother-in-law of scout, 32.

Two Medicine River, 134, 154.

Two Guns, son of White Calf, 85, 135, 136.

Underground spirits, 17, 40, 180, 308.

United States Government, 85, 87, 119.

Vegetables, wild, 156, 160, 200, 323.

Venus, morning star, 232, 239.

Vermin, 199.

Vetch, 258, 324.

Violets, 154, 195.

Vows, by men, 88, 208, 255, 260, 313.

Vows, by women, 82, 88, 242, 243, 245, 259, 307.

Warbler, Macgillivray, 6.

Warbler, myrtle, 6.

War Bridle, sacred, 278.

War horse, 300, 312.

War song, 203, 278.


War Tepee, 256, 265, 266.

Water Monster Tepee, 264.

Weather Dancers, 310–13.

Weather Makers, 301.

Wheel game, 197.

Whiskey, 36.

Whistling-All-Night, 192.

White Antelope, wife of scout, 22, 32.

White Calf, the head chief, 22, 43, 55, 56;


dance by, 61;
prayers by, 62, 303;
wives of, 83;
home of, 85;
character, 85, 244, 298, 305, 308, 309. [336]

White Grass, medicine man, 22, 55, 58;


prayer by, 61;
author painted by, 62;
character, 92, 243, 248, 261, 279.

White Weasel Moccasin, Indian name of author, 61;


in Buffalo Dance, 66, 136, 191, 194, 206.

Willow Creek, 247, 250.

Wind-flower, 162, 320.

Wind Maker, 16.

Winter-counts, 212.

Winter Tepee. See Snow Tepee.

Wipes-His-Eyes, 260.
Wives, number of, 82;
distant, 83.

Wolf Eagle, 276.

Wolf Plume, 22, 313.

Wolf Song, 281.

Wolf Tail, son of head chief, 85, 260.

Wolf Trail. See Milky way.

Wolverine, 129, 160.

Wolves, gray, 150, 210.

Women, industries of, 200, 255, 256;


chastity of, 82, 246, 307;
vows by, 82, 242, 243, 245, 307.

Woodcraft, 5.

Woodpecker, 226.

Worm People Band, 251.

Wren, winter, 6.

Yellow Bird, relative of scout, 24–31, 109–14, 121, 139–46.

Yellow Buffalo Tepee, 262.

Yellow Owl, 84.

Yellowstone River, 87, 211, 213.

Yellow-throat, Western, 159, 195, 258.


Colophon
Availability

This eBook is for the use of anyone anywhere at no cost and with
almost no restrictions whatsoever. You may copy it, give it away or re-
use it under the terms of the Project Gutenberg License included with
this eBook or online at www.gutenberg.org ↗️.

This eBook is produced by the Online Distributed Proofreading Team


at www.pgdp.net ↗️. The music in this book has been transcribed by
Jude Eylander.

Metadata

Title: Old Indian trails


Author: Walter McClintock (1870–1949) Info ↗️
Language: English
Original publication date: 1923

Revision History

2022-05-08 Started.

External References

This Project Gutenberg eBook contains external references. These


links may not work for you.

Corrections

The following corrections have been applied to the text:


Page Source Correction Edit
distance
11 hood hook 1
28 poineer pioneer 2
Strikes-on-both- Strikes-on-Both-
54 1
Sides Sides
55 Mad-Wolf Mad Wolf 1
Dives-under- Dives-Under-
85 1
Water Water
90 ’” ”’ 2
94 [Not in source] ’ 1
113 biggame big game 1
Brings-down- Brings-Down-
165 1
the-Sun the-Sun
194 midddle middle 1
228 [Not in source] “ 1
260 supernatual supernatural 1
284 Drags-his-Robe Drags-His-Robe 1
309 meantine meantime 1
319 [Not in source] , 1
320 A-sa-po-pinats A-sa-po-pin-ats 1
323 Kinnikinick Kinnekinnick 2
329 A-pe-ech-e-ken Á-pe-ech-e-ken 1 / 0
333,
333,
333,
333,
334,
334,
335, ; , 1
335,
335,
335,
335,
336,
336
334, Siksikaíkoan Siksikaí-koan 1
334
*** END OF THE PROJECT GUTENBERG EBOOK OLD INDIAN
TRAILS ***

Updated editions will replace the previous one—the old editions


will be renamed.

Creating the works from print editions not protected by U.S.


copyright law means that no one owns a United States copyright
in these works, so the Foundation (and you!) can copy and
distribute it in the United States without permission and without
paying copyright royalties. Special rules, set forth in the General
Terms of Use part of this license, apply to copying and
distributing Project Gutenberg™ electronic works to protect the
PROJECT GUTENBERG™ concept and trademark. Project
Gutenberg is a registered trademark, and may not be used if
you charge for an eBook, except by following the terms of the
trademark license, including paying royalties for use of the
Project Gutenberg trademark. If you do not charge anything for
copies of this eBook, complying with the trademark license is
very easy. You may use this eBook for nearly any purpose such
as creation of derivative works, reports, performances and
research. Project Gutenberg eBooks may be modified and
printed and given away—you may do practically ANYTHING in
the United States with eBooks not protected by U.S. copyright
law. Redistribution is subject to the trademark license, especially
commercial redistribution.

START: FULL LICENSE


THE FULL PROJECT GUTENBERG LICENSE
PLEASE READ THIS BEFORE YOU DISTRIBUTE OR USE THIS WORK

To protect the Project Gutenberg™ mission of promoting the


free distribution of electronic works, by using or distributing this
work (or any other work associated in any way with the phrase
“Project Gutenberg”), you agree to comply with all the terms of
the Full Project Gutenberg™ License available with this file or
online at www.gutenberg.org/license.

Section 1. General Terms of Use and


Redistributing Project Gutenberg™
electronic works
1.A. By reading or using any part of this Project Gutenberg™
electronic work, you indicate that you have read, understand,
agree to and accept all the terms of this license and intellectual
property (trademark/copyright) agreement. If you do not agree to
abide by all the terms of this agreement, you must cease using
and return or destroy all copies of Project Gutenberg™
electronic works in your possession. If you paid a fee for
obtaining a copy of or access to a Project Gutenberg™
electronic work and you do not agree to be bound by the terms
of this agreement, you may obtain a refund from the person or
entity to whom you paid the fee as set forth in paragraph 1.E.8.

1.B. “Project Gutenberg” is a registered trademark. It may only


be used on or associated in any way with an electronic work by
people who agree to be bound by the terms of this agreement.
There are a few things that you can do with most Project
Gutenberg™ electronic works even without complying with the
full terms of this agreement. See paragraph 1.C below. There
are a lot of things you can do with Project Gutenberg™
electronic works if you follow the terms of this agreement and
help preserve free future access to Project Gutenberg™
electronic works. See paragraph 1.E below.
1.C. The Project Gutenberg Literary Archive Foundation (“the
Foundation” or PGLAF), owns a compilation copyright in the
collection of Project Gutenberg™ electronic works. Nearly all the
individual works in the collection are in the public domain in the
United States. If an individual work is unprotected by copyright
law in the United States and you are located in the United
States, we do not claim a right to prevent you from copying,
distributing, performing, displaying or creating derivative works
based on the work as long as all references to Project
Gutenberg are removed. Of course, we hope that you will
support the Project Gutenberg™ mission of promoting free
access to electronic works by freely sharing Project
Gutenberg™ works in compliance with the terms of this
agreement for keeping the Project Gutenberg™ name
associated with the work. You can easily comply with the terms
of this agreement by keeping this work in the same format with
its attached full Project Gutenberg™ License when you share it
without charge with others.

1.D. The copyright laws of the place where you are located also
govern what you can do with this work. Copyright laws in most
countries are in a constant state of change. If you are outside
the United States, check the laws of your country in addition to
the terms of this agreement before downloading, copying,
displaying, performing, distributing or creating derivative works
based on this work or any other Project Gutenberg™ work. The
Foundation makes no representations concerning the copyright
status of any work in any country other than the United States.

1.E. Unless you have removed all references to Project


Gutenberg:

1.E.1. The following sentence, with active links to, or other


immediate access to, the full Project Gutenberg™ License must
appear prominently whenever any copy of a Project
Gutenberg™ work (any work on which the phrase “Project
Gutenberg” appears, or with which the phrase “Project
Gutenberg” is associated) is accessed, displayed, performed,
viewed, copied or distributed:

This eBook is for the use of anyone anywhere in the


United States and most other parts of the world at no
cost and with almost no restrictions whatsoever. You may
copy it, give it away or re-use it under the terms of the
Project Gutenberg License included with this eBook or
online at www.gutenberg.org. If you are not located in the
United States, you will have to check the laws of the
country where you are located before using this eBook.

1.E.2. If an individual Project Gutenberg™ electronic work is


derived from texts not protected by U.S. copyright law (does not
contain a notice indicating that it is posted with permission of the
copyright holder), the work can be copied and distributed to
anyone in the United States without paying any fees or charges.
If you are redistributing or providing access to a work with the
phrase “Project Gutenberg” associated with or appearing on the
work, you must comply either with the requirements of
paragraphs 1.E.1 through 1.E.7 or obtain permission for the use
of the work and the Project Gutenberg™ trademark as set forth
in paragraphs 1.E.8 or 1.E.9.

1.E.3. If an individual Project Gutenberg™ electronic work is


posted with the permission of the copyright holder, your use and
distribution must comply with both paragraphs 1.E.1 through
1.E.7 and any additional terms imposed by the copyright holder.
Additional terms will be linked to the Project Gutenberg™
License for all works posted with the permission of the copyright
holder found at the beginning of this work.

1.E.4. Do not unlink or detach or remove the full Project


Gutenberg™ License terms from this work, or any files
containing a part of this work or any other work associated with
Project Gutenberg™.
1.E.5. Do not copy, display, perform, distribute or redistribute
this electronic work, or any part of this electronic work, without
prominently displaying the sentence set forth in paragraph 1.E.1
with active links or immediate access to the full terms of the
Project Gutenberg™ License.

1.E.6. You may convert to and distribute this work in any binary,
compressed, marked up, nonproprietary or proprietary form,
including any word processing or hypertext form. However, if
you provide access to or distribute copies of a Project
Gutenberg™ work in a format other than “Plain Vanilla ASCII” or
other format used in the official version posted on the official
Project Gutenberg™ website (www.gutenberg.org), you must, at
no additional cost, fee or expense to the user, provide a copy, a
means of exporting a copy, or a means of obtaining a copy upon
request, of the work in its original “Plain Vanilla ASCII” or other
form. Any alternate format must include the full Project
Gutenberg™ License as specified in paragraph 1.E.1.

1.E.7. Do not charge a fee for access to, viewing, displaying,


performing, copying or distributing any Project Gutenberg™
works unless you comply with paragraph 1.E.8 or 1.E.9.

1.E.8. You may charge a reasonable fee for copies of or


providing access to or distributing Project Gutenberg™
electronic works provided that:

• You pay a royalty fee of 20% of the gross profits you derive from
the use of Project Gutenberg™ works calculated using the
method you already use to calculate your applicable taxes. The
fee is owed to the owner of the Project Gutenberg™ trademark,
but he has agreed to donate royalties under this paragraph to
the Project Gutenberg Literary Archive Foundation. Royalty
payments must be paid within 60 days following each date on
which you prepare (or are legally required to prepare) your
periodic tax returns. Royalty payments should be clearly marked
as such and sent to the Project Gutenberg Literary Archive
Foundation at the address specified in Section 4, “Information
about donations to the Project Gutenberg Literary Archive
Foundation.”

• You provide a full refund of any money paid by a user who


notifies you in writing (or by e-mail) within 30 days of receipt that
s/he does not agree to the terms of the full Project Gutenberg™
License. You must require such a user to return or destroy all
copies of the works possessed in a physical medium and
discontinue all use of and all access to other copies of Project
Gutenberg™ works.

• You provide, in accordance with paragraph 1.F.3, a full refund of


any money paid for a work or a replacement copy, if a defect in
the electronic work is discovered and reported to you within 90
days of receipt of the work.

• You comply with all other terms of this agreement for free
distribution of Project Gutenberg™ works.

1.E.9. If you wish to charge a fee or distribute a Project


Gutenberg™ electronic work or group of works on different
terms than are set forth in this agreement, you must obtain
permission in writing from the Project Gutenberg Literary
Archive Foundation, the manager of the Project Gutenberg™
trademark. Contact the Foundation as set forth in Section 3
below.

1.F.

1.F.1. Project Gutenberg volunteers and employees expend


considerable effort to identify, do copyright research on,
transcribe and proofread works not protected by U.S. copyright
law in creating the Project Gutenberg™ collection. Despite
these efforts, Project Gutenberg™ electronic works, and the
medium on which they may be stored, may contain “Defects,”
such as, but not limited to, incomplete, inaccurate or corrupt
data, transcription errors, a copyright or other intellectual
property infringement, a defective or damaged disk or other
medium, a computer virus, or computer codes that damage or
cannot be read by your equipment.

1.F.2. LIMITED WARRANTY, DISCLAIMER OF DAMAGES -


Except for the “Right of Replacement or Refund” described in
paragraph 1.F.3, the Project Gutenberg Literary Archive
Foundation, the owner of the Project Gutenberg™ trademark,
and any other party distributing a Project Gutenberg™ electronic
work under this agreement, disclaim all liability to you for
damages, costs and expenses, including legal fees. YOU
AGREE THAT YOU HAVE NO REMEDIES FOR NEGLIGENCE,
STRICT LIABILITY, BREACH OF WARRANTY OR BREACH
OF CONTRACT EXCEPT THOSE PROVIDED IN PARAGRAPH
1.F.3. YOU AGREE THAT THE FOUNDATION, THE
TRADEMARK OWNER, AND ANY DISTRIBUTOR UNDER
THIS AGREEMENT WILL NOT BE LIABLE TO YOU FOR
ACTUAL, DIRECT, INDIRECT, CONSEQUENTIAL, PUNITIVE
OR INCIDENTAL DAMAGES EVEN IF YOU GIVE NOTICE OF
THE POSSIBILITY OF SUCH DAMAGE.

1.F.3. LIMITED RIGHT OF REPLACEMENT OR REFUND - If


you discover a defect in this electronic work within 90 days of
receiving it, you can receive a refund of the money (if any) you
paid for it by sending a written explanation to the person you
received the work from. If you received the work on a physical
medium, you must return the medium with your written
explanation. The person or entity that provided you with the
defective work may elect to provide a replacement copy in lieu
of a refund. If you received the work electronically, the person or
entity providing it to you may choose to give you a second
opportunity to receive the work electronically in lieu of a refund.
If the second copy is also defective, you may demand a refund
in writing without further opportunities to fix the problem.

1.F.4. Except for the limited right of replacement or refund set


forth in paragraph 1.F.3, this work is provided to you ‘AS-IS’,
WITH NO OTHER WARRANTIES OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO
WARRANTIES OF MERCHANTABILITY OR FITNESS FOR
ANY PURPOSE.

1.F.5. Some states do not allow disclaimers of certain implied


warranties or the exclusion or limitation of certain types of
damages. If any disclaimer or limitation set forth in this
agreement violates the law of the state applicable to this
agreement, the agreement shall be interpreted to make the
maximum disclaimer or limitation permitted by the applicable
state law. The invalidity or unenforceability of any provision of
this agreement shall not void the remaining provisions.

1.F.6. INDEMNITY - You agree to indemnify and hold the


Foundation, the trademark owner, any agent or employee of the
Foundation, anyone providing copies of Project Gutenberg™
electronic works in accordance with this agreement, and any
volunteers associated with the production, promotion and
distribution of Project Gutenberg™ electronic works, harmless
from all liability, costs and expenses, including legal fees, that
arise directly or indirectly from any of the following which you do
or cause to occur: (a) distribution of this or any Project
Gutenberg™ work, (b) alteration, modification, or additions or
deletions to any Project Gutenberg™ work, and (c) any Defect
you cause.

Section 2. Information about the Mission of


Project Gutenberg™
Project Gutenberg™ is synonymous with the free distribution of
electronic works in formats readable by the widest variety of
computers including obsolete, old, middle-aged and new
computers. It exists because of the efforts of hundreds of
volunteers and donations from people in all walks of life.

Volunteers and financial support to provide volunteers with the


assistance they need are critical to reaching Project
Gutenberg™’s goals and ensuring that the Project Gutenberg™
collection will remain freely available for generations to come. In
2001, the Project Gutenberg Literary Archive Foundation was
created to provide a secure and permanent future for Project
Gutenberg™ and future generations. To learn more about the
Project Gutenberg Literary Archive Foundation and how your
efforts and donations can help, see Sections 3 and 4 and the
Foundation information page at www.gutenberg.org.

Section 3. Information about the Project


Gutenberg Literary Archive Foundation
The Project Gutenberg Literary Archive Foundation is a non-
profit 501(c)(3) educational corporation organized under the
laws of the state of Mississippi and granted tax exempt status by
the Internal Revenue Service. The Foundation’s EIN or federal
tax identification number is 64-6221541. Contributions to the
Project Gutenberg Literary Archive Foundation are tax
deductible to the full extent permitted by U.S. federal laws and
your state’s laws.

The Foundation’s business office is located at 809 North 1500


West, Salt Lake City, UT 84116, (801) 596-1887. Email contact
links and up to date contact information can be found at the
Foundation’s website and official page at
www.gutenberg.org/contact

Section 4. Information about Donations to


the Project Gutenberg Literary Archive
Foundation
Project Gutenberg™ depends upon and cannot survive without
widespread public support and donations to carry out its mission
of increasing the number of public domain and licensed works
that can be freely distributed in machine-readable form

You might also like