API - Azure PgSQL database exporter fails

Hi all,

I’m trying to automate process of adding new Azure PostgreSQL instance into PMM.
Via web UI all works just fine (going though Add Instance → MS Azure → Fill in subscription details,… → Fill in PgSQL details). It adds the node, creates the service and 3 agents (Azure database exporter, Postgres exporter and QAN PgStatements exported). All works fine.

But now I want to do the same through API.

  1. Create node - no problem
  2. Create service - no problem
  3. Create PostgreSQL Exporter - no problem
  4. Create QAN PgStatements exporter - no problem
  5. Create Azure Metrics exporter - it creates the agent but its state is UNKNOWN

It also looks different in web UI if created via API (see screenshots).

Call this code:

curl -X 'POST' \
  'https://percona.fcs-sand-emea-001.internal.aks.xxxxx.me/v1/inventory/Agents/AddAzureDatabaseExporter' \
  -H 'accept: application/json' \
  -H 'authorization: Basic YWRtaW46I1o2azVaflJHQ3dybWZxRw==' \
  -H 'Content-Type: application/json' \
  -d '{
  "pmm_agent_id": "pmm-server",
  "node_id": "/node_id/627e6fff-9d06-4b7b-8b34-013888879dd2",
  "azure_client_id": "xxxxxxxxxxxxxxxxxxxxxx",
  "azure_client_secret": "xxxxxxxxxxxxxxxxxxxxxxx",
  "azure_tenant_id": "xxxxxxxxxxxxxxxxxxxxxxx",
  "azure_subscription_id": "xxxxxxxxxxxxxxxxxxxx",
  "azure_resource_group": "rg-emea_we_cslab-PSQL_Service_LAB_001",
  "azure_database_resource_type": "postgres",
  "skip_connection_check": true,
  "push_metrics": true,
  "log_level": "auto"
}'

results in:

{
  "azure_database_exporter": {
    "agent_id": "/agent_id/ccbda484-28fb-4709-9595-c2c0440335fa",
    "pmm_agent_id": "pmm-server",
    "node_id": "/node_id/627e6fff-9d06-4b7b-8b34-013888879dd2",
    "azure_database_subscription_id": "xxxxxxxxxxxxxxxxxxxxx",
    "status": "UNKNOWN"
  }
}

Via ‘wizard’:


Running version 2.30

So the question is: am I doing it all wrong? :smiley:
Any help would be much appreciated.

Thanks.

1 Like