I want save the output from cmd prompt to text file or environment variables.
For Ex In cmd prompt I executed
az account get-access-token
The output will be
{"access-token" : token,
"expiresOn" :
"Subscription" :
"Teant" :
"tokenType" : }
How to save the this dict into any file or can we save access-token into environment variable or how to extract the access-token in cmd prompt
I am trying to implement this method in devops pipeline. Any idea how can I reuse the Only access-token in same script in azure cli or set an pipeline variable and reuse it
this my script
curl --netrc --request POST \
https://<databricks-instance>/api/2.0/secrets/scopes/create \
--header "Content-Type: application/json" \
--header "Authorization: Bearer <token>" \
--header "X-Databricks-Azure-SP-Management-Token: <management-token>" \
--data @create-scope.json
So In bash script the first command will be az account get-access-token
from this I will get the dict, so in the command will be request Post in this how to pass access-token where the management-token is there in the same script