我已经从 linq2db T4 模板生成数据模型,并在本地开发和调试我的天蓝色函数,在 local.settings.json 中设置连接字符串。将函数部署到 Azure 后,我在 Azure 门户的应用程序设置页面设置了与 Azure SQL 数据库相同的连接字符串,但函数无法连接到数据库,它会抛出此异常:
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
local.settings.json
{
"IsEncrypted": false,
"Values": {
"AzureWebJobsDashboard": "",
"AzureWebJobsStorage": "UseDevelopmentStorage=true",
},
"ConnectionStrings": {
"IntegrationSqlDb": "constr here"
}
}