Skip to content
This repository has been archived by the owner on Aug 29, 2023. It is now read-only.

mikaelvesavuori/azure-cosmosdb-gremlin

Repository files navigation

CosmosDB (Gremlin API) on Azure Functions [WIP, unfinished]

CosmosDB (Gremlin API) on Azure Functions and Serverless Framework.

Gremlin commands are not finished, but if you want to just get started then this should get you well on your way.

The tech is listed a bit more below:

Stack

Prerequisites

  • Azure account
  • Logged in to Azure through environment
  • High enough credentials to create required resources
  • Recommended: Serverless Framework installed on your system

Set up CosmosDB (Gremlin API)

This repo does not currently cover setting up the required CosmosDB (Gremlin) database on Azure.

It should be pretty easy if you follow the quickstarts at the bottom of this document. You only need to:

  • Go to CosmosDB
  • Create a CosmosDB (Gremlin) database
  • Create a container (use pk as partition key)
  • Pick out your primary key and set that, along with your database/container names, in src/config.ts.

Install

Install dependencies with npm install or yarn add.

Log in to Azure

  1. az account clear
  2. az login

Then set credentials as per instructions at https://github.com/serverless/serverless-azure-functions#advanced-authentication.

Development

Run sls offline. After a bit of building files and doing its magic, you get a prompt looking like:

Http Functions:

demoFunction: [GET] http://localhost:7071/demoFunction

Hit that URL and you're ready! It doesn't do auto-reloads though.

References