DEMO/Infrastructure

← Back to dashboard

Pairing an adapter with what it grants

Audience: operator · Profile: demo · Read this when: you are deploying a db_grant or portainer_access adapter and want it paired with its database or Portainer rather than built by hand.

Part of Cloud Functions.

A db_grant function is named after its database and reads its target from its own environment, so one started from the Deploy a function form cannot be finished afterwards. There are two supported ways to get one, and both derive everything from the database row:

Where Dry run?
On provision the provision form's Register in Entitle choice yes — observe first
Any time after the Function (DB grant) button on the database's row no — ready to act

Either way the engine decides how the database reaches Entitle:

Engine Route Why
Postgres native Entitle connector it works; nothing to gain from replacing it
MySQL paired adapter the native connector assigns persistent roles and never mints an account
SQL Server paired adapter the native connector needs sysadmin, which managed SQL Server does not grant

The pairing runs as one clouddb_adapter_pair job covering all three stages: it stages the admin credential in the cloud's own secret store, deploys a db_grant function VPC/VNet-attached beside the database, and registers it as a REST integration. One job because the stages are useless individually — a half-finished pairing leaves you unable to tell whether to retry or clean up.

Things worth knowing:

The button is hidden — not disabled — for a database that cannot take an adapter: Postgres and Oracle (their native connector works), a registered rather than provisioned database (no admin credential is stored for the adapter to act as), an on-premises database (no cloud secret store to stage the credential in), and one with no recorded catalog to scope grants to (RDS SQL Server creates no user database, and master is the system catalog). Deploying the adapter also requires the cloud_function:write permission, since that is what it does.