AzGremlinRestApi
Provide simple REST API as Azure Function for Gremlin Cosmos DB in a Remote-Container (VSCode extension)
Configuration
Azure Function
- modify Dockerfile lines:
# config for function
ENV GRAPHDBHOSTNAME=<COSMOSDBACCOUNT>.gremlin.cosmos.azure.com
ENV GRAPHDBKEY=<KEY>
ENV GRAPHDBNAME=<COSMOSDB>
ENV GRAPHDBCOLL=<GRAPHCOLLECTION>
- Rebuild container
Tinkerpop Console
modify remote-secure.yaml
lines:
hosts: [<COSMOSDBACCOUNT>.gremlin.cosmos.azure.com]
port: 443
username: /dbs/<COSMOSDB>/colls/<GRAPHCOLLECTION>
password: <KEY>
Using
Calling Azure Function
calling as POST request with body:
{
"query": "g.V().limit(3)"
}
Using Tinkerpop Console
- Navigate to:
/workspaces/tinkerpop-cmd
- start console:
./gremlin.sh
- connect to Azure DB:
:remote connect tinkerpop.server /workspaces/AzGremlinRestApi/remote-secure.yaml
- send query:
:> g.V().limit(3)
- exit console:
:exit