Adding an Azure DNS credential
Add a DNS credential for a public Azure DNS zone by using an app registration and a client secret.
- You completed Setting up Azure for DNS credentials and have the tenant ID, subscription ID, resource group, client ID, and client secret.
- The DNS preview feature is turned on.
- You have Manager group access in the organization, the Domain Owner or Domain Admin role, or the Admin role.
For the general procedure, see Adding a DNS credential. This topic covers the values for Azure DNS.
The credential appears on the DNS Credentials page. After you save the credential, you can edit only the name and the domain. To change the client secret, the resource group, or any other Azure field, delete the credential and add it again.
When you enable DNS on a project that uses an Azure credential, Cloudera Cloud Factory sets up the following components on the project cluster:
- external-dns runs as the deployment
external-dns-primaryin the namespaceccf-external-dns. It uses theazureprovider and the options--azure-resource-group=resource-group,--domain-filter=credential-domain, and--policy=sync. The credentials are in the secretexternal-dns-primary-creds. - external-dns marks each record that it creates with a TXT record that holds the owner ID of the project. The TXT record name starts with the record type, for example
a-name. external-dns changes or deletes only records that carry its own owner ID. - cert-manager, when the project uses a Let's Encrypt profile, uses the
azureDNSDNS-01 solver with the same app registration.
The domain filter is the zone of the credential, not the domain of the project. For this reason, external-dns on a project can create records anywhere in the zone. Several projects can share one credential and one zone. Their owner IDs keep their records apart.
To use Let's Encrypt with Azure DNS, you do not need to change the credential. Assign a Let's Encrypt certificate and trust profile to the project, as described in Assigning a profile to a project. Cloudera Cloud Factory then creates the cluster issuer ccf-default with an azureDNS solver. The solver uses the same app registration, subscription, and resource group as the credential. For each certificate, cert-manager writes an _acme-challenge TXT record into the Azure zone, waits for Let's Encrypt to check it, and removes it. Wildcard names such as *.apps.azdns.example.com work, because Let's Encrypt requires the DNS-01 challenge for them. The following Certificate resource requests a wildcard certificate from the cluster issuer:
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: apps-wildcard
namespace: my-app
spec:
secretName: apps-wildcard-tls
issuerRef:
kind: ClusterIssuer
name: ccf-default
dnsNames:
- "*.apps.azdns.example.com"
To check that DNS works, run the following commands. New records usually appear within about a minute.
# Check that external-dns started and authenticated
kubectl --context=<project> -n ccf-external-dns logs deploy/external-dns-primary | grep -i -E 'azure|error'
# List the records in the zone
az network dns record-set list -g <resource-group> -z <zone> --subscription <subscription-id> -o table
# Check public resolution
dig +short <host>.<zone> @1.1.1.1
The external-dns log contains the line Using client_id+client_secret to retrieve access token for Azure API. when authentication succeeds.
If the credential is rejected or records do not appear, see Troubleshooting Azure DNS credentials.


