验证AppSettings.json作为CI/CD管道的一部分

发布于 2025-02-08 14:16:38 字数 129 浏览 3 评论 0原文

我有此功能作为startup.cs的一部分,以验证没有丢失的配置设置,并且由于丢失设置,因此该应用程序将无法运行,但是我想知道是否可以添加此功能在部署到QA/UAT/prod之前,作为管道的一部分,作为阶跃或工作。

I have this working as part of Startup.cs to validate that there are no missing configuration settings and this works as the app will fail to run if it's missing a setting, but I wondered if this can be added as a step or job as part of the pipeline before deploying to QA/UAT/Prod.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

冷血 2025-02-15 14:16:38

如果缺少任何所需的配置,则可以包括一个单位测试,该单元测试会失败。

假设您正在运行单元测试作为构建管道的一部分,则如果测试失败,则应阻止部署。

这个问题可能会帮助您实现这一目标。

You could include a Unit Test that fails if any of your required configurations are missing.

Assuming you're running the Unit Tests as part of the build pipeline, if the test fails it should prevent deployment.

This question might help you achieve this.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文