Use
kubectl to get the base64 representation of the secret's JSON:
kubectl get secret externaldns-config -o yaml
apiVersion: v1
data:
azure.json: eyAidGVuYW50SWQiOiAiY2dlNmZhMzMtZGNiMy01ODcyLW9nMDEtNDg0M2M0Mjdr
ZGx3IiwgInN1YnNjcmlwdGlvbklkIjogImNhZGJiZzg1LTdkMzUtMzAyZS03MzcxLTRhYjllMmEyNzMyM
CIsICJyZXNvdXJjZUdyb3VwIjogIkF6dXJlUkciLCAiYWFkQ2xpZW50SWQiOiAiNTdmZGFjMzEtYmFmN
S00MmNiLTkwMGQtNzZhMzY0ZTQ3NzFmIiwgImFhZENsaWVudFNlY3JldCI6ICJXd0U3Rn5IYXR+Vk
t1ZXkxZENsejR6MWVYbEl2fmtlVHhaSE02Y0Q3IiB9
kind: Secret
metadata:
creationTimestamp: "2022-10-14T13:56:22Z"
name: externaldns-config
namespace: modelops12
resourceVersion: "2532"
uid: a2748f8a-8c20-4a13-a859-55737fdc479e
type: Opaque
Then decode the value of 'azure.json' using
certutil (Windows) or
base64 (Linux).
Windows Example:
echo eyAidGVuYW50SWQiOiAiY2dlNmZhMzMtZGNiMy01ODcyLW9nMDEtNDg0M2M0MjdrZGx3IiwgInN1YnNjcmlwd
GlvbklkIjogImNhZGJiZzg1LTdkMzUtMzAyZS03MzcxLTRhYjllMmEyNzMyMCIsICJyZXNvdXJjZUdyb3VwIjogIkF6dXJlU
kciLCAiYWFkQ2xpZW50SWQiOiAiNTdmZGFjMzEtYmFmNS00MmNiLTkwMGQtNzZhMzY0ZTQ3NzFmIiwgImFhZENsa
WVudFNlY3JldCI6ICJXd0U3Rn5IYXR+Vkt1ZXkxZENsejR6MWVYbEl2fmtlVHhaSE02Y0Q3IiB9 > b64-secret-json.txt
certutil -decode b64-secret-json.txt secret-json.txt
type secret-json.txt | jq .
{
"tenantId": "cge6fa33-dcb3-5872-og01-4843c427kdlw",
"subscriptionId": "cadbbg85-7d35-302e-7371-4ab9e2a27320",
"resourceGroup": "AzureRG",
"aadClientId": "57fdac31-baf5-42cb-900d-76a364e4771f",
"aadClientSecret": "WwE7F~Hat~VKuey1dClz4z1eXlIv~keTxZHM6cD7"
}
Linux example:
echo eyAidGVuYW50SWQiOiAiY2dlNmZhMzMtZGNiMy01ODcyLW9nMDEtNDg0M2M0MjdrZGx3IiwgInN1YnNjcmlwd
GlvbklkIjogImNhZGJiZzg1LTdkMzUtMzAyZS03MzcxLTRhYjllMmEyNzMyMCIsICJyZXNvdXJjZUdyb3VwIjogIkF6dXJlU
kciLCAiYWFkQ2xpZW50SWQiOiAiNTdmZGFjMzEtYmFmNS00MmNiLTkwMGQtNzZhMzY0ZTQ3NzFmIiwgImFhZENsa
WVudFNlY3JldCI6ICJXd0U3Rn5IYXR+Vkt1ZXkxZENsejR6MWVYbEl2fmtlVHhaSE02Y0Q3IiB9 | base64 --decode | jq .
{
"tenantId": "cge6fa33-dcb3-5872-og01-4843c427kdlw",
"subscriptionId": "cadbbg85-7d35-302e-7371-4ab9e2a27320",
"resourceGroup": "AzureRG",
"aadClientId": "57fdac31-baf5-42cb-900d-76a364e4771f",
"aadClientSecret": "WwE7F~Hat~VKuey1dClz4z1eXlIv~keTxZHM6cD7"
}