Commit Graph
50 Commits
Author SHA1 Message Date
c58d25eb90 Add support for Private DNS zones on Azure (#7227)
* Enhance Azure DNS script for private zones support

Added support for Azure Private DNS Zones and updated API versions accordingly.

* Update README.md

* Update Bearer Token description in dns_azure.sh

Clarified the usage of the Bearer Token in the script.

* Update dns_azure.sh

* Update dns_azure.sh

* Update README.md

* implement optimization based on input from maintainer

* Update dns_azure.sh

* create reusable function

* optimize function usage and make less verbose

---------

Co-authored-by: neil <github@neilpang.com>
Co-authored-by: Mashiro <adadam@qq.com>
Co-authored-by: MBWhitestone <25477219+MBWhitestone@users.noreply.github.com>
Co-authored-by: Pablo <Pablo1@users.noreply.github.com>
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-19 15:44:32 +02:00
neil 6e1deacac0 dns_azure: never read or persist AZUREDNS_BEARERTOKEN from account.conf
Versions up to 3.0.9 cached the internally-acquired access token as
SAVED_AZUREDNS_BEARERTOKEN. 3.1.0 repurposed that variable for
user-supplied bearer tokens, so after an upgrade the stale cached token
was read back as if user-supplied, skipped the refresh path, and failed
renewals with 401 forever once expired.

A bearer token is short-lived, so persisting it is never useful: take it
from the environment only, and clear any stale saved value on the next
run.

fix https://github.com/acmesh-official/acme.sh/issues/7218
2026-08-30 15:42:27 +08:00
techknowlogick dd29f970a2 Use endpoint environment variable for managed identities if set
Some environments in azure don't use the default metadata endpoint, and instead inject an env var that should be used.
2025-03-31 10:47:49 -04:00
Sergey Ponomarev 6ad469c637 dnsapi: Fix structured info
Signed-off-by: Sergey Ponomarev <stokito@gmail.com>
2024-12-28 17:42:58 +02:00
neil 532b425dd9 Merge pull request #5276 from stbeldarborge/master
Add existing bearer token support to Azure DNS API
2024-11-13 20:21:39 +01:00
neil 7362e8de4d fix format 2024-10-13 17:41:22 +02:00
stbeldarborge 0c10bd7dd7 shfmt 2024-10-10 12:35:05 +02:00
stbeldarborge b0418cb394 trigger 2024-10-10 12:23:07 +02:00
stbeldarborge a30c81dadc bearetoken 2024-10-10 12:00:11 +02:00
stbeldarborge 40df6e87db newline 2024-10-10 11:54:42 +02:00
stbeldarborge 0dff1dce8f accoutn conf 2024-10-10 11:50:57 +02:00
stbeldarborge ffd3b3e6b5 revert 2024-10-10 11:36:37 +02:00
stbeldarborge 1305b0d8dd revert 2024-10-10 11:29:34 +02:00
stbeldarborge 5fc41a3ea2 read account conf 2024-10-10 11:24:24 +02:00
stbeldarborge fc87fc7cab debug 2024-10-10 11:18:03 +02:00
stbeldarborge 8887a0a6d3 new name 2024-10-10 11:09:25 +02:00
stbeldarborge ba7764aeaf saveaccountconf 2024-10-10 10:59:29 +02:00
stbeldarborge 28afe6f29f comment 2024-10-10 10:30:54 +02:00
Adam Bulgatz a0b8be5941 Updated MS links, added wiki link, updated error messages, updated API limit comment
Updated all Microsoft links from old `docs` subdomain to new `learn` subdomain, and fixed a couple that weren't working.

Added missing $wiki variable to print the wiki link in error messages.

Updated spelling and formatting in error messages

Updated a comment and added a TODO as Microsoft has increased the number of allowed Public DNS zones per subscription from 100 to 250, while the function in this script can only handle the old limit of 100.
2024-10-03 01:24:07 -05:00
stbeldarborge 1029dd3504 fix format 2024-09-20 15:44:50 +02:00
stbeldarborge 8860915fb9 remove dns 2024-09-03 21:36:54 +02:00
stbeldarborge f0d486d1ff add bearer token to removal 2024-09-03 20:59:17 +02:00
stbeldarborge b27767e8f4 logic 2024-09-02 16:04:34 +02:00
stbeldarborge 0b2edd28df bearer check 2024-09-02 16:02:36 +02:00
stbeldarborge dd634382d7 debug 2024-09-02 15:57:48 +02:00
stbeldarborge c7fb155733 debug 2024-09-02 15:56:12 +02:00
stbeldarborge 1eaa2cc619 debug 2024-09-02 15:53:33 +02:00
stbeldarborge 92a47aaac5 logic 2024-09-02 15:41:55 +02:00
stbeldarborge fcffe8beb9 feat: add bearer token support 2024-09-02 15:40:45 +02:00
Sergey Ponomarev 6b7b5caf54 DNS provider API: structured description
Instead of using comments declare info in a special variable.
Then the variable can be used to print the DNS API provider usage.
The usage can be parsed on UI and show all needed inputs for options.

The info is stored in plain string that it's both human-readable and easy to parse:

    dns_example_info='API name
     An extended description.
     Multiline.
    Domains: list of alternative domains to find
    Site: the dns provider website e.g. example.com
    Docs: Link to ACME.sh wiki for the provider
    Options:
     VARIABLE1 Title for the option1.
     VARIABLE2 Title for the option2. Default "default value".
     VARIABLE3 Title for the option3. Description to show on UI. Optional.
    Issues: Link to a support ticket on https://github.com/acmesh-official/acme.sh
    Author: First Lastname <authoremail@example.com>, Another Author <https://github.com/example>;
    '

Here:
VARIABLE1 will be required.
VARIABLE2 will be required too but will be populated with a "default value".
VARIABLE3 is optional and can be empty.

A DNS provider may have alternative options like CloudFlare may use API KEY or API Token.
You can use a second section OptionsAlt: section.

Some providers may have alternative names or domains e.g. Aliyun and AlibabaCloud.
Add them to Domains: section.

Signed-off-by: Sergey Ponomarev <stokito@gmail.com>
2024-05-18 12:06:41 +03:00
michal 7250a300df add managed identity support for azure dns 2022-01-22 13:22:44 +08:00
neil 19c4345162 fix shfmt 2020-08-17 22:18:20 +08:00
neil 40cda9220a fix https://github.com/acmesh-official/acme.sh/issues/3077 2020-08-03 21:22:32 +08:00
neilpang d795fac37a update repo name 2020-01-30 12:06:39 +08:00
Raphaël Berlamont 971a85a6f8 dns_azure : Multiple domains with same ending bug
We have a few domains that ends the same. For example :
  iperfony.com
  perfony.com

The problem was in the _get_root functions, when getting the domain_id :
only the first result "iperfony.com" was returned, because "perfony.com"
is contained in the "iperfony.com" string.

The correction consist of being strict in the regex, adding a slash (/)
so that it will only match on ".*/(perfony.com).*" and not
".*(perfony.com).*".
2019-06-29 18:14:34 +02:00
Joakim Lemb 12956679e7 Added top URI parameter 2018-11-05 14:52:26 +01:00
martgras 9e3c931b34 dns_azure add support for validation record at domain apex
Prevent the issue described in #1442
Fix [SC1117] Backslash is literal in "\[".
2018-03-26 17:45:16 +02:00
martgras 224e0c298a Fix missing success return value from dns_azure_add/rm 2018-03-12 11:50:28 +01:00
martgras 83b1a98db1 Azure DNS API - support for ACME v2 and reliability improvments
support adding 2 txt records
Adding retry logic for REST API calls
Reusing bearer token removes 50% of required REST calls
2018-02-22 12:32:42 +01:00
neilpang 8c88757451 fix format 2018-01-26 20:39:41 +08:00
neilpang dd171ca44a fix format 2018-01-26 20:14:51 +08:00
martgras 72fe7396d6 spelling mistake in error message 2018-01-26 07:53:47 +01:00
neil e4b24d20ac Update dns_azure.sh 2018-01-25 23:08:56 +08:00
neil 91607bb2a1 Update dns_azure.sh 2018-01-25 22:58:11 +08:00
martgras 441c26dd32 Update dns_azure.sh 2018-01-25 07:40:35 +01:00
martgras c7b8debb6e fix travis issues 2018-01-25 07:01:39 +01:00
martgras d51c383866 remove unused code and fix error handling 2018-01-24 15:08:06 +01:00
martgras f7d4698ef0 improve error checking 2018-01-24 13:39:38 +01:00
martgras 3fdbbafcb5 fix getroot with multiple dns zones 2018-01-24 09:59:05 +01:00
martgras e90f3b84c1 Add support for Azure DNS
Adding support for Azure DNS 
See https://docs.microsoft.com/en-us/azure/dns/
2018-01-23 18:24:08 +01:00