Code Monkey home page Code Monkey logo

azure-cassandra-mi-dotnet-core-getting-started's Introduction

page_type languages products description urlFragment
sample
csharp
azure
Azure Managed Instance for Apache Cassandra is a 1st party hosting service for open-source Apache Cassandra clusters in Azure
azure-cassandra-mi-dotnet-core-getting-started

Developing a .NET Core app with Azure Managed Instance for Apache Cassandra

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. You'll then build a user profile console app, output as shown in the following image, with sample data.

Pre-Requisites

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).
  • Code editing: Microsoft Visual Studio or Microsoft Visual Studio Code (or another editor capable of editing C# files)
  • The .NET Core SDK - this sample uses .NET Core 3.1. Download and install the SDK for your platform.
  • Git client.

Running this sample

  1. Clone this repository using git clone https://github.com/Azure-Samples/azure-cassandra-mi-dotnet-core-getting-started.git

  2. If you're using Visual Studio, open the CassandraQuickStartSample.sln solution. If you're using Visual Studio (VS) Code, open the folder containing the CassandraQuickStartSample.sln solution file in VS Code. Otherwise, use your preferred text or code editor.

  3. Edit CassandraQuickStart/Program.cs. Substitute values for your cluster username, password, and contact points for the "<PROVIDE>" placeholders at the top of the class definition. Note: you will need access to the private IP addresses

  4. If you're using Visual Studio: you can either install the Cassandra .NET driver using the Package Manager Console window, using the following command, or simply right-click the project node and select "Rebuild", which will restore missing Nuget packages including the Cassandra .NET driver.

PM> Install-Package CassandraCSharpDriver
  1. If you're using VS Code: under the "Debug" menu, you can use "Start Debugging" (F5) or "Run without Debugging" (Ctrl-F5) to restore, build, and run the application.

  2. Otherwise you can use the dotnet command line. At a prompt, navigate to the /CassandraQuickStart folder (this folder contains the CassandraQuickStart.csproj file) and type the following command.

dotnet run

You should see output similar to the following in your console or prompt:

User Data

About the code

The code included in this sample is intended to get you quickly started with a C# application using Cassandra C# driver that connects to Azure Managed Instance for Apache Cassandra.

Note that the CassandraCSharpDriver package used in this QuickStart is compatible with recent versions of .NET Framework and .NET Standard also. For details, see the package's Nuget page or project repository.

More information

azure-cassandra-mi-dotnet-core-getting-started's People

Contributors

microsoft-github-operations[bot] avatar microsoftopensource avatar theovankraay avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

theovankraay

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.