GithubHelp home page GithubHelp logo

isabella232 / azure-data-explorer-go-sdk-example-to-ingest-data Goto Github PK

View Code? Open in Web Editor NEW

This project forked from azure-samples/azure-data-explorer-go-sdk-example-to-ingest-data

0.0 0.0 0.0 18 KB

Sample to demonstrate how to ingest (load) data into Azure Data Explorer using the Go SDK

License: MIT License

Go 100.00%

azure-data-explorer-go-sdk-example-to-ingest-data's Introduction

page_type languages products description urlFragment
sample
go
azure
Sample to demonstrate how to ingest (load) data into Azure Data Explorer using the Go SDK
Azure-Data-Explorer-Go-SDK-example-to-ingest-data

Ingest data using the Azure Data Explorer Go SDK

Azure Data Explorer is a fast and highly scalable data exploration service for log and telemetry data. It provides a Go client library for interacting with the Azure Data Explorer service. You can use the Go SDK to query, control, and ingest into Azure Data Explorer clusters

You will start by using the sample program to create a table and data mapping in a test cluster. You then queue an ingestion to the cluster using the Go SDK and validate the results.

Getting Started

Prerequisites

Installation

To install using Go modules, create a module (if needed) and fetch the Azure Data Explorer package. For example:

go mod init foo.com/bar
go get github.com/Azure/azure-kusto-go/kusto

You should see the package dependency being added to the go.mod file

Azure Data Explorer resources

Create an Azure Data Explorer cluster and database before executing the sample program in this repository

Run the application

Clone the sample code:

git clone https://github.com/Azure-Samples/azure-data-explorer-go-ingest.git
cd azure-data-explorer-go-ingest

You will need to create Service Principal for authentication. For example, you can do it with Azure CLI using the az ad sp create-for-rbac command

Set Service Principal information along with cluster endpoint in the form of environment variables that will be used by the program:

export AZURE_SP_CLIENT_ID="<replace with appID>"
export AZURE_SP_CLIENT_SECRET="<replace with password>"
export AZURE_SP_TENANT_ID="<replace with tenant>"
export KUSTO_ENDPOINT="https://<cluster name>.<azure region>.kusto.windows.net"
export KUSTO_DB="name of the database"

Finally, to run the program:

go run main.go

You will see an output similar to the following:

Connected to Azure Data Explorer
Using database - testkustodb
Failed to drop StormEvents table. Maybe it does not exist?
Table StormEvents created in DB testkustodb
Mapping StormEvents_CSV_Mapping created
Ingested file from - https://kustosamplefiles.blob.core.windows.net/samplefiles/StormEvents.csv?st=2018-08-31T22%3A02%3A25Z&se=2020-09-01T22%3A02%3A00Z&sp=r&sv=2018-03-28&sr=b&sig=LQIbomcKI8Ooz425hWtjeq6d61uEaq21UVX7YrM61N4%3D

Resources

azure-data-explorer-go-sdk-example-to-ingest-data's People

Contributors

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

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.