我构建了一个 REST-API,它将图像上传到我的 Azure 存储容器。我的 azure 存储容器有一个访问 key ,我在 POST 方法中使用它,如下所示:
StorageCredentials storageCredentials = new StorageCredentials("[storage]", "[key]");
现在我想将我的服务部署到 azure 云 - 但我不知道如何使用 POST 方法中的明文访问 key 来管理安全问题。
Where should I save sensitive data like this? Or are my worries wrong and this is not an issue?
信息: REST-API 是一个 ASP.NET Web API 项目
最佳答案
Azure portal => your web app => Configuration => Application Settings
这是最简单的。
您还可以使用 key 保管库,但应用程序设置是迄今为止最简单的,非常适合这种情况。
For ASP.NET and ASP.NET Core developers, setting app settings in App Service are like setting them in in Web.config or appsettings.json, but the values in App Service override the ones in Web.config or appsettings.json
您可以在这里阅读更多相关信息:https://learn.microsoft.com/bs-latn-ba/azure/app-service/configure-common
关于c# - Azure 云存储凭据的保存位置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58781672/