Skip to content

This repository has sample Javascript code to interact with Azure Managed Instance for Apache Cassandra for creation, query and cleanup of data.

Notifications You must be signed in to change notification settings

Azure-Samples/azure-cassandra-mi-nodejs-getting-started

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

page_type languages products description urlFragment
sample
javascript
azure
Azure Managed Instance for Apache Cassandra provides automated deployment and scaling operations for managed open-source Apache Cassandra datacenters.
azure-cassandra-mi-nodejs-getting-started

Accessing Azure Managed Instance for Apache Cassandra using Node.js

Azure Managed Instance for Apache Cassandra provides automated deployment and scaling operations for managed open-source Apache Cassandra datacenters. It accelerates hybrid scenarios and reduces ongoing maintenance.

This quick start demonstrates how to connect to a Cassandra Managed instance cluster with Node.js. You'll then build a user profile console app, output as shown in the following image, with sample data.

Running this sample

  • Before you can run this sample, you must have the following pre-requisites:
    • An Azure Managed Instance for Apache Cassandra cluster. Check out our Quickstart guide here.
    • Networking access from this application to your Azure Managed Instance for Apache Cassandra cluster (the service only deploys private IP addresses injected into a Virtual network).
    • Node.js version v0.10.29 or higher.
    • Git.
    • Node.js driver for apache cassandra // to install the driver - run npm install cassandra-driver.
  1. Clone this repository:

    git clone git@github.com:Azure-Samples/Azure-Samples/azure-cassandra-mi-node-getting-started.git cassandrami
  2. Change directories to the repo:

    cd cassandrami
  3. Install npm dependencies:

    npm install
  4. Next, substitute the contactPoint, username, password, and localDataCenter values in config.js with your corresponding Azure Managed Instance for Apache Cassandra values.

    module.exports = {
            username: "Cassandra cluster username",
            password: "Cassandra cluster password",
            contactPoint: "I.P. address of a node in your cluster",
            keySpace: "uprofile",
            localDataCenter: "datacenter-1"
    };
  5. Run uprofile.js in a terminal to start your start your node application:

    npm start

About the code

The code included in this sample is intended to get you quickly started with a Node.js console application that connects to Azure Managed Instance for Apache Cassandra.

About

This repository has sample Javascript code to interact with Azure Managed Instance for Apache Cassandra for creation, query and cleanup of data.

Resources

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published