限制用户访问Azure CosmosDB MongoDB数据库(Restrict user access to Azure CosmosDB MongoDB Database)

编程入门 行业动态 更新时间:2024-10-25 07:24:31
限制用户访问Azure CosmosDB MongoDB数据库(Restrict user access to Azure CosmosDB MongoDB Database)

Azure CosmosDB - MongoDB在帐户级别提供读写和只读密钥。 CosmosDB SDK和API可以在其中创建用户,并且可以在数据库和文档级别定义访问权限。

•但是我需要做的是创建一对用户名和密码,并对MongoDB数据库进行受限访问,类似于可安装的MongoDB提供的数据库。

•用户如何使用RoboMongo仅连接CosmosDB MongoDB数据库。

高度赞赏任何帮助。

Azure CosmosDB - MongoDB provides keys for Read-Write and Read Only at account level. CosmosDB SDK and API are there through which users can be created and access can be define at database and document level.

• But What I need to do is to create a pair of username and password with restricted access to a MongoDB database similar to one provided by installable MongoDB.

• How a user can connect only CosmosDB MongoDB database using RoboMongo.

Highly appreciate any help.

最满意答案

阿米特 -

今天,通过使用两个密钥,主密钥和只读密钥来提供宇宙数据库访问。 但是,如果要限制用户对每个集合,每个文档等的访问权限,则必须使用资源令牌。 你可以在这里阅读更多关于它的信息 ,请看看CH9视频 ,看看实施细节。 资源令牌服务可以实现为Azure功能。 这里是让你开始的代码 。

但是,如果您使用的是RoboMongo,则必须使用本文档中定义的键。 此时您无法为数据库定义不同的用户和密钥。

Amit -

Today, Cosmos DB access are provided by using two keys, Master Key and Read Only key. However, if you want to restrict user access per collection, per document etc, you have to use Resource Tokens. You can read more about it here and please take a look at CH9 video to see the implementation details. Resource Token service can be implemented as an Azure Function. Here is code to get you started.

But if you are using RoboMongo you have to Use the keys as define in this document. At this time you cannot define different users and Keys for a Database.

更多推荐

本文发布于:2023-04-29 08:43:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1335960.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:数据库   用户   CosmosDB   Azure   Database

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!