Users

Azure Cosmos DB is a globally distributed multi-model database that supports the document, graph, and key-value data models. The content in this section is for managing user resources using the SQL API via REST.

A user is a logical namespace for scoping permissions on collections, documents, attachment, stored procedures, triggers, and user-defined functions. The user construct lives under a database resource and thus cannot cross the database boundary it is under. The user resource is represented by users in the Azure Cosmos DB REST resource model. It is a system resource, and thus contains a fixed schema.

The following example shows an example JSON representation for a user:

{  
   "id":"JohnSmith@contoso.com",  
   "_rid":"rnYYACFnVAA=",  
   "_ts":1408056023,  
   "_self":"dbs\/rnYYAA==\/users\/rnYYACFnVAA=\/",  
   "_etag":"00004a00-0000-0000-0000-53ed3ad70000",  
   "_permissions":"permissions\/"  
}  
  
Property Description
id Required. It is the only user settable property. It is a unique name that identifies a user, that is, no two users share the same ID within a database. The name must not exceed 255 characters.
_rid It is a system generated property. The resource ID (_rid) is a unique identifier that is also hierarchical per the resource stack on the resource model. It is used internally for placement and navigation of the user resource.
_ts It is a system generated property. It specifies the last updated timestamp of the resource. The value is a timestamp.
_self It is a system generated property. It is the unique addressable URI for the resource.
_etag It is a system generated property representing the resource etag required for optimistic concurrency control.
_permissions It is a system generated property denoting the addressable path of the feed of permissions resource.

Tasks

You can do the following with users:

See Also