I found out the hard way that this same thing doesn't work when using a Unifi Dream Router, I guess it uses a different package for the ddns, but in order to get it working I built a Python version of this Azure Function, with instructions here: github.com/eavanvalkenburg/dyndns