stbeldarborge
4 months ago
No known key found for this signature in database
GPG Key ID: E2B7D4D531A7A945
1 changed files with
6 additions and
1 deletions
-
dnsapi/dns_azure.sh
|
@ -9,6 +9,7 @@ Options: |
|
|
AZUREDNS_APPID App ID. App ID of the service principal |
|
|
AZUREDNS_APPID App ID. App ID of the service principal |
|
|
AZUREDNS_CLIENTSECRET Client Secret. Secret from creating the service principal |
|
|
AZUREDNS_CLIENTSECRET Client Secret. Secret from creating the service principal |
|
|
AZUREDNS_MANAGEDIDENTITY Use Managed Identity. Use Managed Identity assigned to a resource instead of a service principal. "true"/"false" |
|
|
AZUREDNS_MANAGEDIDENTITY Use Managed Identity. Use Managed Identity assigned to a resource instead of a service principal. "true"/"false" |
|
|
|
|
|
AZUREDNS_BEARERTOKEN Optional Bearer Token. Used instead of service principal credentials or managed identity |
|
|
' |
|
|
' |
|
|
|
|
|
|
|
|
######## Public functions ##################### |
|
|
######## Public functions ##################### |
|
@ -83,7 +84,11 @@ dns_azure_add() { |
|
|
_saveaccountconf_mutable AZUREDNS_CLIENTSECRET "$AZUREDNS_CLIENTSECRET" |
|
|
_saveaccountconf_mutable AZUREDNS_CLIENTSECRET "$AZUREDNS_CLIENTSECRET" |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
if [ -z "$AZUREDNS_BEARERTOKEN" ]; then |
|
|
|
|
|
accesstoken=$(echo "$AZUREDNS_BEARERTOKEN" | sed "s/Bearer //g") |
|
|
|
|
|
else |
|
|
accesstoken=$(_azure_getaccess_token "$AZUREDNS_MANAGEDIDENTITY" "$AZUREDNS_TENANTID" "$AZUREDNS_APPID" "$AZUREDNS_CLIENTSECRET") |
|
|
accesstoken=$(_azure_getaccess_token "$AZUREDNS_MANAGEDIDENTITY" "$AZUREDNS_TENANTID" "$AZUREDNS_APPID" "$AZUREDNS_CLIENTSECRET") |
|
|
|
|
|
fi |
|
|
|
|
|
|
|
|
if ! _get_root "$fulldomain" "$AZUREDNS_SUBSCRIPTIONID" "$accesstoken"; then |
|
|
if ! _get_root "$fulldomain" "$AZUREDNS_SUBSCRIPTIONID" "$accesstoken"; then |
|
|
_err "invalid domain" |
|
|
_err "invalid domain" |
|
|