I have previously used curl to retrieve secrets from my Azure KeyVault.
First I retrieve my token and get the url of my keyvault:
token=$(curl -s 'http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01&resource=https%3A%2F%2Fvault.azure.net' -H Metadata:true | awk -F"[{,\":}]" '{print $6}')
keyvaulturl="https://myTestKeyVault-keyvault.vault.azure.net/secrets"
I can then access my KeyVault
curl -s ${keyvaulturl}/xxx?api-version=2016-10-01 -H "Authorization: Bearer ${token}"
However this is just for getting secrets. Is there any way via curl to update them? Or is it better to use azure cli? What is the best automated form of authentication in this case?