I stumbled onto this thread when I had the same database connection problem. The solution about creating a new site, and then going and changing its settings worked for the subsite, but it left undesired consequences of A) the main site still not working on the custom domain; and B) awkward dashboard navigation behavior (when on the subsite, trying to get back to the network dashboard didn't work).
After much trial and error, and some bizarre behavior in which the multisite installation seemed to revert back to the non-multisite view, I finally got it so that both the primary site and the subsite work on the custom domain, but it took manual updating of four values in three database tables.
- In the wp_site table I changed the value of the domain column in the only entry to my custom domain
- In the wp_options table, I changed the option_value for both siteurl and home to my custom domain
- In the wp_blogs table, I changed the domain for the primary site to my custom domain.
There are still a couple of leftover references to the azurewebsites domain, in the wp_usermeta table for the first Super Admin when the site was created, but everything seems to work.
Since this involves direct database manipulation, I would advise anyone trying this to back things up first and proceed with caution. But I hope it helps. I also hope that at some point Microsoft updates whatever scripts it uses for WordPress multisite installations to address the issues I encountered that wasted most of a day.