Azure Cosmos DB SQL(core)
  • 22 Mar 2022
  • 6 Minutes to read
  • Contributors
  • Dark
    Light
  • PDF

Azure Cosmos DB SQL(core)

  • Dark
    Light
  • PDF

Article summary

Azure Cosmos DB SQL(core)

Cerebrata makes managing the data stored in your Cosmos DB SQL API accounts super easy. From managing databases, containers to documents, Cerebrata provides the most extensive set of features.
Loaded with features like viewing documents in multiple formats, built-in query manager, stored procedures, functions and triggers and more, you don't have to look beyond Cerebrata.

View Properties

Note

Properties of Cosmos SQL DB can be accessed in Cerebrata only when you associate Cosmos DB SQL via Subscription Connection.

To view the properties of the Comos SQL DB.

  1. User can traverse to the path - All resources > Azure Subscription > Required Subscription > Comos DB Accounts > Required Cosmos DB SQL
  2. Now, the user has to click on the Manage icon aligned with the Cosmos DB SQL name
    View Properties.png

User can view the following properties of Comos DB SQL.

  • Cosmos DB SQL name
  • Account API
  • Resource ID
  • Resource Group name
  • Resource Group ID
  • Subscription name
  • Subscription ID
  • Location
  • URI
  • Provisioning State
  • Offer Type
  • Default Consistency
  • Multi Region Write Enabled

User can also open the appropriate Azure resource in the Azure portal without traversing between the browser and the application, using the Open in portal option available at the top right corner.

Manage Tags

Note

Tags associated with the Cosmos DB Table can be accessed in Cerebrata only when you associate Cosmos DB SQL via Subscription Connection.

To manage the Tags associated with Cosmos DB Table.

  1. User can traverse to the path - All resources > Azure Subscription > Required Subscription > Comos DB Accounts > Required Cosmos DB SQL

  2. Now the user has to click on the Manage icon aligned with the Cosmos DB SQL name
    View Properties(2)

  3. Select the tags option available in the new tab
    Manage Tags.png

In this new tab, users can view/edit/delete an existing tag assigned to the selected Cosmos DB SQL or create new tags.
To create a new tag, click on the New tag icon > provide the tag name and tag value and click on Save.

Manage Locks

Note

Locks on a Cosmos DB SQL can be accessed in Cerebrata only when you associate the Cosmos DB SQL via Subscription Connection.

To manage the locks on Cosmos DB SQL.

  1. User can traverse to the path - All resources > Azure Subscription > Required Subscription > Comos DB Accounts > Required Cosmos DB SQL

  2. Now the user has to click on the Manage icon aligned with the Cosmos DB SQL name
    View Properties(2)

  3. Now User can click on Mangement Locks option to manage the locks
    Manage Locks.png

Create a new lock

User can create a new lock from Cerebrata with either Read-Only or Delete lock type.

  • Read-only lock: Allows a user to perform only ready. Delete and Update access is denied
  • Delete lock: Allows a user to read and modify a resource. Delete access is denied
  1. User can create a new lock on a Cosmos DB SQL, by clicking on the New Lock Icon
  2. In the popup user can provide a name for the lock and specify the lock type
  3. Clicking on Save will have the lock applied on the corresponding Cosmos DB SQL

Edit or Delete a lock

User can delete an existing lock on a Cosmos DB SQL by selecting the lock and clicking on the Delete Lock Icon
User can also update or edit an existing lock by clicking on the lock name.

Manage Access Keys

Note

Shared Access Key of a Cosmos DB SQL can be accessed in Cerebrata only when you associate the Cosmos DB SQL via Subscription Connection.

To manage the Shared Access Policies of the Cosmos DB SQL.

  1. User can traverse to the path - All resources > Azure Subscription > Required Subscription > Comos DB Accounts > Required Cosmos DB SQL

  2. Now the user has to click on the Manage icon aligned with the Cosmos DB SQL name
    View Properties(2)

  3. Click on Shared Access Policies to manage them
    Manage Access Keys.png

  4. Now the user will be displayed with all the SAS Policies created for the corresponding Cosmos DB SQL

User can view the Primary key, Secondary key, and connection string details now.
User can also regenerate an Access Key from Cerebrata by clicking on the Regenerate button.
Manage Access Keys

Edit Azure Cosmos DB Account Connection

For Cosmos DB accounts associated via the connection string, the user can edit the Cosmos DB account key. User can also edit any friendly name given by clicking on the Edit button(or Crtl+E).
Manage connections.png

Manage connections window.png

CRUD Operations in Azure Cosmos DB SQL

Create

Create Database

A new database can be created right from Cerebrata Cerebrata using the New Database option.
Create a new DB SQL.png

Create Containers inside a DB

A New container can be created inside an exsisting DB right from Cerebrata using the New Container option.

Create containers inside DB.png

In the popup, the user can provide the container name, partition key, throughput type, throughput and click on save.
User can also create an Indexing policy, Unique Key policy and add TTL config details.

Create containers inside DB window.png

Create: Documents, Stored Procedures, Triggers, Functions

User can create entities, stored procedures, triggers and functions from Cerebrata using the new icon. User can also create a user from Cerebrata.

Read: Documents, Stored Procedures, Triggers, Functions

User can read all the stored documents, stored procedures, triggers and functions by clicking on the open option aligned with the respective entity names.
Open documents.png

From Cerebrata, the user can either copy/download the documents in a container using the copy documents or download the documents option available. The documents can be downloaded either as JSON or CSV file.

download as csv.png

Copy or Download Documents.png

To open the documents, stored procedures, triggers and functions in a separate tab, the user can click on the open option available.
Open documents 2.png

Now the query window will be opened in a tab, and to get all the documents, the user can execute the query provided in the query editor.

Query Help?

To get more information about the query, visit to: Query help

NOTE

User can save a query and use it for quick access. Saved queries can also be edited or deleted later.

Update: Documents, Stored Procedures, Triggers, Functions

Once the documents, stored procedures, triggers and functions are opened in the Data Grid after the query execution, the user can double click on any document that needs to be opened.
Now user can edit the document content and update the document after validation.

Delete: Documents, Stored Procedures, Triggers, Functions

User can also perform delete operations right from Cerebrata.

Note

All the delete operation performed in Cerebrata is irreversible and will result in loss of data.

Document Analytics

When documents are inserted into container, a partition key is provided for the quick access of related data. It is not possible to store a large amount of data within the same logical partition. Cerebrata provides a cabability to visualize the total number of documents and the total size of the documents in a container. This can be viewed by selecting the Document analytics option from the context menu of the container.

document-analytics.PNG

Note

It is also possible to export the chart as png file and export the data in a csv file.

Settings

The user can enhance the management part of SQL API in Azure Cosmos DB with Cerebrata's settings. To leverage these settings,

  1. Navigate to Files > Settings > Application Settings > CosmosDB Settings.

  2. Fetch the documents either automatically or by providing query for both partitioned and non-partitioned collections

  3. Set Tab Behaviour and default Tab Format to view the documents
    Cosmos DB Settings(1)

  4. Define the number of documents or requests to display in a single tab by using the Max Documents/Requests option

  5. Apart from the above settings user can also enable force query plan, populate query metrics and enable scan in query for applying these as default for all the queries.


Was this article helpful?