Azure / Azure/azure-sdk-for-python

Invalid value given for parameter Tier

Open
#44,200 1 comment 0 reactions 0 assignees View on GitHub
customer-reported Mgmt needs-team-attention PostgreSQL question
Dominant language
Python
Stars
5.6k
Forks
3.4k
Avg merge
1d 21h
Merged PRs (30d)
193

Description

- **Package Name**: azure-mgmt-postgresqlflexibleservers
- **Package Version**: 2.0.0
- **Operating System**: Windows 11
- **Python Version**: 3.10

**Describe the bug**
A clear and concise description of what the bug is.

After the major change to 2.0.0 I am testing my script and receiving the following error message:
Invalid value given for parameter Tier from the class 'azure.core.exceptions.HttpResponseError'.

The tier values are provided for SKU and Storage. The error appeared after I have changed the code for the server creation from begin_create to begin_create_and_update. The begin_update function was also updated and that works fine with the same parametrisation.

By debugging the code I can see, that the SKU tier is Bustable and the Storage is serialized to P1 value.

The documentation in the Python SDK reference seems not to be updated, but based on the code the change can be implemented more or less straight forward.

The error message is not referring which Tire argument is None more precisely.

(, HttpResponseError('(InvalidParameterValue) Invalid value given for parameter Tier. Specify a valid parameter value.\nCode: InvalidParameterValue\nMessage: Invalid value given for parameter Tier. Specify a valid parameter value.'), )

'(InvalidParameterValue) Invalid value given for parameter Tier. Specify a valid parameter value.
Code: InvalidParameterValue
Message: Invalid value given for parameter Tier. Specify a valid parameter value., NoneType: None'

The serialized json content sent is based on debugging looks similar
{'location': 'westeurope', 'properties': {'administratorLogin': 'dbpostgres', 'administratorLoginPassword': 'something', 'authConfig': {'activeDirectoryAuth': 'Enabled', 'passwordAuth': 'Enabled', 'tenantId': ''}, 'availabilityZone': '', 'backup': {'backupRetentionDays': 7, 'geoRedundantBackup': 'Enabled'}, 'createMode': 'Create', 'highAvailability': {'standbyAvailabilityZone': ''}, 'maintenanceWindow': {'customWindow': 'Disabled', 'dayOfWeek': 0, 'startHour': 0, 'startMinute': 0}, 'network': {'delegatedSubnetResourceId': '/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/common/providers/Microsoft.Network/virtualNetworks/vNet1/subnets/build-postgres-subnet', 'privateDnsZoneArmResourceId': '/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/platform-rg/providers/Microsoft.Network/privateDnsZones/flexible.private.postgres.database.azure.com', 'publicNetworkAccess': 'Disabled'}, 'storage': {'storageSizeGB': 32, 'tier': 'P1'}, 'version': '11'}, 'sku': {'name': 'Standard_B1ms', 'tier': 'Burstable'}}

**To Reproduce**
Steps to reproduce the behavior:
1. I am trying to create a flexible server to test the code after the major change.

**Expected behavior**
A clear and concise description of what you expected to happen.

The request is accepted to create the server.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Additional context**
Add any other context about the problem here.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.