Skip to content
Merged
Show file tree
Hide file tree
Changes from 32 commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
50b556a
run build-and-stage on pushes to Anita's branch
TimHess Feb 18, 2025
4b3648d
fix case for MySQL link (experiment)
anita-flegg Feb 24, 2025
38f66fe
full edit - Welcome section
anita-flegg Feb 26, 2025
8d21ae8
full edit Application Bootstrapping
anita-flegg Feb 26, 2025
1c4f7c1
Merge branch 'main' into anita
TimHess Feb 26, 2025
50d5ff8
V4 Updates for Metrics, Tracing and Security (#336)
TimHess Feb 26, 2025
42403a6
Merge branch 'main' into v4
TimHess Feb 26, 2025
7eddf26
Merge branch 'v4' into anita
TimHess Feb 26, 2025
2690da1
full edit Application Config, Config Server
anita-flegg Feb 26, 2025
4a5109e
full edit Application Configuration topics + Mgmt section of What's New
anita-flegg Feb 26, 2025
9aa6b44
Merge branch 'main' into anita
TimHess Feb 27, 2025
214f54e
full edit tracing section
anita-flegg Feb 27, 2025
8a9271f
full edit dynamic logging topics
anita-flegg Feb 28, 2025
dc65566
full edit management topics(1) + bulk Note wording change
anita-flegg Feb 28, 2025
013ffde
change all TIP to NOTE
anita-flegg Feb 28, 2025
b14a510
full edit management topics(2) + bulk Note wording change
anita-flegg Mar 3, 2025
9e79995
full edit management topics(3)
anita-flegg Mar 3, 2025
8f2d1b7
full edit file share topics
anita-flegg Mar 3, 2025
87ac38e
full edit Security topics + some consistency changes
anita-flegg Mar 4, 2025
35e6328
full edit connector topics (1)
anita-flegg Mar 5, 2025
f45262f
full edit connector topics (2)
anita-flegg Mar 5, 2025
0e66efa
full edit Service Discovery topics
anita-flegg Mar 6, 2025
d1e55e3
full edit Initializr topics
anita-flegg Mar 6, 2025
bc2ea58
Merge remote-tracking branch 'origin/anita' into merge-from-anita
TimHess Mar 6, 2025
f46516b
fix pipeline, stray spaces and rogue comma
TimHess Mar 6, 2025
af36f17
Apply suggestions from code review
TimHess Mar 13, 2025
185fce2
Update api/v4/management/prometheus.md
anita-flegg Mar 13, 2025
773305d
Apply suggestions from code review
TimHess Mar 26, 2025
a186b8d
apply suggestions from review
TimHess Mar 26, 2025
b50f582
Merge branch 'main' into merge-from-anita
TimHess Mar 26, 2025
ae1f5a8
Review feedback
bart-vmware Mar 27, 2025
4d4451a
Revert changes from shell to bash code fence
bart-vmware Mar 27, 2025
83ec2e0
Apply suggestions from code review
TimHess Mar 27, 2025
33252ee
Apply suggestions from code review
bart-vmware Mar 28, 2025
57c8863
Fix incorrect link
bart-vmware Mar 28, 2025
d7aedc9
Revert footnote changes
bart-vmware Mar 28, 2025
2a06d40
Address review feedback
bart-vmware Mar 28, 2025
97f66da
Fix copy/paste error
bart-vmware Mar 28, 2025
61252ad
Revert callouts to docfx style and review their severeties
bart-vmware Mar 28, 2025
4ce8e70
Match up description with link target
bart-vmware Mar 28, 2025
920c3b0
Apply suggestions from code review
bart-vmware Apr 2, 2025
c22f9ed
Remove trailing periods from markdown tables
bart-vmware Apr 3, 2025
79c9a2d
Unify JSON response line
bart-vmware Apr 3, 2025
d461ee4
Convert headings to bullets
bart-vmware Apr 3, 2025
9310649
Do not use mention
bart-vmware Apr 3, 2025
26f14eb
Fix comma
bart-vmware Apr 3, 2025
4423730
Various
bart-vmware Apr 3, 2025
f07d30f
Update api/v4/connectors/redis.md
bart-vmware Apr 4, 2025
6e43d76
Final pass over all changes
bart-vmware Apr 4, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions api/v4/bootstrap/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Get started by adding a reference to the AutoConfiguration package (you may want
dotnet add package Steeltoe.Bootstrap.AutoConfiguration
```

After adding the NuGet reference(s), simply include `.AddSteeltoe()` like you see in the code below and you're all set with the basic implementation.
After adding the NuGet reference(s), include `.AddSteeltoe()` like you see in the code below and you're all set with the basic implementation.

```csharp
using Steeltoe.Bootstrap.AutoConfiguration;
Expand All @@ -19,17 +19,17 @@ builder.AddSteeltoe();

## Supported Steeltoe Packages

`Steeltoe.Bootstrap.AutoConfiguration` is not a meta-package. In order for a Steeltoe feature to be automatically bootstrapped in the application, the appropriate NuGet package must also be referenced. The following table describes the Steeltoe package that is required to light up a feature and any additional packages that may also be installed:
`Steeltoe.Bootstrap.AutoConfiguration` is not a meta-package. For a Steeltoe feature to be automatically bootstrapped in the application, the appropriate NuGet package must also be referenced. The following table describes the Steeltoe package that is required to light up a feature, and any additional packages that may also be installed:

| Feature Description | Steeltoe Package | Additional Packages |
| Feature Description | Steeltoe Package | Additional Packages |
| --- | --- | --- |
| [Config Server Configuration Provider](../configuration/config-server-provider.md) | `Steeltoe.Configuration.ConfigServer` | Optional: `Steeltoe.Discovery.Eureka` to use discovery-first |
| [Cloud Foundry Configuration Provider](../configuration/cloud-foundry-provider.md) |`Steeltoe.Configuration.CloudFoundry` | N/A |
| [Random Value Configuration Provider](../configuration/random-value-provider.md) |`Steeltoe.Configuration.RandomValue` | N/A |
| [Placeholder Configuration Provider](../configuration/placeholder-provider.md) |`Steeltoe.Configuration.Placeholder` | N/A |
| [Encrypted Configuration Provider](../configuration/decryption-provider.md) | `Steeltoe.Configuration.Encryption` | N/A |
| [Spring Boot Configuration Provider](../configuration/spring-boot-provider.md) | `Steeltoe.Configuration.SpringBoot` | N/A |
| [Connectors](../connectors/index.md) |`Steeltoe.Connectors` | Required: Supported driver [^1] (MySQL, PostgreSQL, SQL Server, MongoDB, CosmosDB, Redis, RabbitMQ) |
| [Connectors](../connectors/index.md) |`Steeltoe.Connectors` | Required: Supported driver [^1] (MySQL, PostgreSQL, SQL Server, MongoDB, CosmosDB, Redis/Valkey, RabbitMQ) |
| [Eureka Service Discovery](../discovery/netflix-eureka.md) |`Steeltoe.Discovery.Eureka` | Optional: `Steeltoe.Management.Endpoint` for health checks |
| [Consul Service Discovery](../discovery/hashicorp-consul.md) |`Steeltoe.Discovery.Consul` | N/A |
| [Configuration-based Service Discovery](../discovery/configuration-based.md) |`Steeltoe.Discovery.Configuration` | N/A |
Expand All @@ -38,11 +38,11 @@ builder.AddSteeltoe();
| [Actuators](../management/index.md) | `Steeltoe.Management.Endpoint` | N/A |
| [Distributed Tracing](../tracing/index.md) | `Steeltoe.Management.Tracing` | N/A |

[^1]: Individual connector clients will only be configured if a corresponding supported driver NuGet package reference is also included.
[^1]: Individual connector clients are only configured if a corresponding supported driver NuGet package reference is also included.

## Excluding Components

If you wish to exclude a component from the automatic bootstrap process, you may add the feature's assembly name to the exclusions list. One example where this feature would be desired is if you want to control the order in which configuration providers are added. This example shows how to provide exclusions:
If you want to exclude a component from the automatic bootstrap process, you may add the feature's assembly name to the exclusions list. One example where this feature would be desired is if you want to control the order in which configuration providers are added. This example shows how to provide exclusions:

```csharp
using Steeltoe.Bootstrap.AutoConfiguration;
Expand All @@ -51,12 +51,12 @@ HashSet<string> assemblyNamesToExclude = [SteeltoeAssemblyNames.ConfigurationCon
builder.AddSteeltoe(assemblyNamesToExclude);
```

> [!TIP]
> The static class `SteeltoeAssemblyNames` enables to easily find the name of any specific assembly to exclude.
> [!NOTE]
> The static class `SteeltoeAssemblyNames` enables you to easily find the name of any specific assembly to exclude.

## Logging inside Configuration Providers

For some Steeltoe components, primarily configuration providers, providing a `LoggerFactory` is required to retrieve logs for debugging. Use the optional parameter to provide one as needed:
For some Steeltoe components, primarily configuration providers, a `LoggerFactory` is required to retrieve logs for debugging. Use the optional parameter to provide one as needed:

```csharp
using Microsoft.Extensions.Logging.Debug;
Expand All @@ -72,7 +72,7 @@ builder.AddSteeltoe(loggerFactory);
```

Alternatively, you can use `BootstrapLoggerFactory`. It logs to the console until the service container has been built.
Once the service container has become available, it automatically upgrades existing loggers to use the application configuration.
After the service container has become available, it automatically upgrades existing loggers to use the application configuration.

```csharp
using Steeltoe.Bootstrap.AutoConfiguration;
Expand All @@ -84,11 +84,11 @@ builder.AddSteeltoe(loggerFactory);

## Limitations

At this time there is no support for:
Currently unsupported:

* Features that need to be configured directly in `IApplicationBuilder`, such as Cloud Foundry SSO and JWT.
* Features that require a custom type (such as a `DbContext`) for setup.

## Feedback

Love it? Hate it? Want to know more or make a suggestion? Let us know by [filing an issue](https://github.com/SteeltoeOSS/Steeltoe/issues/new/choose), [joining us on slack](https://slack.steeltoe.io/) or [Tweeting at us](https://twitter.com/steeltoeoss)
Love it? Hate it? Want to know more or make a suggestion? Let us know by filing an [issue](https://github.com/SteeltoeOSS/Steeltoe/issues/new/choose), joining us on [Slack](https://slack.steeltoe.io/) or [Tweeting us](https://twitter.com/steeltoeoss)
30 changes: 15 additions & 15 deletions api/v4/configuration/cloud-foundry-provider.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

The Cloud Foundry provider enables the standard Cloud Foundry environment variables (`VCAP_APPLICATION`, `VCAP_SERVICES`, and `CF_*`) to be parsed and accessed as configuration data within a .NET application.

Cloud Foundry creates and uses these environment variables to communicate an application's environment and configuration to the application code running inside a container. More specifically, the values found in `VCAP_APPLICATION` provide information about the application's resource limits, routes (URIs), and version numbers, among other things. The `VCAP_SERVICES` environment variable provides information about the external services (databases, caches, and so on) to which the application is bound, along with details on how to contact those services.
Cloud Foundry creates and uses these environment variables to communicate an application's environment and configuration to the application code running inside a container. More specifically, the values found in `VCAP_APPLICATION` provide information about the application's resource limits, routes (URIs), and version numbers, among other things. The `VCAP_SERVICES` environment variable provides information about the external services (databases, caches, and so on) to which the application is bound, along with details for contacting those services.

You can read more information on the Cloud Foundry environment variables at the [Cloud Foundry docs](https://docs.cloudfoundry.org/devguide/deploy-apps/environment-variable.html) website.
For more information about the Cloud Foundry environment variables, see the [Cloud Foundry documentation](https://docs.cloudfoundry.org/devguide/deploy-apps/environment-variable.html).

## Usage
## Using the Cloud Foundry Provider

You should have a good understanding of how the [.NET Configuration System](https://learn.microsoft.com/aspnet/core/fundamentals/configuration) works before starting to use this provider.

To use the Steeltoe Cloud Foundry provider, you need to do the following:
To use the Steeltoe Cloud Foundry provider:

1. Add the appropriate NuGet package reference to your project.
1. Add the provider to the host builder or configuration builder.
Expand All @@ -19,13 +19,13 @@ To use the Steeltoe Cloud Foundry provider, you need to do the following:

### Add NuGet Reference

To use the provider, you need to add a reference to the `Steeltoe.Configuration.CloudFoundry` NuGet package.
To use the provider, add a reference to the `Steeltoe.Configuration.CloudFoundry` NuGet package.

### Add Configuration Provider with Options

The `AddCloudFoundryConfiguration()` host builder extension method is the easiest way to set things up. It performs
both of the individual steps described below: add the configuration provider and configure options.
The following example shows how to do so:
both of the individual steps described below: adding the configuration provider and configuring the options.
See the following example:

```csharp
using Steeltoe.Configuration.CloudFoundry;
Expand All @@ -34,7 +34,7 @@ var builder = WebApplication.CreateBuilder(args);
builder.AddCloudFoundryConfiguration();
```

#### Add Configuration Provider
#### Add Configuration Provider without options

If you don't want to use the host builder extension method, the following code shows how to add the Cloud Foundry configuration provider to the `ConfigurationBuilder`:

Expand All @@ -48,7 +48,7 @@ var configuration = configurationBuilder.Build();

### Access Configuration Data

Once the configuration has been built, the values from the `VCAP_APPLICATION` and `VCAP_SERVICES` environment variables have been added to the application's configuration data and become available under keys prefixed with `vcap:application` and `vcap:services` respectively.
After the configuration has been built, the values from the `VCAP_APPLICATION` and `VCAP_SERVICES` environment variables have been added to the application's configuration data and become available under keys prefixed with `vcap:application` and `vcap:services`, respectively.

You can access the values from the `VCAP_APPLICATION` environment variable settings directly from the `IConfiguration` as follows:

Expand All @@ -57,9 +57,9 @@ var appName = configuration["vcap:application:application_name"];
var instanceId = configuration["vcap:application:instance_id"];
```

A list of all `VCAP_APPLICATION` keys is available in the [VCAP_APPLICATION](https://docs.CloudFoundry.org/devguide/deploy-apps/environment-variable.html#VCAP-APPLICATION) topic of the Cloud Foundry documentation.
A list of all `VCAP_APPLICATION` keys is available in [VCAP_APPLICATION](https://docs.CloudFoundry.org/devguide/deploy-apps/environment-variable.html#VCAP-APPLICATION), in the Cloud Foundry documentation.

You can also directly access the values from the `VCAP_SERVICES` environment variable. For example, to access the information about the first instance of a bound Cloud Foundry service with the name `service-name`, you could code the following:
You can also access the values directly from the `VCAP_SERVICES` environment variable. For example, to access the information about the first instance of a bound Cloud Foundry service with the name `service-name`, you could code the following:

```csharp
var name = configuration["vcap:services:service-name:0:name"];
Expand All @@ -69,15 +69,15 @@ var uri = configuration["vcap:services:service-name:0:credentials:uri"];
A list of all `VCAP_SERVICES` keys is available in the [VCAP_SERVICES](https://docs.CloudFoundry.org/devguide/deploy-apps/environment-variable.html#VCAP-SERVICES) topic of the Cloud Foundry documentation.

> [!NOTE]
> This provider uses the built-in .NET [JSON configuration provider](https://learn.microsoft.com/dotnet/core/extensions/configuration-providers#json-configuration-provider) when parsing the JSON provided in the `VCAP_*` environment variables. As a result, you can expect the exact same key names and behavior as you see when parsing JSON configuration files (such as `appsettings.json`) in your application.
> This provider uses the built-in .NET [JSON configuration provider](https://learn.microsoft.com/dotnet/core/extensions/configuration-providers#json-configuration-provider) when parsing the JSON provided in the `VCAP_*` environment variables. As a result, you can expect exactly the same key names and behavior as you see when parsing JSON configuration files (such as `appsettings.json`) in your application.

### Access Configuration Data as Options

Alternatively, instead of accessing the Cloud Foundry configuration data directly from the configuration, you can use the [Options Pattern](https://learn.microsoft.com/aspnet/core/fundamentals/configuration/options) together with [Dependency Injection](https://learn.microsoft.com/aspnet/core/fundamentals/dependency-injection) to obtain an instance of the option classes into your controllers and views.
Alternatively, instead of accessing the Cloud Foundry configuration data directly from the configuration, you can use the [Options Pattern](https://learn.microsoft.com/aspnet/core/fundamentals/configuration/options) with [Dependency Injection](https://learn.microsoft.com/aspnet/core/fundamentals/dependency-injection) to obtain an instance of the option classes into your controllers and views.

The Cloud Foundry provider includes two additional classes, `CloudFoundryApplicationOptions` and `CloudFoundryServicesOptions`. You can configure both to bind to the parsed `VCAP_*` data.

If you're not using the host builder extension method mentioned above, the `AddCloudFoundryOptions()` method can be used to configure the Cloud Foundry option classes. This method binds the parsed `VCAP_*` data to the `CloudFoundryApplicationOptions` and `CloudFoundryServicesOptions` classes. The following example shows how to do so:
If you're not using the host builder extension method described earlier, you can use the `AddCloudFoundryOptions()` method to configure the Cloud Foundry option classes. This method binds the parsed `VCAP_*` data to the `CloudFoundryApplicationOptions` and `CloudFoundryServicesOptions` classes. See the following example:

```csharp
using Steeltoe.Configuration.CloudFoundry;
Expand All @@ -87,7 +87,7 @@ builder.Configuration.AddCloudFoundry();
builder.Services.AddCloudFoundryOptions();
```

Once this is done, you can access these configuration objects in the controllers or views of an application by using normal Dependency Injection, as follows:
After this is done, you can access these configuration objects in the controllers or views of an application by using normal Dependency Injection, as follows:

```csharp
using Microsoft.AspNetCore.Mvc;
Expand Down
Loading