Azure Functions连接到本地SQL Server [英] Azure Functions connect to on-premises SQL Server
问题描述
我正在尝试将新的Azure功能连接到本地SQL Server数据库. Microsoft文档提到这是可能的,但是我无法弄清楚,也没有看过任何有关专门使用Azure Functions设置本地数据库的教程.
I am trying to connect my new Azure Function to an on-premises SQL Server database. The Microsoft docs mention that this is possible, but I have not been able to figure it out nor have I seen any tutorials about specifically setting up a on-premises db with Azure Functions.
我想做与此类似的事情教程.
I want to do something similar to this tutorial.
public static async void Run(TimerInfo myTimer, TraceWriter log)
{
var str = ConfigurationManager.ConnectionStrings["on-prem-connection"].ConnectionString;
//open connections and call db here - I know this
}
我可以通过与上面的视频类似的方式来执行此操作,在该视频中,我设置了连接字符串,然后在Azure函数中引用了该连接字符串.如果是这样,那怎么办?
Can I do it in a similar way to the video above where I set up a connection string and then reference that connections string in the Azure Function. If so how is that done.
谢谢.
推荐答案
您需要使用混合连接"之类的方法.查看以下链接.希望对您有所帮助: https://azure.microsoft.com/zh-CN/documentation/articles/web-sites-hybrid-connection-connect-on-premises-sql-server/
You would need to use something like Hybrid Connection. Check out the following link. I hope it helps: https://azure.microsoft.com/en-us/documentation/articles/web-sites-hybrid-connection-connect-on-premises-sql-server/
这篇关于Azure Functions连接到本地SQL Server的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!