संपादित करें

इसके माध्यम से साझा किया गया


Install Azure Data CLI (azdata) with pip

Applies to: Azure Data CLI (azdata)

This article describes how to install the Azure Data CLI (azdata) tool on Windows, Linux, or macOS using pip.

Tip

For a simpler experience, azdata can be installed with a package manager for Windows, Linux (Ubuntu, Debian, RHEL, openSUSE and SLE distributions) and macOS.

Prerequisites

azdata is a command-line utility written in Python that enables cluster administrators to bootstrap and manage data resources via REST APIs. The minimum Python version required is v3.6. pip is required to download and install the azdata tool. The following instructions provide examples for Windows, Linux (Ubuntu), and macOS. For installing Python on other platforms, see the Python documentation. In addition, install and update the latest version of requests Python package:

pip3 install -U requests

Windows azdata installation

  1. On a Windows client, download the necessary Python package from https://www.python.org/downloads/. For python 3.6 and later, pip3 is also installed when you install Python.

    Tip

    When installing Python3, select to add Python to your PATH. If you don't, you can later find where pip3 is located and manually add it to your PATH.

  2. Open a new Windows PowerShell session so that it gets the latest path with Python in it.

  3. Starting with SQL Server 2019 CU5 release, azdata has an independent semantic version from the server. If you have any previous releases of azdata installed older than this, it's important to first uninstall them before installing the latest version.

    For example, for 2019-cu4, run the following command:

    pip3 uninstall -r https://azdatacli.blob.core.windows.net/python/azdata/2019-cu4/requirements.txt
    

    Note

    In the preceding examples, replace 2019-cu6 with the version and CU of your installation of azdata.

  4. Install azdata.

    pip3 install -r https://aka.ms/azdata
    

Linux azdata installation

On Linux, you must install Python 3.6 and then upgrade pip. The following example shows the commands that would work for Ubuntu. For other Linux platforms, see the Python documentation.

  1. Install the necessary Python packages:

    sudo apt-get update && \
    sudo apt-get install -y python3 && \
    sudo apt-get install -y python3-pip && \
    sudo apt-get install -y libkrb5-dev && \
    sudo apt-get install -y libsqlite3-dev && \
    sudo apt-get install -y unixodbc-dev
    
  2. Upgrade pip3.

    sudo -H pip3 install --upgrade pip
    
  3. Starting with SQL Server 2019 CU5 release, azdata has an independent semantic version from the server. If you have any previous releases of azdata installed older than this, it's important to first uninstall them before installing the latest version.

    For example, for 2019-cu6, run the following command:

    pip3 uninstall -r https://azdatacli.blob.core.windows.net/python/azdata/2019-cu6/requirements.txt
    

    Note

    In the preceding examples, replace 2019-cu6 with the version and CU of your installation of azdata.

  4. Install azdata.

    pip3 install -r https://aka.ms/azdata --user
    

    Note

    The --user switch installs azdata to the Python user install directory. This is typically ~/.local/bin on Linux. Either add this directory to your path or navigate to the user install directory and run ./azdata from there.

Install azdata on macOS

To install azdata on macOS, complete these steps. For each step, run the example in Terminal.

  1. On a macOS client, install Homebrew if you don't have it already:

    /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
    
  2. Install Python and pip, minimum version 3.0:

    brew install python3
    
  3. Install dependencies:

    pip3 install -U requests
    brew install freetds
    
  4. Starting with SQL Server 2019 CU5 release, azdata has an independent semantic version from the server. If you have any previous releases of azdata installed older than this, it's important to first uninstall them before installing the latest version. For example, the following command removes the RC1 version of azdata:

    pip3 uninstall -r https://azdatacli.blob.core.windows.net/python/azdata/2019-rc1/requirements.txt
    
  5. Install Azure Data CLI.

    pip3 install -r https://aka.ms/azdata