Set up the bastion server

To create a bastion jump server for running the Azure command-line interface (CLI), complete the following steps.

Procedure

  1. Create a bastion server for your hardware cluster:
  2. Log in to the bastion server as the root user and then run this command to install the required packages:
    • On CentOS:
      dnf -y install python3 jq bind-utils wget podman podman-docker tar
    • On Ubuntu:
      sudo apt-get update
      sudo apt-get install ca-certificates curl apt-transport-https lsb-release gnupg
  3. Install the Azure CLI
    1. Download and install the Microsoft signing key:
      • On CentOS:
        rpm --import https://packages.microsoft.com/keys/microsoft.asc
      • On Ubuntu:
        curl -sL https://packages.microsoft.com/keys/microsoft.asc |
            gpg --dearmor |
            sudo tee /etc/apt/trusted.gpg.d/microsoft.gpg > /dev/null
    2. Create the local azure-cli repository information by issuing these commands:
      • On CentOS:
        sh -c 'echo -e "[azure-cli]
        name=Azure CLI
        baseurl=https://packages.microsoft.com/yumrepos/azure-cli
        enabled=1
        gpgcheck=1
        gpgkey=https://packages.microsoft.com/keys/microsoft.asc" > /etc/yum.repos.d/azure-cli.repo'
      • On Ubuntu:
        AZ_REPO=$(lsb_release -cs)
        echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ $AZ_REPO main" |
            sudo tee /etc/apt/sources.list.d/azure-cli.list
    3. Install azure-cli:
      • On CentOS:
        yum install azure-cli
      • On Ubuntu:
        sudo apt-get update
        sudo apt-get install azure-cli
  4. Verify the Azure CLI version:
    az --version

    The output is similar to the following example:

    username@servername ~ % az --version
    azure-cli                         2.60.0 *
    
    core                              2.60.0 *
    telemetry                          1.1.0
    Dependencies:
    msal                              1.28.0
    azure-mgmt-resource             23.1.0b2
    
    Python location '/opt/homebrew/Cellar/azure-cli/2.60.0/libexec/bin/python'
    Extensions directory '/Users/username/.azure/cliextensions'
    
    Python (Darwin) 3.11.9 (main, Apr  2 2024, 08:25:04) [Clang 15.0.0 (clang-1500.1.0.2.5)]
    
    Legal docs and information: aka.ms/AzureCliLegal