Azure / Azure/bicep

Undocumented parameter 'serverGroupName' needed for Microsoft.DBforPostgreSQL/flexibleServers

Open
#5,616 12 comments 1 reaction 0 assignees View on GitHub
provider improvement
Dominant language
Bicep
Stars
3.6k
Forks
830
Avg merge
1d 21m
Merged PRs (30d)
79

Description

**Bicep version**
`az bicep version`: Bicep CLI version 0.4.1124 (66c84c8ee5)
VS-Code extension: v0.4.1124

**Describe the bug**
When I try to create a new Microsoft.DBforPostgreSQL/flexibleServers with modes `PointInTimeRestore` or `Create`, I always get the error `Invalid value given for parameter serverGroupName.`

I cannot find this parameter in the documentation [(ARM-Documentation)](https://docs.microsoft.com/en-us/azure/templates/microsoft.dbforpostgresql/flexibleservers?tabs=bicep)

If I provide `serverGroupName` at top level in the resource I get `Error BCP037: The property "serverGroupName" is not allowed on objects of type "Microsoft.
DBforPostgreSQL/flexibleServers". Permissible properties include "dependsOn", "sku". If this is an inaccuracy in the documentation, please report it to the Bicep Team.`

It is possible to provide `serverGroupName` within the `properties` (Tooling displays a warning then), but then again deployment fails with `Invalid value given for parameter serverGroupName.`.

Full error:
``` json
{
"code": "DeploymentFailed",
"message": "At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/DeployOperations for usage details.",
"details": [
{
"code": "InvalidParameterValue",
"message": "Invalid value given for parameter serverGroupName. Specify a valid parameter value."
}
]
}
```

**To Reproduce**
Use one of the following bicep-files and run `az deployment group create -c -n deplyoment-name -g tests --template-file main.bicep`

**Additional context**

**Bicep-file for PointInTimeRestore:**
``` bicep
param location string = resourceGroup().location
@description('the point in time from which the production data has to be restored')
param restoreDate string = utcNow()
@description('URL of source DB instance, with or without port')
param sourceDbUrl string
@description('sourceDb\'s resource group')
param sourceResourceGroup string = 'source-rg'

var sourceServerName = split(sourceDbUrl, '.')[0]
var tags = {
bicepProject: 'bicepTest'
}

resource sourceDb 'Microsoft.DBforPostgreSQL/flexibleServers@2021-06-01' existing = {
scope: resourceGroup(sourceResourceGroup)
name: sourceServerName
}

resource psqlPrivateDnsZone 'Microsoft.Network/privateDnsZones@2020-06-01' existing = {
scope: resourceGroup(sourceResourceGroup)
name: 'test.private.postgres.database.azure.com'
}

resource newDb 'Microsoft.DBforPostgreSQL/flexibleServers@2021-06-01' = {
name: 'someprefix-${take(uniqueString(restoreDate), 8)}'
location: location
tags: tags
properties: {
createMode: 'PointInTimeRestore'
sourceServerResourceId: sourceDb.id
pointInTimeUTC: restoreDate
version: '11'
backup: {
geoRedundantBackup: 'Disabled'
}
network: {
delegatedSubnetResourceId: sourceDb.properties.network.delegatedSubnetResourceId
privateDnsZoneArmResourceId: psqlPrivateDnsZone.id
}
}
}
```

**Bicep-file for Create:**

``` bicep
param location string = resourceGroup().location
@description('the point in time from which the production data has to be restored')
param dateNow string = utcNow()

var tags = {
bicepProject: 'bicepTest'
}

resource vnet 'Microsoft.Network/virtualNetworks@2021-05-01' existing = {
scope: resourceGroup('some-rg')
name: 'testnet'
}

resource subnet 'Microsoft.Network/virtualNetworks/subnets@2021-05-01' existing = {
parent: vnet
name: 'psql-flex-server'
}

resource psqlPrivateDnsZone 'Microsoft.Network/privateDnsZones@2020-06-01' existing = {
scope: resourceGroup('some-rg')
name: 'test.private.postgres.database.azure.com'
}

resource upshiftDb 'Microsoft.DBforPostgreSQL/flexibleServers@2021-06-01' = {
name: 'upshiftDb-${take(uniqueString(dateNow), 8)}'
location: location
tags: tags
properties: {
createMode: 'Create'
version: '11'
backup: {
geoRedundantBackup: 'Disabled'
}
network: {
delegatedSubnetResourceId: subnet.id
privateDnsZoneArmResourceId: psqlPrivateDnsZone.id
}
}
}
```

Contributor guide

Open the contributing guide

Research direction

Start with the reported Microsoft.DBforPostgreSQL/flexibleServers@2021-06-01 resources in the two main.bicep examples and compare them with the linked ARM documentation. Reproduce the PointInTimeRestore and Create deployments using the supplied commands, then determine how serverGroupName is expected to be represented. Done means the parameter is accepted and the deployment succeeds, or the documentation and Bicep validation agree on its unsupported status.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.