【发布时间】:2017-01-02 12:39:18
【问题描述】:
我正在 Visual Studio 2015 中创建一个 ASP.Net 5 WebAPI 应用程序,我需要使用 Azure Blob。
要使用 Azure blob,来自官方文档:https://azure.microsoft.com/en-us/documentation/articles/storage-dotnet-how-to-use-blobs/,您需要在 <appSettings /> 中的 app.config 或 web.config 文件中放置一个键值对,如下所示:
<appSettings>
<add key="StorageConnectionString" value="DefaultEndpointsProtocol=https;AccountName=account-name;AccountKey=account-key" />
</appSettings>
但问题是,如果您使用的是 ASP.Net 5,则没有名为 app.config 或 web.config 的此类文件。
如果我使用的是 ASP.Net 5,我应该把 StorageConnectionString 放在哪里?
【问题讨论】:
-
你需要在 ASP.NET Core 上学习新配置:docs.asp.net/en/latest/fundamentals/configuration.html
标签: c# azure asp.net-core azure-storage