Skip to content

switched from config.json to secrets - #7

Merged
JesseLiberty merged 1 commit into
mainfrom
toSecrets
Aug 11, 2026
Merged

switched from config.json to secrets#7
JesseLiberty merged 1 commit into
mainfrom
toSecrets

Conversation

@JesseLiberty

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI lite review requested due to automatic review settings August 11, 2026 16:12
@JesseLiberty
JesseLiberty merged commit d059818 into main Aug 11, 2026
1 check passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR removes the local config.json-based configuration flow and switches the app to read secrets from .NET user-secrets and/or environment variables, aligning local development with CI/production secret management.

Changes:

  • Documented the new configuration approach (user-secrets + environment variables) in README.md.
  • Replaced config.json parsing with Microsoft.Extensions.Configuration providers in Program.cs.
  • Added UserSecretsId and configuration provider package references in the project file.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
README.md Adds setup instructions for user-secrets and environment variables; clarifies config.json is no longer used.
Program.cs Switches to ConfigurationBuilder and uses required-key retrieval for OpenAI/Tavily configuration.
BlogWriter.csproj Enables user-secrets for the project and adds required configuration packages.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread Program.cs
Comment on lines +18 to +20
string GetRequired(string key) =>
config[key] ?? throw new InvalidOperationException(
$"Missing configuration value '{key}'. Set it with: dotnet user-secrets set \"{key}\" \"<value>\"");
Comment thread Program.cs
Comment on lines +11 to +16
// Secrets come from the .NET user-secrets store in development and from
// environment variables in CI/production (env vars win on key collisions).
IConfiguration config = new ConfigurationBuilder()
.AddUserSecrets<Program>()
.AddEnvironmentVariables()
.Build();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants