ETLMCPData Conveyance Works
Log in Start free
Guides

Connect etlmcp to Azure Database for PostgreSQL: public access and firewall rules

What an Azure PostgreSQL flexible server needs before etlmcp can load it - public access, an IPv4 firewall rule for etlmcp's address and its FQDN as host.

etlmcp can load an Azure Database for PostgreSQL flexible server only when the server was created with Public access (allowed IP addresses), has a firewall rule for etlmcp's IPv4 address, and is entered on the destination form by its fully qualified domain name. A flexible server allows no address at all until you add a rule, so a fresh server turns etlmcp away even with the right password.

Check which networking option the server has

Azure makes you pick one of two networking options when you create a flexible server. With Private access (virtual network integration), the server is placed inside one of your Azure virtual networks, and Microsoft describes that option as giving the server no endpoint that is reachable from the internet. Clients reach it from the same virtual network, from a peered network, or over a VPN or ExpressRoute.

etlmcp connects over the internet, so it cannot reach a server with private access. Its PostgreSQL destination also resolves the host you enter and refuses any name that points to a private address, with the message host not allowed. A server deployed into a virtual network cannot be moved out of it later, so if your server uses private access, etlmcp needs a different server created with public access.

You can see the option on the server's Networking page in the Azure portal.

Add a firewall rule for etlmcp

With public access, Azure checks the source address of every connection against the server-level firewall rules, and by default the list is empty. Add a rule for the address etlmcp connects from:

  1. In etlmcp, open the destinations page. When the server has a published address, the note under your destinations reads "Behind a firewall? Allow connections from" followed by that address. It is an IPv4 address.
  2. In the Azure portal, open the server, then Networking.
  3. Under the firewall rules, add a rule named, for example, etlmcp, with that address as both the start and the end IP.
  4. Click Save.

Azure accepts only IPv4 firewall rules; an IPv6 entry fails validation. The rule applies to every database on the server.

Microsoft says a firewall change can take up to five minutes to take effect. Until then, and whenever an address is not allowed, PostgreSQL rejects the client with an error that contains no pg_hba.conf entry for host. You cannot edit pg_hba.conf on Azure: the service rewrites it from the networking settings, so when an address is blocked, the fix is a firewall rule.

Avoid the "any Azure service" checkbox

The Networking page has a checkbox, Allow public access from any Azure service within Azure to this server. It opens the firewall to every client inside Azure, including resources in other customers' subscriptions, so it is far wider than you need. Leave it off and keep the single rule for etlmcp's address.

Fill in the destination form

  • Host: the server's name in the form <server>.postgres.database.azure.com. Microsoft advises against using the server's IP address because it is not guaranteed to stay the same, for example across maintenance.
  • Port: the PostgreSQL port Azure serves on, 5432.
  • Database, User and Password: a database user you created for etlmcp. The firewall rule only lets etlmcp try to connect; Azure still checks the credentials. See PostgreSQL privileges for what the user needs.

Azure enforces encrypted connections on flexible servers. etlmcp connects with sslmode=require by default, and its server refuses to start with any setting weaker than require, verify-ca or verify-full, so no change to TLS is needed on the Azure side. PostgreSQL SSL modes explains the modes.

Then click Test on the destination. For other failures, see PostgreSQL destination errors and the PostgreSQL destination reference.

Related

Sources

  1. Networking with Public Access (Allowed IP Addresses) in Azure Database for PostgreSQL Flexible Server — learn.microsoft.com, checked
  2. Network with Private Access (Virtual Network Integration) in Azure Database for PostgreSQL Flexible Server — learn.microsoft.com, checked