Azure HDInsight SDK for Python Samples

This repo provides samples for the Azure HDInsight SDK for Python.


Samples showing use of the Azure HDInsight SDK for Python. The idea behind these samples is to showcase 1) how to utilize the Azure HDInsight SDK for Python and 2) best practices for handling data associated with these APIs.

Getting Started


All samples in this folder require:


The general recommendation for Python development is to use a Virtual Environment. Learn more.

Install and initialize the virtual environment with the "venv" module on Python 3 (you must install virtualenv for Python 2.7):

python -m venv mytestenv # Might be "python3" or "py -3.6" depending on your Python installation
cd mytestenv
source bin/activate      # Linux shell (Bash, ZSH, etc.) only
./scripts/activate       # PowerShell only
./scripts/activate.bat   # Windows CMD only
  1. Clone the repository.

    git clone
  2. Install the dependencies using pip.

    cd hdinsight-python-sdk-samples
    pip install -r requirements.txt
  3. In the samples folder, rename to and fill it with the correct information.

  4. To run each individual demo, point directly to the file. For example:

    • python samples/
    • python samples/