dnscontrol/docs/_providers/azuredns.md
Julius Rickert 20dad35167
Replace Jekyll highlight tags with fenced code blocks (#1412)
* Replace Jekyll highlight tags with fenced code blocks

Replace Jekyll highlight tags with fenced code blocks.
Canonicalize javascript to js.
Correct highlighting languages.
Add highlighting to code blocks.
Remove leading $ from bash blocks.
Remove empty lines at start and end of code blocks.
Stripped trailing whitespace.

* Fix language of code highlighting
2022-02-17 12:22:31 -05:00

1.7 KiB

name layout jsId
Azure DNS default AZURE_DNS

Azure DNS Provider

You can specify the API credentials in the credentials json file:

{
 "azuredns_main":{
      "SubscriptionID": "AZURE_SUBSCRIPTION_ID",
      "ResourceGroup": "AZURE_RESOURCE_GROUP",
      "TenantID": "AZURE_TENANT_ID",
      "ClientID": "AZURE_CLIENT_ID",
      "ClientSecret": "AZURE_CLIENT_SECRET",
 }
}

You can also use environment variables, but this is discouraged, unless your environment provides them already.

export AZURE_SUBSCRIPTION_ID=XXXXXXXXX
export AZURE_RESOURCE_GROUP=YYYYYYYYY
export AZURE_TENANT_ID=ZZZZZZZZ
export AZURE_CLIENT_ID=AAAAAAAAA
export AZURE_CLIENT_SECRET=BBBBBBBBB
{
 "azuredns_main":{
      "SubscriptionID": "$AZURE_SUBSCRIPTION_ID",
      "ResourceGroup": "$AZURE_RESOURCE_GROUP",
      "TenantID": "$AZURE_TENANT_ID",
      "ClientID": "$AZURE_CLIENT_ID",
      "ClientSecret": "$AZURE_CLIENT_SECRET",
 }
}

Metadata

This provider does not recognize any special metadata fields unique to Azure DNS.

Usage

Example Javascript:

var REG_NONE = NewRegistrar('none','NONE');
var ADNS = NewDnsProvider('azuredns_main', 'AZURE_DNS');

D('example.tld', REG_NONE, DnsProvider(ADNS),
    A('test','1.2.3.4')
);

Activation

DNSControl depends on a standard Client credentials Authentication with permission to list, create and update hosted zones.

New domains

If a domain does not exist in your Azure account, DNSControl will not automatically add it with the push command. You can do that either manually via the control panel, or via the command dnscontrol create-domains command.