【发布时间】:2018-07-24 17:27:13
【问题描述】:
我正在尝试创建一个从 .mmdb 文件 GeoLite2 Country DB 读取的 Azure 函数
我在函数旁边添加了 geolite2 文件。但是我找不到以编程方式引用文件路径的方法,以便它在我的本地机器上保持不变以及部署/发布。
string GeoLocationDbPath = "D:<path_to_project>\Functions\GeoLocation-Country.mmdb"
var reader = new DatabaseReader($"{GeoLocationDbPath}");
我偶然发现了这篇文章How to add assembly references to an Azure Function App
我希望有更好的方法来引用本地和部署的文件。
有什么想法吗?
我看过的其他链接:
How to add and reference a external file in Azure Function
How to add a reference to an Azure Function C# project?
Retrieving information about the currently running function
Azure functions – Read file and use SendGrid to send an email
【问题讨论】:
标签: azure asp.net-core azure-functions filereference geolite2