Unable to create graph objects from COSMOSDB Data Explorer (Gremlin)

Lau, Alex 0 Reputation points
2025-07-29T15:30:27.1366667+00:00

Please suggest any action to fix these errors.

I set up an account for COSMOSDB and trying to create a graph using Gremlin API. I successfully created a graph DB and tried to create some objects using the Data Explorer. I clicked the new Vertex button and entered the values for Labels and partition key. The creation failed with this error:

Failed to create vertex (Gremlin query failed to execute) :Error with status code: 499. Message: ActivityId: f..........8 SASL information provided by client does not match expected format.

Also, when I click the connection button from the home page trying to read/set the connection key, I got his error:

The client '....@.........ca' with object id '.............................' does not have authorization to perform action 'Microsoft.DocumentDB/databaseAccounts/listKeys/action' over scope '/subscriptions/......................................../resourceGroups/rg-dev-amanda-sbom/providers/Microsoft.DocumentDB/databaseAccounts/cos-cosmosdb' or the scope is invalid. If access was recently granted, please refresh your credentials.

Azure Cosmos DB
Azure Cosmos DB
An Azure NoSQL database service for app development.
{count} votes

1 answer

Sort by: Most helpful
  1. Mahesh Kurva 6,850 Reputation points Microsoft External Staff Moderator
    2025-07-29T19:42:16.46+00:00

    Hi Lau, Alex ,

    Greetings!!

    The issues you're encountering with Azure Cosmos DB using the Gremlin API are related to authentication and permissions. Here's a breakdown of the two main errors and how to resolve them:

    1.Error 499: SASL Information Does Not Match Expected Format

    • Refresh your credentials: If you're using Azure Data Explorer or a Gremlin client, sign out and sign back in to refresh your session.
    • Check the partition key: Ensure that the partition key you're using when creating the vertex matches the one defined in your graph.
    • Use the latest Gremlin driver: If you're using a custom client (e.g., Node.js, Java), make sure you're using the latest version of the Gremlin driver. Older versions may not support the required SASL handshake.

    2.Authorization Error When Accessing Keys

    • Assign the correct role: You need to be assigned a role like Cosmos DB Account Contributor or Owner at the resource or subscription level.

    Go to Azure Portal > Subscriptions > [Your Subscription] > Access control (IAM).

    Add your user and assign the appropriate role.

    • Wait and refresh: If access was recently granted, it may take a few minutes to propagate. Try refreshing your credentials or logging out and back in.

    I hope this information helps. Please do let us know if you have any further queries.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.