2019-08-09 12:40:28 +05:30
|
|
|
# azure
|
|
|
|
|
|
|
|
|
|
## Name
|
|
|
|
|
|
|
|
|
|
*azure* - enables serving zone data from Microsoft Azure DNS service.
|
|
|
|
|
|
|
|
|
|
## Description
|
|
|
|
|
|
2019-08-09 16:10:26 +01:00
|
|
|
The azure plugin is useful for serving zones from Microsoft Azure DNS. The *azure* plugin supports
|
|
|
|
|
all the DNS records supported by Azure, viz. A, AAAA, CNAME, MX, NS, PTR, SOA, SRV, and TXT
|
2021-01-12 04:28:56 +05:30
|
|
|
record types. NS record type is not supported by azure private DNS.
|
2019-08-09 12:40:28 +05:30
|
|
|
|
plugin/azure: add refresh directive (#8614)
Brings azure to parity with route53, which already exposes a refresh
directive to control how often zones are re-synced. azure currently
hardcodes this to 1 minute (Run calls h.run(ctx, time.Minute)) with no
way to change it, even though the internal run() method already takes
an arbitrary interval parameter - the plumbing exists, it just wasn't
exposed as a Corefile option.
Adds a refresh field to the Azure struct, threads it through New(), and
has Run() use h.refresh instead of the hardcoded value. Parses the
refresh directive in parse() mirroring route53's exact validation
(accepts a plain number as seconds or a duration string, must be
greater than 0).
Extends TestSetup with refresh coverage (valid duration, valid plain
number, missing arg, non-numeric, zero, negative). Verified it fails
without the setup.go change (unknown property error) and passes with
it.
Signed-off-by: stackedbyaradhya <aradhyaj736@gmail.com>
2026-10-09 07:18:10 +05:30
|
|
|
Zone data is loaded asynchronously after startup and refreshed every minute by default,
|
|
|
|
|
configurable via `refresh`. An unavailable zone or zone-listing error is logged without
|
|
|
|
|
preventing CoreDNS from starting or other configured zones from being updated. Each zone
|
|
|
|
|
listing, including retries and pagination, has a one-minute timeout.
|
2026-09-11 11:54:12 +08:00
|
|
|
Configuration and credential initialization errors still prevent startup.
|
|
|
|
|
|
|
|
|
|
Until a zone has been successfully loaded, queries for it return SERVFAIL unless
|
|
|
|
|
`fallthrough` is explicitly configured. Only complete, successful updates replace
|
|
|
|
|
the in-memory zone. Failed updates, including a deleted Azure zone returning an
|
|
|
|
|
error, retain the last successfully loaded data and are retried. Remove the zone
|
|
|
|
|
from the Corefile to stop serving this retained data. Snapshots are not persisted
|
|
|
|
|
across restarts or configuration reloads.
|
|
|
|
|
|
2019-08-09 12:40:28 +05:30
|
|
|
## Syntax
|
|
|
|
|
|
|
|
|
|
~~~ txt
|
|
|
|
|
azure RESOURCE_GROUP:ZONE... {
|
|
|
|
|
tenant TENANT_ID
|
|
|
|
|
client CLIENT_ID
|
|
|
|
|
secret CLIENT_SECRET
|
|
|
|
|
subscription SUBSCRIPTION_ID
|
2019-08-09 16:10:26 +01:00
|
|
|
environment ENVIRONMENT
|
|
|
|
|
fallthrough [ZONES...]
|
2020-03-11 00:52:23 +05:30
|
|
|
access private
|
plugin/azure: add refresh directive (#8614)
Brings azure to parity with route53, which already exposes a refresh
directive to control how often zones are re-synced. azure currently
hardcodes this to 1 minute (Run calls h.run(ctx, time.Minute)) with no
way to change it, even though the internal run() method already takes
an arbitrary interval parameter - the plumbing exists, it just wasn't
exposed as a Corefile option.
Adds a refresh field to the Azure struct, threads it through New(), and
has Run() use h.refresh instead of the hardcoded value. Parses the
refresh directive in parse() mirroring route53's exact validation
(accepts a plain number as seconds or a duration string, must be
greater than 0).
Extends TestSetup with refresh coverage (valid duration, valid plain
number, missing arg, non-numeric, zero, negative). Verified it fails
without the setup.go change (unknown property error) and passes with
it.
Signed-off-by: stackedbyaradhya <aradhyaj736@gmail.com>
2026-10-09 07:18:10 +05:30
|
|
|
refresh DURATION
|
2019-08-09 12:40:28 +05:30
|
|
|
}
|
|
|
|
|
~~~
|
|
|
|
|
|
2019-08-09 16:10:26 +01:00
|
|
|
* **RESOURCE_GROUP:ZONE** is the resource group to which the hosted zones belongs on Azure,
|
2020-03-11 00:52:23 +05:30
|
|
|
and **ZONE** the zone that contains data.
|
2019-08-09 16:10:26 +01:00
|
|
|
|
|
|
|
|
* **CLIENT_ID** and **CLIENT_SECRET** are the credentials for Azure, and `tenant` specifies the
|
|
|
|
|
**TENANT_ID** to be used. **SUBSCRIPTION_ID** is the subscription ID. All of these are needed
|
|
|
|
|
to access the data in Azure.
|
2019-08-09 12:40:28 +05:30
|
|
|
|
2019-08-09 16:10:26 +01:00
|
|
|
* `environment` specifies the Azure **ENVIRONMENT**.
|
2019-08-09 12:40:28 +05:30
|
|
|
|
|
|
|
|
* `fallthrough` If zone matches and no record can be generated, pass request to the next plugin.
|
|
|
|
|
If **ZONES** is omitted, then fallthrough happens for all zones for which the plugin is
|
2019-08-09 16:10:26 +01:00
|
|
|
authoritative.
|
2019-08-09 12:40:28 +05:30
|
|
|
|
2020-03-11 00:52:23 +05:30
|
|
|
* `access` specifies if the zone is `public` or `private`. Default is `public`.
|
|
|
|
|
|
plugin/azure: add refresh directive (#8614)
Brings azure to parity with route53, which already exposes a refresh
directive to control how often zones are re-synced. azure currently
hardcodes this to 1 minute (Run calls h.run(ctx, time.Minute)) with no
way to change it, even though the internal run() method already takes
an arbitrary interval parameter - the plumbing exists, it just wasn't
exposed as a Corefile option.
Adds a refresh field to the Azure struct, threads it through New(), and
has Run() use h.refresh instead of the hardcoded value. Parses the
refresh directive in parse() mirroring route53's exact validation
(accepts a plain number as seconds or a duration string, must be
greater than 0).
Extends TestSetup with refresh coverage (valid duration, valid plain
number, missing arg, non-numeric, zero, negative). Verified it fails
without the setup.go change (unknown property error) and passes with
it.
Signed-off-by: stackedbyaradhya <aradhyaj736@gmail.com>
2026-10-09 07:18:10 +05:30
|
|
|
* `refresh` can be used to control how long between record retrievals from Azure DNS. It
|
|
|
|
|
requires a duration string as a parameter to specify the duration between update cycles.
|
|
|
|
|
Each update cycle may result in many Azure API calls depending on how many domains use this
|
|
|
|
|
plugin and how many records are in each. Adjusting the update frequency may help reduce the
|
|
|
|
|
potential of API throttling by Azure. If not provided the default refresh is 1 minute.
|
|
|
|
|
|
2019-08-09 12:40:28 +05:30
|
|
|
## Examples
|
|
|
|
|
|
2020-03-11 00:52:23 +05:30
|
|
|
Enable the *azure* plugin with Azure credentials for private zones `example.org`, `example.private`:
|
2019-08-09 12:40:28 +05:30
|
|
|
|
|
|
|
|
~~~ txt
|
2019-08-09 16:10:26 +01:00
|
|
|
example.org {
|
2020-03-11 00:52:23 +05:30
|
|
|
azure resource_group_foo:example.org resource_group_foo:example.private {
|
2019-08-09 12:40:28 +05:30
|
|
|
tenant 123abc-123abc-123abc-123abc
|
2019-08-09 16:10:26 +01:00
|
|
|
client 123abc-123abc-123abc-234xyz
|
|
|
|
|
subscription 123abc-123abc-123abc-563abc
|
|
|
|
|
secret mysecret
|
2020-03-11 00:52:23 +05:30
|
|
|
access private
|
2019-08-09 12:40:28 +05:30
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
~~~
|
|
|
|
|
|
2020-10-28 18:56:35 +01:00
|
|
|
## See Also
|
2019-08-09 16:10:26 +01:00
|
|
|
|
|
|
|
|
The [Azure DNS Overview](https://docs.microsoft.com/en-us/azure/dns/dns-overview).
|