Provider: Azure #69

Open
opened 2025-11-20 04:19:43 -05:00 by saavagebueno · 20 comments
Owner

Originally created by @danimart1991 on GitHub (Oct 10, 2020).

Originally assigned to: @qdm12 on GitHub.

  1. What's the feature?
    Include Azure DNS as provider please

  2. Why do you need this feature?
    I have a home server with Azure DNS and Azure Domains and would be awesome to have automatic ddns update.

  3. Extra information?
    Thanks. Many thanks for all.

Originally created by @danimart1991 on GitHub (Oct 10, 2020). Originally assigned to: @qdm12 on GitHub. 1. What's the feature? Include Azure DNS as provider please 2. Why do you need this feature? I have a home server with Azure DNS and Azure Domains and would be awesome to have automatic ddns update. 3. Extra information? Thanks. Many thanks for all.
saavagebueno added the Category: New provider 🆕Category: Motivated! 🙌 labels 2025-11-20 04:19:43 -05:00
Author
Owner

@qdm12 commented on GitHub (Oct 13, 2020):

Hey danimart1991, thanks for creating the issue.

I digged a bit in Azure's API documentation to update DNS records, particularly here. I just have a questions on some of the required parameters, can you please let me know for each if it's easy to get them and how:

  1. relativeRecordSetName: The name of the record set, relative to the name of the zone
  2. resourceGroupName: The name of the resource group.
  3. subscriptionId: Specifies the Azure subscription ID, which uniquely identifies the Microsoft Azure subscription.
  4. zoneName: The name of the DNS zone (without a terminating dot).

That would help to know if I should search through their API how to obtain these if it's not trivial to have them.

Also for authentication, it seems you only use subscriptionId right?

@qdm12 commented on GitHub (Oct 13, 2020): Hey danimart1991, thanks for creating the issue. I digged a bit in Azure's API documentation to update DNS records, particularly [here](https://docs.microsoft.com/en-us/rest/api/dns/recordsets/update#patch-a-recordset). I just have a questions on some of the required parameters, can you please let me know for each if it's easy to get them and how: 1. `relativeRecordSetName`: The name of the record set, relative to the name of the zone 1. `resourceGroupName`: The name of the resource group. 1. `subscriptionId`: Specifies the Azure subscription ID, which uniquely identifies the Microsoft Azure subscription. 1. `zoneName`: The name of the DNS zone (without a terminating dot). That would help to know if I should search through their API how to obtain these if it's not trivial to have them. Also for authentication, it seems you only use `subscriptionId` right?
Author
Owner

@qdm12 commented on GitHub (Oct 13, 2020):

You can try with qmcgaw/ddns-updater:azure using this documentation if you know the 4 parameters mentioned above, to see if it works.

Also, does Azure support wildcard * host for A/AAAA records?

Thanks!

@qdm12 commented on GitHub (Oct 13, 2020): You can try with `qmcgaw/ddns-updater:azure` using [this documentation](https://github.com/qdm12/ddns-updater/tree/azure#configuration) if you know the 4 parameters mentioned above, to see if it works. Also, does Azure support wildcard `*` host for A/AAAA records? Thanks!
Author
Owner

@danimart1991 commented on GitHub (Oct 14, 2020):

Hi @qdm12

Yes. Azure support wilcard *.

I create a first approach in Python + Container in case it works for you. Azure needs a lot of parameters and configuration. Steps to configure Azure to be able to external dynamic dns update:

  • Create Domain
  • Activate Azure DNS Zone for that domain
  • In the Azure Console (inside the portal) run: $ az ad sp create-for-rbac -n "{AnyNameOrUrl}" --scopes /subscriptions/{SUBSCRIPTION_ID}/resourceGroups/{RESOURCE_GROUP}/providers/Microsoft.Network/dnszones/{DNS_ZONE_ID} (This parameters are easily obtainable in the Properties section of Azure DNS)
  • This gives you the rest of the parameters:
Retrying role assignment creation: 1/36
{
  "appId": "{App_Id/Client_Id}",
  "displayName": "{NOTIMPORTANT}",
  "name": "{NOTIMPORTANT}",
  "password": "{APP_PASSWORD}",
  "tenant": "{TENANT_ID}"
}

I use this parameters here: https://github.com/danimart1991/azure-dns-updater/blob/main/azure-dns-updater.py#L21

Best regards and thank you for your work.

@danimart1991 commented on GitHub (Oct 14, 2020): Hi @qdm12 Yes. Azure support wilcard *. I create a first approach in Python + Container in case it works for you. Azure needs a lot of parameters and configuration. Steps to configure Azure to be able to external dynamic dns update: - Create Domain - Activate Azure DNS Zone for that domain - In the Azure Console (inside the portal) run: `$ az ad sp create-for-rbac -n "{AnyNameOrUrl}" --scopes /subscriptions/{SUBSCRIPTION_ID}/resourceGroups/{RESOURCE_GROUP}/providers/Microsoft.Network/dnszones/{DNS_ZONE_ID}` (This parameters are easily obtainable in the Properties section of Azure DNS) - This gives you the rest of the parameters: ``` Retrying role assignment creation: 1/36 { "appId": "{App_Id/Client_Id}", "displayName": "{NOTIMPORTANT}", "name": "{NOTIMPORTANT}", "password": "{APP_PASSWORD}", "tenant": "{TENANT_ID}" } ``` I use this parameters here: https://github.com/danimart1991/azure-dns-updater/blob/main/azure-dns-updater.py#L21 Best regards and thank you for your work.
Author
Owner

@qdm12 commented on GitHub (Dec 13, 2020):

Sorry for the rather long delay, I worked on the implementation again today; I'm just lost on authentication. How do you specify the app_id and app_password? Or do you even need to? From what I've seen in their docs, a PATCH HTTP request like

https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}/{recordType}/{relativeRecordSetName}?api-version=2018-05-01

Does it. Do you know if that's the case perhaps?

@qdm12 commented on GitHub (Dec 13, 2020): Sorry for the rather long delay, I worked on the implementation again today; I'm just lost on authentication. How do you specify the app_id and app_password? Or do you even need to? From what I've seen in their docs, a PATCH HTTP request like ``` https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}/{recordType}/{relativeRecordSetName}?api-version=2018-05-01 ``` Does it. Do you know if that's the case perhaps?
Author
Owner

@danimart1991 commented on GitHub (Dec 13, 2020):

Hi @qdm12

As I need this DNS Updater, I make my own, but even better if DDNS Updater has Azure too. 🥰

I just update my repository with all the info to obtain the info needed to update a record/s. https://github.com/danimart1991/azure-dns-updater

The az ad sp... command creates a "user" and special authentication for this behavior. I don't know another way to obtain the info you need.

I use the Python lib DnsManagementClient directly, I just need to send the Update command and fill the needed vars. 🤔

@danimart1991 commented on GitHub (Dec 13, 2020): Hi @qdm12 As I need this DNS Updater, I make my own, but even better if DDNS Updater has Azure too. 🥰 I just update my repository with all the info to obtain the info needed to update a record/s. https://github.com/danimart1991/azure-dns-updater The `az ad sp...` command creates a "user" and special authentication for this behavior. I don't know another way to obtain the info you need. I use the Python lib DnsManagementClient directly, I just need to send the Update command and fill the needed vars. 🤔
Author
Owner

@fredericrous commented on GitHub (May 18, 2021):

@qdm12 did you try using Azure SDK? the SDK usually is especially useful for the authentication part f111fc2fa3/arm/examples/dns/create.go

@fredericrous commented on GitHub (May 18, 2021): @qdm12 did you try using Azure SDK? the SDK usually is especially useful for the authentication part https://github.com/Azure/azure-sdk-for-go/blob/f111fc2fa3861c5fdced76cae4c9c71821969577/arm/examples/dns/create.go
Author
Owner

@qdm12 commented on GitHub (May 18, 2021):

Oh they have a Go SDK! Thanks @fredericrous !! 🎉

Yeah I tried quite a bit, but would get lost in the over-complicated requirements from their API docs to be honest. I'll try that right now!

@qdm12 commented on GitHub (May 18, 2021): Oh they have a Go SDK! Thanks @fredericrous !! 🎉 Yeah I tried quite a bit, but would get lost in the over-complicated requirements from their API docs to be honest. I'll try that right now!
Author
Owner

@danimart1991 commented on GitHub (Jul 15, 2021):

Any news with this? Can I help?

@danimart1991 commented on GitHub (Jul 15, 2021): Any news with this? Can I help?
Author
Owner

@fredericrous commented on GitHub (Jul 18, 2021):

Hi @danimart1991, I don't think qdm12 has picked this up yet. I don't require a new domain at the moment and don't have one on Azure but feel free to open a PR, we'll review it. Implementing a provider is not that hard, I implemented 3 already and I'm not a Go developer.

@fredericrous commented on GitHub (Jul 18, 2021): Hi @danimart1991, I don't think qdm12 has picked this up yet. I don't require a new domain at the moment and don't have one on Azure but feel free to open a PR, we'll review it. Implementing a provider is not that hard, I implemented 3 already and I'm not a Go developer.
Author
Owner

@qdm12 commented on GitHub (Jul 18, 2021):

Actually Azure has been quite tough. Implementing it dependency-free is a bit of a PITA.

For now I prefer to focus on improving the "vertical aspect" of ddns such as upgrading the UI or better support for ipv6 before doing "horizontal" such as adding more DNS providers.

Although if you can manage to do a PR for Azure without dependency, I'm more than happy to merge it!

@qdm12 commented on GitHub (Jul 18, 2021): Actually Azure has been quite tough. Implementing it dependency-free is a bit of a PITA. For now I prefer to focus on improving the "vertical aspect" of ddns such as upgrading the UI or better support for ipv6 before doing "horizontal" such as adding more DNS providers. Although if you can manage to do a PR for Azure without dependency, I'm more than happy to merge it!
Author
Owner

@danimart1991 commented on GitHub (Jul 19, 2021):

Thanks for the answer @qdm12

Actually, I don't know Go to be able to add new DNS providers. So sorry.

@danimart1991 commented on GitHub (Jul 19, 2021): Thanks for the answer @qdm12 Actually, I don't know Go to be able to add new DNS providers. So sorry.
Author
Owner

@JulienFloris commented on GitHub (Feb 14, 2023):

Microsoft has got some documentation on the API here:
https://learn.microsoft.com/en-us/rest/api/dns/record-sets/create-or-update?tabs=HTTP

@JulienFloris commented on GitHub (Feb 14, 2023): Microsoft has got some documentation on the API here: https://learn.microsoft.com/en-us/rest/api/dns/record-sets/create-or-update?tabs=HTTP
Author
Owner

@qdm12 commented on GitHub (Jun 15, 2024):

Hello everyone, I reworked the Azure branch to use the Azure SDK for the time being. Can you try the image qmcgaw/ddns-updater:pr-130 using the documentation at https://github.com/qdm12/ddns-updater/blob/azure/docs/azure.md

In the meantime, I'm working on having this without the Azure SDK (just plain local Go), and I'm really eyeing using a single token for authentication (for example https://mauridb.medium.com/calling-azure-rest-api-via-curl-eb10a06127) is this easy for you to use or would you rather keep using the many fields (client id, client secret, tenant id) to authenticate??

@qdm12 commented on GitHub (Jun 15, 2024): Hello everyone, I reworked the Azure branch to use the Azure SDK for the time being. Can you try the image `qmcgaw/ddns-updater:pr-130` using the documentation at https://github.com/qdm12/ddns-updater/blob/azure/docs/azure.md In the meantime, I'm working on having this without the Azure SDK (just plain local Go), and I'm really eyeing using a single `token` for authentication (for example https://mauridb.medium.com/calling-azure-rest-api-via-curl-eb10a06127) is this easy for you to use or would you rather keep using the many fields (client id, client secret, tenant id) to authenticate??
Author
Owner

@qdm12 commented on GitHub (Jun 16, 2024):

I updated qmcgaw/ddns-updater:pr-130 to use that token field and no Azure SDK, please let me know if it works when you get the time. Documentation: 8e39ff05af/docs/azure.md (L1)

@qdm12 commented on GitHub (Jun 16, 2024): I updated qmcgaw/ddns-updater:pr-130 to use that token field and no Azure SDK, please let me know if it works when you get the time. Documentation: https://github.com/qdm12/ddns-updater/blob/8e39ff05afaa6294737a83a88cbede216661cb77/docs/azure.md#L1
Author
Owner

@danimart1991 commented on GitHub (Jun 19, 2024):

Thanks @qdm12 for the work.

I'm trying the option to use client_id and client_secret (it's the option that I use actually with Traefik for reverse proxy), but then ddns-updater gives me the error "ERROR validating settings: token is not set".

Maybe the provider could accept both options? 🤔

@danimart1991 commented on GitHub (Jun 19, 2024): Thanks @qdm12 for the work. I'm trying the option to use _client_id_ and _client_secret_ (it's the option that I use actually with Traefik for reverse proxy), but then _ddns-updater_ gives me the error "ERROR validating settings: token is not set". Maybe the provider could accept both options? 🤔
Author
Owner

@qdm12 commented on GitHub (Jun 19, 2024):

Well, it could maybe, but the programming using the token authentication is really a lot easier. Is it complicated to get a token? If it's too hardcore (or doesn't work) I'll work my way to support only client id+ client secret+tenant id instead.

@qdm12 commented on GitHub (Jun 19, 2024): Well, it could maybe, but the programming using the token authentication is really a lot easier. Is it complicated to get a token? If it's too hardcore (or doesn't work) I'll work my way to support only client id+ client secret+tenant id instead.
Author
Owner

@danimart1991 commented on GitHub (Jun 19, 2024):

The problem is that the Token expires in 1 hour.

@danimart1991 commented on GitHub (Jun 19, 2024): The problem is that the Token expires in 1 hour.
Author
Owner

@qdm12 commented on GitHub (Jun 19, 2024):

Indeed (and up to 1 day which doesn't work in this use case), my bad I didn't notice this.
I removed the last commit to go back to using the Azure SDK (documentation), can you try it (repull the image)? If it works, I'll go ahead and implement their authentication system (I think it's oauth2) and try to get rid of the azure sdk.

@qdm12 commented on GitHub (Jun 19, 2024): Indeed (and up to 1 day which doesn't work in this use case), my bad I didn't notice this. I removed the last commit to go back to using the Azure SDK ([documentation](https://github.com/qdm12/ddns-updater/blob/azure/docs/azure.md)), can you try it (repull the image)? If it works, I'll go ahead and implement their authentication system (I think it's oauth2) and try to get rid of the azure sdk.
Author
Owner

@danimart1991 commented on GitHub (Jun 20, 2024):

Indeed (and up to 1 day which doesn't work in this use case), my bad I didn't notice this. I removed the last commit to go back to using the Azure SDK (documentation), can you try it (repull the image)? If it works, I'll go ahead and implement their authentication system (I think it's oauth2) and try to get rid of the azure sdk.

With the Azure SDK, it works like a charm. 😇

@danimart1991 commented on GitHub (Jun 20, 2024): > Indeed (and up to 1 day which doesn't work in this use case), my bad I didn't notice this. I removed the last commit to go back to using the Azure SDK ([documentation](https://github.com/qdm12/ddns-updater/blob/azure/docs/azure.md)), can you try it (repull the image)? If it works, I'll go ahead and implement their authentication system (I think it's oauth2) and try to get rid of the azure sdk. With the Azure SDK, it works like a charm. 😇
Author
Owner

@k2snowman69 commented on GitHub (Sep 24, 2025):

Not sure how I found this project/issue but I've been digging into similar problems and might have some research to help implement. Instead of relying on an auth token, you could create an App instance with permission to edit DNS settings and generate a long running client secret for the app. After some more searching around, I found this docker image that effectively uses this same design:
https://github.com/cpwood/azure-dns-docker
It's more setup for the user but should remove the azure console command

@k2snowman69 commented on GitHub (Sep 24, 2025): Not sure how I found this project/issue but I've been digging into similar problems and might have some research to help implement. Instead of relying on an auth token, you could create an App instance with permission to edit DNS settings and generate a long running client secret for the app. After some more searching around, I found this docker image that effectively uses this same design: https://github.com/cpwood/azure-dns-docker It's more setup for the user but should remove the azure console command
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/ddns-updater#69