Learn how to use the Azure Command-line Interface to manage Hadoop clusters in Azure HDInsight. The Azure CLI is implemented in Node.js. It can be used on any platform that supports Node.js, including Windows, Mac, and Linux.
This article covers only using the Azure CLI with HDInsight. For a general guide on how to use Azure CLI, see Install and configure Azure CLI.
[! IMPORTANT] Azure CLI support for managing HDInsight resources using Azure Service Manager (ASM) is deprecated, and was removed on January 1, 2017. The steps in this document use the new Azure CLI commands that work with Azure Resource Manager.
Please follow the steps in Install and configure Azure CLI to install the latest version of the Azure CLI. If you have scripts that need to be modified to use the new commands that work with Azure Resource Manager, see Migrating to Azure Resource Manager-based development tools for HDInsight clusters for more information.
Before you begin this article, you must have the following:
- An Azure subscription. See Get Azure free trial.
- Azure CLI - See Install and configure the Azure CLI for installation and configuration information.
Connect to Azure, using the following command:
For more information on authenticating using a work or school account, see Connect to an Azure subscription from the Azure CLI.
Switch to the Azure Resource Manager mode, using the following command:
azure config mode arm
To get help, use the -h switch. For example:
azure hdinsight cluster create -h
Create clusters with the CLI
List and show cluster details
Use the following commands to list and show cluster details:
azure hdinsight cluster list azure hdinsight cluster show <Cluster Name>
Use the following command to delete a cluster:
azure hdinsight cluster delete <Cluster Name>
You can also delete a cluster by deleting the resource group that contains the cluster. Please note, this will delete all the resources in the group including the default storage account.
azure group delete <Resource Group Name>
To change the Hadoop cluster size:
azure hdinsight cluster resize [options] <clusterName> <Target Instance Count>
Enable/disable HTTP access for a cluster
azure hdinsight cluster enable-http-access [options] <Cluster Name> <userName> <password> azure hdinsight cluster disable-http-access [options] <Cluster Name>
Enable/disable RDP access for a cluster
azure hdinsight cluster enable-rdp-access [options] <Cluster Name> <rdpUserName> <rdpPassword> <rdpExpiryDate> azure hdinsight cluster disable-rdp-access [options] <Cluster Name>
In this article, you have learned how to perform different HDInsight cluster administrative tasks. To learn more, see the following articles: