简体   繁体   English

Azure 密钥库和本地开发

[英]Azure key vault and local development

We currently use the Azure key vault product to secure our database credentials for an app hosted in Azure.我们目前使用 Azure 密钥保管库产品来保护我们在 Azure 中托管的应用程序的数据库凭据。 For local development, we still use the appsettings.json file to store our database credentials, which results in extra logic in our app to get database credentials from different places based on our environment (development or production).对于本地开发,我们仍然使用 appsettings.json 文件来存储我们的数据库凭据,这导致我们的应用程序中有额外的逻辑来根据我们的环境(开发或生产)从不同的地方获取数据库凭据。 Is this the right approach or should we just get our test credentials from the key vault regardless of the environment?这是正确的方法还是我们应该从密钥库中获取我们的测试凭据而不管环境如何? Since getting to the key vault requires some extra http calls to Azure we figured that we would avoid the extra cost where possible.由于进入密钥保管库需要对 Azure 进行一些额外的 http 调用,因此我们认为我们将尽可能避免额外的成本。 Any thought on this?对此有什么想法吗?

Personally i use a secrets.json file for local development, since it's part of the configuration environment just like appsettings.json, and easily accessed in visual studio with Manage User Secrets , but is stored with the user and thus not in source control by default我个人使用 secrets.json 文件进行本地开发,因为它是配置环境的一部分,就像 appsettings.json 一样,并且可以通过Manage User Secrets在 Visual Studio 中轻松访问,但与用户一起存储,因此默认情况下不在源代码管理中

I think you should at least switch to using a secrets.json for the database credentials, but using the azure key vault is definitely more secure.我认为您至少应该切换到使用 secrets.json 作为数据库凭据,但使用 azure 密钥库肯定更安全。 The added cost of using azure key vault in dev too shouldn't matter compared to the prod cost与产品成本相比,在开发中使用 azure 密钥库的额外成本也无关紧要

Since you have dev non prod environment I would not care much, since main idea of keyvault is to get properties.既然你有开发非生产环境,我不会太在意,因为 keyvault 的主要思想是获取属性。

In my development Java usually for local development I have properties in config file then when as soon as we deploy to azure we switch on Key vault, its not much about cost its also about flexibility I want to be able to develop offline.在我的开发 Java 通常用于本地开发时,我在配置文件中有属性,然后当我们部署到 azure 时,我们打开 Key vault,这与成本无关,但也与我希望能够离线开发的灵活性有关。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM