“底层提供程序在打开时失败”使用 webrole 内的 WCF 数据服务到达 sql azure db 时
在开发结构中的 webrole 内使用 WCF 数据服务访问 sql azure db 时,“底层提供程序在打开时失败”。
在管理模式下打开 VS 2010。
创建了一个新的 Windows Azure 项目。
添加了一个网络角色。
在 SQL azure 中向数据库添加了 ADO.NET 实体数据模型。这正确建立了连接,读取所有表并生成模型。连接到 Azure 数据库时使用标准 sql 身份验证。
添加了WCF数据服务项目。
当我F5解决方案时。服务定义将正确打开,显示模型中现有的表。 但是当我将表名添加到 URL 时(即实际连接到数据库时),HTTP 500 响应中会出现上述错误。
注意:我能够从 SSMS 连接到 SQL Azure 数据库。
能够在生成实体数据模型时连接到它。
当我在 Windows Azure Web 角色中托管解决方案时,一切正常。
但当我尝试在VS2010的开发模拟器中执行此操作时,它不起作用。 有什么想法吗?
"The underlying provider failed on Open" while reaching sql azure db with a WCF dataservice inside a webrole in the development Fabric.
Opened VS 2010 in admin mode.
Created a new windows azure project.
Added a webrole.
Added a ADO.NET entity data model to a database in SQL azure.This established the connection properly, read all the tables and generated the model. Used the standard sql authentication while connecting to the Azure database.
Added a WCF data service project.
When I F5 the solution. the service definition opens up correctly showing the tables that are existing in the model.
but when I add a table name to the URL (which is when the actual connection to the database is made) the above error comes up in a HTTP 500 response.
NOTE: I am able to connect to the SQL Azure database from SSMS .
Able to connect to it while generating the entity data model.
When I host the solution in Windows Azure web role everything works fine.
But it does not work when I try to do it in the Development emulator of VS2010.
Any Ideas why?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
坦白说,我不知道为什么会发生这种情况。
考虑到它在 Azure Web 角色中工作(您是否部署到真正的 azure 帐户?)并从您的 SSMS 中,我假设您已禁用 SQL Azure 防火墙,或打开它以从 Windows Azure Servives 和您的公共 IP 地址进行访问。
剩下的唯一问题是仔细检查连接字符串。当您按 F5 时,您可以中断错误并查看本地正在使用的实际连接字符串吗?这可能会让你明白为什么你会失败。
Frankly, I have no idea why this is happening.
HAving in mind it works in Azure Web Role (are you deploying to real azure account?) and from your SSMS, I assume you have either disabled the SQL Azure Firewall, or open it for access from Windows Azure Servives and your public IP Address.
The only question remaining is to double check the Connection string. When you hit F5 can you break at the error and see the actual connection string which is being used locally? That might give you a hing why you are failing.
如果您从本地开发盒连接到 SQL Azure,则需要在门户中添加防火墙规则才能使一切正常工作。检查并确保您已在门户中启用防火墙规则。
If you are connecting from your local dev box to SQL Azure you will need to add a firewall rule in the portal for everything to work properly. Check and make sure you have enabled a firewall rule in the portal.
你的问题听起来与我刚刚遇到的问题非常相似。我发现以下线程的建议对我有帮助: http://social.msdn.microsoft.com/Forums/en-US/windowsazuredevelopment/thread/ca5887aa-7720-41bb-af8a-1633347be1c5
至少就我而言,解决方法是注释掉 ServiceDefinition 配置文件的“站点”部分。华泰
Your issue sounds uncannily like the one I've just been experiencing. I found that the advice on the following thread helped me: http://social.msdn.microsoft.com/Forums/en-US/windowsazuredevelopment/thread/ca5887aa-7720-41bb-af8a-1633347be1c5
The cure, in my case at least, was to comment out the "sites" section of the ServiceDefinition config file. HTH