Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ParameterOutOfRange: The value of the 'Version' should be in: [] #19

Closed
savannahostrowski opened this issue Apr 3, 2023 · 6 comments
Closed

Comments

@savannahostrowski
Copy link

savannahostrowski commented Apr 3, 2023

This issue is for a: (mark with an x)

- [x ] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

  • Run azd init --template https://github.com/pamelafox/flask-surveys-container-app
  • Run azd up

Any log messages given by the failure

ERROR: deployment failed: error deploying infrastructure: failed deploying: deploying to subscription:

Deployment Error Details:
ParameterOutOfRange: The value of the 'Version' should be in: []. Verify that the specified parameter value is correct.

Expected/desired behavior

Should azd up!

OS and Version?

WSL 2 (Ubuntu 22.04)

Versions

azd version 0.7.0-beta.1 (commit 9ce71659f7688d0dc3dda8b84e5accedca58cf01)

Mention any other details that might be useful

Not sure if this is a subscription issue or what. The Bicep error seems a little cryptic. I was trying to piggyback off of this template for my upcoming talk at PyCon as this template is one of our only templates in the gallery that uses Postgres and ACA.

@savannahostrowski
Copy link
Author

After digging more I suspect that this is an issue with https://github.com/Azure-Samples/todo-python-mongo-aca/blob/main/infra/core/database/postgresql/flexibleserver.bicep. I've raised it with the azd team for investigation.

@vhvb1989
Copy link

vhvb1989 commented Apr 4, 2023

I am suspecting on bicep cli, as it is generating this ARM json:

{
              "type": "Microsoft.DBforPostgreSQL/flexibleServers",
              "apiVersion": "2022-12-01",
              "name": "[parameters('name')]",
              "location": "[parameters('location')]",
              "tags": "[parameters('tags')]",
              "sku": "[parameters('sku')]",
              "properties": {
                "version": "[parameters('version')]",
                "administratorLogin": "[parameters('administratorLogin')]",
                "administratorLoginPassword": "[parameters('administratorLoginPassword')]",
                "storage": "[parameters('storage')]",
                "highAvailability": {
                  "mode": "Disabled"
                }
              }
            }

Note the value for apiVersion = "apiVersion": "2022-12-01",

I used the Azure portal to generate the ARM template for the Microsoft.DBforPostgreSQL/flexibleServers and got:

{
            "apiVersion": "[parameters('apiVersion')]",
            "location": "[parameters('location')]",
            "name": "[parameters('serverName')]",
            "identity": "[if(empty(parameters('identityData')), json('null'), parameters('identityData'))]",
            "properties": {
                "version": "[parameters('version')]",
                "administratorLogin": "[parameters('administratorLogin')]",
                "administratorLoginPassword": "[parameters('administratorLoginPassword')]",
                "Network": "[if(empty(parameters('vnetData').Network), json('null'), parameters('vnetData').Network)]",
                "availabilityZone": "[parameters('availabilityZone')]",
                "Storage": {
                    "StorageSizeGB": "[parameters('storageSizeGB')]",
                    "Autogrow": "[parameters('storageAutogrow')]"
                },
                "Backup": {
                    "backupRetentionDays": "[parameters('backupRetentionDays')]",
                    "geoRedundantBackup": "[parameters('geoRedundantBackup')]"
                },
                "highAvailability": {
                    "mode": "[parameters('haEnabled')]",
                    "standbyAvailabilityZone": "[parameters('standbyAvailabilityZone')]"
                },
                "dataencryption": "[if(empty(parameters('dataEncryptionData')), json('null'), parameters('dataEncryptionData'))]",
                "authConfig": "[if(empty(parameters('authConfig')), json('null'), parameters('authConfig'))]"
            },
            "sku": {
                "name": "[parameters('vmName')]",
                "tier": "[parameters('serverEdition')]"
            },
            "tags": "[parameters('tags')]",
            "type": "Microsoft.DBforPostgreSQL/flexibleServers"
        }

and param for apiVersion:

"apiVersion": {
            "type": "string",
            "defaultValue": "2021-06-01"
        }

Note how apiVersion is => "apiVersion": "[parameters('apiVersion')]", (using [] )

Hence, bicep cli is not generating a valid ARM template for "Microsoft.DBforPostgreSQL/flexibleServers"

We need to follow up with bicep cli

@pamelafox
Copy link
Owner

Hm, which location did you use? Last time I got this, it worked in a different location, and the portal support team claimed that internal provisioning constraints explained the error. Might have been a fluke though.

@savannahostrowski
Copy link
Author

Hmm, I was using eastus2. I'll try something else later tonight though. Super poor error messaging upstream if that's the issue :(

@pamelafox
Copy link
Owner

Yeah, eastus2 is blocked internally for postgres:
Azure/azure-dev#995
Try eastus or centralus

@savannahostrowski
Copy link
Author

ugh - yeah okay, eastus works. I already have an item prioritized around improving the regions we surface/suggest to users but at the very least we should improve the error message here. I'll close this - thanks for chatting through it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants