OPNsense Forum

English Forums => 25.1, 25.4 Series => Topic started by: scottsdaleaz on May 24, 2025, 03:51:28 AM

Title: Dynamic DNS, with a domain in Azure can i edit config.xml to set subscription id
Post by: scottsdaleaz on May 24, 2025, 03:51:28 AM
The gui does not offer an ability to set the subscription id for an Azure based domain name.

Can i edit this config.xml directly?  If so what keys do i need to add?

    <DynDNS version="1.5.1">
      <general>
        <enabled>1</enabled>
        <verbose>0</verbose>
        <allowipv6>0</allowipv6>
        <daemon_delay>300</daemon_delay>
        <backend>opnsense</backend>
      </general>
      <accounts>
        <account uuid="cad3372f-5967-43a2-bb6c-0464b668b17e">
          <enabled>1</enabled>
          <service>azure</service>
          <protocol/>
          <server/>
          <username>2727f4f0-6beb-405b-87c3-f6eaf7eb37a5</username>
          <password>2e1910c8-f0b2-4a21-adcb-6822ac9c9cf9</password>
          <resourceId>d6fbdc4b-9684-4087-b56f-c23dac47140e</resourceId>
          <hostnames>cav.dummydomain.com</hostnames>
          <wildcard>0</wildcard>
          <zone/>
          <checkip>web_dyndns</checkip>
          <dynipv6host/>
          <checkip_timeout>10</checkip_timeout>
          <force_ssl>1</force_ssl>
          <ttl>300</ttl>
          <interface>wan</interface>
          <description>dummydomain_inxsol</description>
        </account>
      </accounts>
    </DynDNS>
  </OPNsense>

Title: Re: Dynamic DNS, with a domain in Azure can i edit config.xml to set subscription id
Post by: EricPerl on May 25, 2025, 12:50:50 AM
Given the commit that resolved https://github.com/opnsense/plugins/issues/3037 (https://github.com/opnsense/plugins/issues/3037), the subscription id goes into the resource id that shows up in advanced mode...

I've never used ddclient, dynDNS or Azure. Just a bit of research...
Title: Re: Dynamic DNS, with a domain in Azure can i edit config.xml to set subscription id
Post by: scottsdaleaz on May 25, 2025, 03:11:46 AM
this was more related to the issue. thanks for pointing me to github.

https://github.com/opnsense/plugins/issues/3757
Title: Re: Dynamic DNS, with a domain in Azure can i edit config.xml to set subscription id
Post by: EricPerl on May 25, 2025, 07:58:51 AM
Are you saying that the id you input in the UI resourceId is nowhere to be found in config.xml, likely right along the rest of your identifiers?
Title: Re: Dynamic DNS, with a domain in Azure can i edit config.xml to set subscription id
Post by: scottsdaleaz on May 25, 2025, 06:11:10 PM
The dialog does not have a field for subscription id, and if i try using "resourceId" with sunscription id entered into it -  it doesn't solve the issue.  OnPF sense i recall setting both.

(https://allensharedfolder.s3.us-west-1.wasabisys.com/dialog-01-11.jpg)

(https://allensharedfolder.s3.us-west-1.wasabisys.com/elog-10-00.jpg)

"subsciptionid" (assumed) is not present in the config and not present in the dialog to enter it.
Title: Re: Dynamic DNS, with a domain in Azure can i edit config.xml to set subscription id
Post by: EricPerl on May 25, 2025, 10:18:55 PM
I had based my original answer on this line:
        "id": "/subscriptions/00000000-0000-0000-0000-00000000000/resourceGroups/example/providers/Microsoft.Network/dnszones/example.com",   <---- ResourceIdWhich I took to imply that the resourceId would be plugged in the URL where a subscription Id should fit (pretty typical for REST API).

But a few lines below, there's this:
            resourceId = self.settings.get('resourceId', '')
            if resourceId.find('subscriptions/') == -1:
                syslog.syslog(syslog.LOG_ERR, 'No subscription id found for account %s' % self.description)
Which implies the resourceId must be formatted as 'subscriptions/YOUR_SUB_ID_HERE'.

The tenant ID is extracted from authentication data a few lines later.

Also, the message from the author of the commit indicates an additional setting here:
https://github.com/opnsense/plugins/issues/3037#issuecomment-1373596121 (https://github.com/opnsense/plugins/issues/3037#issuecomment-1373596121)

You've got a few things to try...