Support environment variable placeholders in configuration files
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
まず、devproxyrc.json とプラグイン設定ファイルの設定読み込みを追跡し、次に ProxyUtils.ReplaceVariables、IProxyConfiguration.Env、および MinimalPermissionsPlugin の既存の置換経路を確認します。解決をどこで行うべきか決める前に、環境値と env 設定セクションがどのように表現されているかを確認します。完了条件は、書き換えスクリプトを必要とせず、示されている設定ファイル内の ${VAR_NAME} プレースホルダーが一貫して解決され、issuer URL などの埋め込みプレースホルダーもカバーされていることです。
索引モデルが issue の本文から書いたものです。
説明
Summary
Dev Proxy config files (devproxyrc.json and plugin config files like CrudApiPlugin API files) don't support environment variable placeholders. This means values that vary per environment — like Entra app client IDs or tenant IDs — must be hardcoded in config files, or users need to write scripts to patch them before running Dev Proxy.
Example: the workaround today
In the da-ristorante-api-devproxy-entra sample, we need to inject ENTRA_APP_CLIENT_ID and ENTRA_APP_TENANT_ID into the CrudApiPlugin API files. Because Dev Proxy doesn't support this, the sample includes a Node.js script that reads .env.local and rewrites the JSON config files before each run.
The config file looks like this:
{
"entraAuthConfig": {
"audience": "<ENTRA_APP_CLIENT_ID>",
"issuer": "https://login.microsoftonline.com/<ENTRA_APP_TENANT_ID>/v2.0"
}
}
And the script manually replaces those placeholders with values from env files. This works but adds friction — extra tooling, an extra build step, and mutated config files that can accidentally get committed.
What I'd like to see
Support for environment variable references in config files, for example:
{
"entraAuthConfig": {
"audience": "${ENTRA_APP_CLIENT_ID}",
"issuer": "https://login.microsoftonline.com/${ENTRA_APP_TENANT_ID}/v2.0"
}
}
When Dev Proxy loads a config file, it would resolve ${VAR_NAME} placeholders against environment variables (or the env config section).
Why this seems feasible
Dev Proxy already has closely related infrastructure:
- Path tokens:
~appFolderand~dataFolderare resolved viaProxyUtils.ReplacePathTokenswhen loading config/plugin paths @dynamictokens: used in mock responses and rate limiting headers, resolved at runtimeProxyUtils.ReplaceVariables: a general-purpose string replacement utility that replaces variable references in a string given a dictionary of valuesIProxyConfiguration.Env: the proxy configuration already exposes aDictionary<string, string> EnvpropertyMinimalPermissionsPluginalready usesProxyUtils.ReplaceVariables(fileContents, ProxyConfiguration.Env, v => $"{{{v}}}")to resolve{VAR}placeholders in OpenAPI spec files
The pattern is already proven in plugins — it just needs to be applied when loading configuration files too.
Benefits
- No more wrapper scripts to inject environment-specific values
- Config files stay clean and committable (no secrets, no environment-specific values)
- Consistent with how other tools handle this (Docker Compose, Azure Pipelines, GitHub Actions, etc.)
- Works naturally with
.envfiles and CI/CD environments
- 主要言語
- C#
- スター
- 833
- フォーク
- 90
- 平均マージ
- 18時間 41分
- マージ済み PR(30日)
- 45
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
dotnet/dev-proxy のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信
-
waiting for response
難易度 4/5 3〜5日 初心者へのやさしさ 28/100
dotnet/dev-proxy#1914 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
MockStdioResponsePlugin: @stdin.body.id placeholder fails to resolve when messages arrive back-to-back after an id-less message再び着手できるかも @garrytrinder が 85 日前に担当しましたが、オープン中のプルリクエストはありません。 オープン
dotnet/dev-proxy#1757 · リアクション 1 件 · 担当者 2 名 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 55/100
メンテナーはふだん 1 日以内に返信
dotnet/dev-proxy の issue をすべて見る
似ている issue
-
S: Untriaged
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
space-wizards/space-station-14#46357 ·
メンテナーはふだん 1 日以内に返信
-
Versioning_oM: Remove unneeded depeendecy on Test_oM対応中かも @IsakNaslundBh が今日担当しました。 オープンtype:bug type:compliance
難易度 2/5 1時間未満 初心者へのやさしさ 85/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
MicrosoftLearning/PL-400_Microsoft-Power-Platform-Developer#231 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
joinrpg/joinrpg-net#5313 ·
メンテナーはふだん 1 日以内に返信