Using the CLI to Deploy the Azure VM Extension
Using the CLI to Deploy the Azure VM Extension
Before you begin
Before you begin with the steps on this page, complete the steps in the Getting started section on the Using an Azure Virtual Machine Extension to Install and Register a Tanium Client page. This article describes the steps to use the command line interface (CLI) to deploy a Windows Virtual Machine (VM) with the Tanium Client Installed.
Deploying the Azure VM Extension using the CLI
This section assumes that you already created a VM in your Azure portal.
-
Open a PowerShell terminal on a machine that you can use to connect to your Microsoft Azure subscription using the CLI.
-
Navigate to the directory where you downloaded the
tanium-init.datfile in the Getting started section on the Using an Azure Virtual Machine Extension to Install and Register a Tanium Client page. -
Run the following command:
az login -
Run the following command:
az account set --subscription <azure subscription>where<azure subscription>is the name of you Microsoft Azure subscription. -
Run the following command:
# Encode the file in base64 $base64_tanium_init_dat = [Convert]::ToBase64String([IO.File]::ReadAllBytes("./tanium-init.dat")) # Construct the JSON string for protected settings $protectedSettings = @{ TaniumInitDat = $base64_tanium_init_dat TaniumServer = "MyTaniumServer" } | ConvertTo-Json -Compress # Run the Azure CLI command az vm extension set --name TaniumClientWindows ` --publisher Tanium.Client ` --vm-name Azure-Test-Windows-VM ` --resource-group Azure-VM-Extension-Test-Central ` --protected-settings $protectedSettings
This command will run with the vm-name set to Azure-Test-Windows-VM and the Resource Group set to Azure-VM-Extension-Test-Central. If you need to change either of these values, do so before the command runs.