Use a parameter in the template or policy JSON to import the file directly
You can use a parameter in Azure CLI or Azure PowerShell to provide the TaniumInitDat property and identify the tanium-init.dat file in the Azure CLI script that uses the template or policy. The following example demonstrates using a parameter in AzureCLI to import the tanium-init.dat file.
Configure the parameter in the parameters section of the template and specify the parameter for the TaniumInitDat key:
JSON
"parameters: {
"TaniumInitDat": {"type": "string"},
...
}
JSON
"protectedSettings": {
"TaniumInitDat": "[parameters('TaniumInitDat')]",
...
}
Then, specify the parameter in the Azure CLI script:
CODE
declare _base64_tanium_init_dat=$(base64 < "./tanium-init.dat")
CODE
az deployment group create \
--name "my-vm" \
--resource-group "my-rg" \
--template-file "./templates/linux-template.json" \
-p TaniumInitDat="${_base64_tanium_init_dat}"