Azure / Azure/terraform-provider-azapi

Microsoft.DBforPostgreSQL/serverGroupsv2@2023-03-02-preview doesn't allow setting activeDirectoryAuth

Open
#1,096 0 comments 0 reactions 0 assignees View on GitHub
triaged
Dominant language
Go
Stars
244
Forks
97
Avg merge
5d 9h
Merged PRs (30d)
9

Description

[Azure RM documentation](https://learn.microsoft.com/en-us/azure/templates/microsoft.dbforpostgresql/2023-03-02-preview/servergroupsv2?pivots=deployment-language-terraform) says authConfig block to enable entra id authentication:

```hcl
resource "azapi_resource" "symbolicname" {
type = "Microsoft.DBforPostgreSQL/serverGroupsv2@2023-03-02-preview"
# ...
body = {
properties = {
authConfig = {
activeDirectoryAuth = "string"
passwordAuth = "string"
}
#...
}
}
}
```

Enabling it in the portal and looking at resource json in the portal it shows the following fields are set on API version `2023-03-02-preview`

```json
{
"name": "cospos-datsharedres-stag-eun-vrvr",
"type": "Microsoft.DBforPostgreSQL/serverGroupsv2",
"properties": {
"aad_auth_enabled": "enabled",
"password_enabled": "enabled"
}
}
```
however trying to set any if the fields in an `azapi_resource results` in apply failing with the following error:

```
│ Error: Missing Resource Identity After Update

│ with azapi_resource.cosmos_postgres,
│ on main.tf line 122, in resource "azapi_resource" "cosmos_postgres":
│ 122: resource "azapi_resource" "cosmos_postgres" {

│ The Terraform Provider unexpectedly returned no resource identity data
│ after having no errors in the resource update. This is always an issue in
│ the Terraform Provider and should be reported to the provider developers.
```

The azapi example only show API version `2022-11-08` that doesn't support entra id authentication, can't tell if this is an azapi issue or an azure rm api issue

Contributor guide

Open the contributing guide

Research direction

Start with the azapi_resource configuration in main.tf at line 122 and compare the 2023-03-02-preview authConfig schema with the portal's returned properties. Reproduce the apply using activeDirectoryAuth/passwordAuth and the 2022-11-08 example, then determine whether the missing identity is caused by AzAPI or Azure Resource Manager. Done means the supported API request applies successfully and the authentication settings are preserved.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, postgresql, terraform
Domain
cloud, databases, infrastructure
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.