Creating An Azure Data Explorer Cluster And Database In Azure

Introduction 

 
In this article we will explore about creating an Azure Data Explorer cluster and database in Azure. Generally, the Azure Data Explorer is a data exploration service with high scalability and fast service. For using the Azure Data Explorer, first we need to create a cluster and then we can create one or more databases in the cluster. By performing the following steps we can ingest the data into the database and by doing this we can run queries against it. First let’s create a cluster as well as a database.
 
Prerequisites
  • Active Azure Subscription.
Step 1
 
The initial step is to create a cluster in the portal so we can proceed to further steps. For creating a cluster create an Azure Data Explorer cluster with compute and storage resources within a resource group. Click >> + New resource and then search for Azure Data Explorer and then Click >> Create.
 
Creating An Azure Data Explorer Cluster And Database In Azure
 
Step 2
 
The next step is to provide some of the basic details that are needed to create an Azure Data Explorer Cluster.
  • Provide a unique name for the cluster
  • Select the region and the pricing tier according to your need and select the compute specifications.
  • Leave the other values to be default and click >> Review+ create.
Creating An Azure Data Explorer Cluster And Database In Azure
 
Step 3
 
After selecting Review + create, the deployment process will take place and the process may take up to 10  to 15 minutes and after the successful deployment we can go to the resource and see if the status is running.
 
Creating An Azure Data Explorer Cluster And Database In Azure
 
Step 4
 
Here comes the second one; i.e. we need to create a database. For that Click >> Create Database from the overview tab and provide the required values.
  • Provide a database name
  • Provide the value for the retention period of the data to be kept in the query
  • Provide a cache period for the availability of the data in RAM.
So that we can proceed on creating the database, after providing the required values Click >> Create and after that it takes 2 to 5 minutes.
 
Creating An Azure Data Explorer Cluster And Database In Azure
 
Creating An Azure Data Explorer Cluster And Database In Azure
 
Step 5
 
Now here comes the main part which we have been waiting for! We can now run the basic commands in the database. Thus, we have created a cluster and a database. In here we don’t have any data in the database. But we can see how the tool is working.
 
Switch to query in the cluster and execute the following command in the query window
  1. .show databases
and Click >> Run.
 
Creating An Azure Data Explorer Cluster And Database In Azure
 
The test result will be displayed in the created database, namely the only cluster of the database.
 
Likewise, we can also query the following command to show tables in the query window and after Click >> Run. Here comes the empty result because we don’t have any tables inside of it.
 
Creating An Azure Data Explorer Cluster And Database In Azure
 
Thus, we have created a cluster and created a database in Azure Data Explorer and just executed two commands to obtain the result.
 

Stopping and restarting the cluster

 
We can either start or stop the Azure Data Explorer cluster according to our need. For stopping the cluster switch to overview tab and select >> stop.
 
The additional note to share is if a cluster has been stopped the data is not available and it cannot ingest new data.
 
For starting the cluster switch to overview tab again and Select >> Start.
 
So, by restarting the cluster we are able to ingest the data to it  -- and by the way, it also takes about 5 to 10 minutes to get started for loading the data into a hot cache.
 
Creating An Azure Data Explorer Cluster And Database In Azure
 

Cleaning up the resources

 
For cleaning the resource groups that have been created switch back to the resource groups and select the resource group which contains the created Data Explorer Cluster and then:
 
Click >> Delete resource group for wiping out all the created resources.
 
From this article, we have seen about how to creating a cluster and a database with querying by using the Azure Data Explorer. I hope this article will be useful for you and thanks for reading!