Azure / Azure/azure-rest-api-specs

PostgreSQL server Entra ID administrator issue

Open
#27,030 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

customer-reported PostgreSQL question Service Attention
Dominant language
TypeSpec
Stars
3.1k
Forks
6k
Avg merge
2d 21h
Merged PRs (30d)
432

Description

Original issue: hashicorp/terraform-provider-azurerm#24168

Getting the following error when trying to configure a PostgreSQL server Entra ID administrator using the AzureRM provider for Terraform:

╷
│ Error: creating/updating Server (Subscription: "<SUBSCRIPTION_ID>"
│ Resource Group Name: "rg-90af49e4e7fef93e"
│ Server Name: "psql-90af49e4e7fef93e"): polling after CreateOrUpdate: polling failed: the Azure API returned the following error:
│
│ Status: "InternalServerError"
│ Code: ""
│ Message: "An unexpected error occured while processing the request. Tracking ID: '287dc7a0-e0ff-4168-96e6-50a8f31588ba'"
│ Activity Id: ""
│
│ ---
│
│ API Response:
│
│ ----[start]----
│ {"name":"0c4553b2-1151-48be-aeb5-92aa8b3183e9","status":"Failed","startTime":"2023-12-08T14:14:01.477Z","error":{"code":"InternalServerError","message":"An unexpected error occured while processing the request. Tracking ID: '287dc7a0-e0ff-4168-96e6-50a8f31588ba'"}}
│ -----[end]-----
│
│
│   with azurerm_postgresql_active_directory_administrator.example,
│   on example.tf line 39, in resource "azurerm_postgresql_active_directory_administrator" "example":
│   39: resource "azurerm_postgresql_active_directory_administrator" "example" {
│
╵

Terraform configuration:

provider "azurerm" {
  features {}
}

resource "random_id" "suffix" {
  byte_length = 8
}

resource "azurerm_resource_group" "example" {
  name     = "rg-${random_id.suffix.hex}"
  location = "northeurope"
}

resource "random_password" "psql" {
  length      = 128
  lower       = true
  upper       = true
  numeric     = true
  special     = true
  min_lower   = 1
  min_upper   = 1
  min_numeric = 1
  min_special = 1
}

resource "azurerm_postgresql_server" "example" {
  name                         = "psql-${random_id.suffix.hex}"
  resource_group_name          = azurerm_resource_group.example.name
  location                     = azurerm_resource_group.example.location
  sku_name                     = "B_Gen5_1"
  version                      = "11"
  ssl_enforcement_enabled      = true
  administrator_login          = "psqladmin"
  administrator_login_password = random_password.psql.result
}

data "azurerm_client_config" "current" {}

resource "azurerm_postgresql_active_directory_administrator" "example" {
  resource_group_name = azurerm_resource_group.example.name
  server_name         = azurerm_postgresql_server.example.name
  login               = "adadmin"
  object_id           = data.azurerm_client_config.current.object_id
  tenant_id           = data.azurerm_client_config.current.tenant_id
}

I don't get this error 100% of the time, but I get it more often than not.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the Terraform configuration using azurerm_postgresql_server and azurerm_postgresql_active_directory_administrator, with the failing operation at example.tf line 39. Compare intermittent failures with the Azure REST API behavior and determine whether the issue belongs in this API specification repository; done means identifying a reproducible specification or service discrepancy and documenting the evidence.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, postgresql, terraform
Domain
api, cloud, databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.