通过 OData 操作 Azure 表
如果我有一个 Azure 表,我需要做什么(如果有的话)才能通过 OData 公开它?
另外,OData URL 是什么样的?如果我的表 URL 是 mytable.table.core.windows.net,我应该将 Visual Studio Web 引用指向哪里才能访问此数据?
If I have an Azure table, what (if anything) do I need to do to expose it through OData?
Also, what does the OData URL look like? If my Table Url is mytable.table.core.windows.net, where should I point my Visual Studio Web reference to have access to this data?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这取决于你的意思:
访问 Azure 表中数据的唯一方法是通过 REST API 都是 OData。因此,只要您拥有正确的身份验证详细信息(这可能是非标准的,我没有尝试以这种方式使用它),您的所有表都已公开为 OData。 (URL 应为
http://myaccount.table.core.windows.net/mytable
)如果您希望在 Visual Studio 项目中使用 Azure 表,而不是通过 API 访问它,通常使用存储客户端库会更容易。
如果您想使用除当前提供的形式或身份验证之外的某种形式或身份验证来公开表中的数据(也许您希望在不泄露存储密钥的情况下公开使用它),您将必须创建自己的包装服务来执行此操作(类似于 Gaurav 提供的链接中提到的方法)
It depends on what you mean by:
The only way to access data in an Azure table is via the REST API which is all OData. So as long has you have the correct authentication details (which might be non standard, I haven't tried to use it this way), all of your tables are already exposed as OData. (the url should be
http://myaccount.table.core.windows.net/mytable
)If you're looking to use Azure tables in a Visual Studio project, rather than accessing it via the API, generally it's easier to just use the storage client library.
If you want to expose the data in a table using some form or authentication other than what is currently provided (maybe you want to make it available publicly without giving away your storage keys) you will have to create your own wrapper service to do this (similar to the method that is mentioned in the link provided by Gaurav)