验证AppSettings.json作为CI/CD管道的一部分
我有此功能作为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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果缺少任何所需的配置,则可以包括一个单位测试,该单元测试会失败。
假设您正在运行单元测试作为构建管道的一部分,则如果测试失败,则应阻止部署。
这个问题可能会帮助您实现这一目标。
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.