I am trying to automate Hashicorp vault initialization using Azure devops pipeline. I am using a k8 job to do this. However, the vault gets initialized but the keys and root token is not available. When I do manually (vault operator init) from the aks cluster in which the vault is installed, I could see the keys nd root token generated. However when I do it using azure devops pipeline and kubernetes job, it doesnt rerutn or print the keys nd root token.
Is there any RBAC role that I need to give to the service principal that runs the pipeline so as to display the keys and root token?
$init_response=$(vault operator init -format=json -key-shares=5 -key-threshold=3)
vault --version || { echo "Vault installation failed"; exit 1; }
echo "Vault initialization response:"
echo "$init_response"
This command returns a null instead of the keys and root token
Thanks,
Aravind.