Open SOrozco7 opened 1 year ago
Hi @SOrozco7,
2.48.0 is not the latest Azure CLI(2.52.0).
If you haven't already attempted to do so, please upgrade to the latest Azure CLI version by following https://learn.microsoft.com/en-us/cli/azure/update-azure-cli.
Thank you for opening this issue, we will look into it.
There was a super long line that was also part of the command executed with the --debug flag but which I couldn't add because of a limit in the character count.
Here's the relevant fragment in the context of this command with the issue and the example I provided.
cli.azure.cli.core.sdk.policies:
{
"name": "East US 2",
"supportedServerVersions": [
{
"name": "12.0",
"supportedElasticPoolEditions": [
{
"name": "GeneralPurpose",
"supportedElasticPoolPerformanceLevels": [
{
"performanceLevel": {
"value": 4.0,
"unit": "VCores"
},
"sku": {
"name": "GP_Gen5",
"tier": "GeneralPurpose",
"family": "Gen5",
"capacity": 4
},
"supportedLicenseTypes": [
{
"name": "LicenseIncluded",
"status": "Default"
},
{
"name": "BasePrice",
"status": "Available"
}
],
"maxDatabaseCount": 200,
"supportedMaxSizes": [
{
"minValue": {
"limit": 1024,
"unit": "Megabytes"
},
"maxValue": {
"limit": 31744,
"unit": "Megabytes"
},
"scaleSize": {
"limit": 1024,
"unit": "Megabytes"
},
"logSize": {
"limit": 30,
"unit": "Percent"
},
"status": "Available"
},
{
"minValue": {
"limit": 32768,
"unit": "Megabytes"
},
"maxValue": {
"limit": 32768,
"unit": "Megabytes"
},
"scaleSize": {
"limit": 0,
"unit": "Megabytes"
},
"logSize": {
"limit": 30,
"unit": "Percent"
},
"status": "Default"
},
{
"minValue": {
"limit": 33792,
"unit": "Megabytes"
},
"maxValue": {
"limit": 774144,
"unit": "Megabytes"
},
"scaleSize": {
"limit": 1024,
"unit": "Megabytes"
},
"logSize": {
"limit": 30,
"unit": "Percent"
},
"status": "Available"
}
],
"supportedPerDatabaseMaxSizes": [
{
"minValue": {
"limit": 1024,
"unit": "Megabytes"
},
"maxValue": {
"limit": 31744,
"unit": "Megabytes"
},
"scaleSize": {
"limit": 1024,
"unit": "Megabytes"
},
"status": "Available"
},
{
"minValue": {
"limit": 32768,
"unit": "Megabytes"
},
"maxValue": {
"limit": 32768,
"unit": "Megabytes"
},
"scaleSize": {
"limit": 0,
"unit": "Megabytes"
},
"status": "Default"
},
{
"minValue": {
"limit": 33792,
"unit": "Megabytes"
},
"maxValue": {
"limit": 1048576,
"unit": "Megabytes"
},
"scaleSize": {
"limit": 1024,
"unit": "Megabytes"
},
"status": "Available"
}
],
"supportedPerDatabaseMaxPerformanceLevels": [
{
"limit": 0.25,
"unit": "VCores",
"supportedPerDatabaseMinPerformanceLevels": [
{
"limit": 0.0,
"unit": "VCores",
"status": "Default"
},
{
"limit": 0.25,
"unit": "VCores",
"status": "Available"
}
],
"status": "Available"
},
{
"limit": 0.5,
"unit": "VCores",
"supportedPerDatabaseMinPerformanceLevels": [
{
"limit": 0.0,
"unit": "VCores",
"status": "Default"
},
{
"limit": 0.25,
"unit": "VCores",
"status": "Available"
},
{
"limit": 0.5,
"unit": "VCores",
"status": "Available"
}
],
"status": "Available"
},
{
"limit": 1.0,
"unit": "VCores",
"supportedPerDatabaseMinPerformanceLevels": [
{
"limit": 0.0,
"unit": "VCores",
"status": "Default"
},
{
"limit": 0.25,
"unit": "VCores",
"status": "Available"
},
{
"limit": 0.5,
"unit": "VCores",
"status": "Available"
},
{
"limit": 1.0,
"unit": "VCores",
"status": "Available"
}
],
"status": "Available"
},
{
"limit": 2.0,
"unit": "VCores",
"supportedPerDatabaseMinPerformanceLevels": [
{
"limit": 0.0,
"unit": "VCores",
"status": "Default"
},
{
"limit": 0.25,
"unit": "VCores",
"status": "Available"
},
{
"limit": 0.5,
"unit": "VCores",
"status": "Available"
},
{
"limit": 1.0,
"unit": "VCores",
"status": "Available"
},
{
"limit": 2.0,
"unit": "VCores",
"status": "Available"
}
],
"status": "Available"
},
{
"limit": 4.0,
"unit": "VCores",
"supportedPerDatabaseMinPerformanceLevels": [
{
"limit": 0.0,
"unit": "VCores",
"status": "Default"
},
{
"limit": 0.25,
"unit": "VCores",
"status": "Available"
},
{
"limit": 0.5,
"unit": "VCores",
"status": "Available"
},
{
"limit": 1.0,
"unit": "VCores",
"status": "Available"
},
{
"limit": 2.0,
"unit": "VCores",
"status": "Available"
},
{
"limit": 4.0,
"unit": "VCores",
"status": "Available"
}
],
"status": "Default"
}
],
"zoneRedundant": true,
"supportedMaintenanceConfigurations": [
{
"name": "SQL_Default",
"zoneRedundant": true,
"status": "Default"
},
{
"name": "SQL_EastUS2_DB_1",
"zoneRedundant": true,
"status": "Available"
},
{
"name": "SQL_EastUS2_DB_2",
"zoneRedundant": true,
"status": "Available"
}
],
"status": "Available"
}
]
}
]
}
]
}
See how the "az sql elastic-pool update" command DOES NOT have this issue (i.e., the pool-level minCapacity is not set).
C:\Users\salvador>az sql elastic-pool update -g test-rg -s test-svr --name test-pool6 --db-min-capacity 0.5
{
"availabilityZone": "NoPreference",
"creationDate": "2023-09-22T19:31:41.963000+00:00",
"databaseDtuMax": null,
"databaseDtuMin": null,
"dtu": null,
"edition": "GeneralPurpose",
"highAvailabilityReplicaCount": null,
"id": "/subscriptions/<SUBSCRIPTION_ID>/resourceGroups/test-rg/providers/Microsoft.Sql/servers/test-svr/elasticPools/test-pool6",
"kind": "vcore,pool",
"licenseType": "LicenseIncluded",
"location": "eastus2",
"maintenanceConfigurationId": "/subscriptions/<SUBSCRIPTION_ID>/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_Default",
"maxSizeBytes": 128849018880,
"minCapacity": null,
"name": "test-pool6",
"perDatabaseSettings": {
"maxCapacity": 2.0,
"minCapacity": 0.5
},
"preferredEnclaveType": null,
"resourceGroup": "test-rg",
"sku": {
"capacity": 4,
"family": "Gen5",
"name": "GP_Gen5",
"size": null,
"tier": "GeneralPurpose"
},
"state": "Ready",
"storageMb": 122880.0,
"type": "Microsoft.Sql/servers/elasticPools",
"zoneRedundant": false
}
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @azureSQLGitHub.
Describe the bug
Based on my binary search and confirmation via experiments, starting exactly from version 2.48.0 of the Azure CLI, the command "az sql elastic-pool create" is producing a REST API request with an incorrect property being set. Interestingly, this does not happen with the "az sql elastic-pool update".
Example command:
Azure CLI version 2.48.0 (commit ID 07cce2ad65bb6f4ff1827a744f9366ccdf70cd87 ), released on 4/24/2023, is the first version with the issue.
Azure CLI version 2.47.0, released on 4/3/2023 (commit ID 90261d8f8f5747456c1aed138a964904a20d7724 ), is the last version without the issue.
Related command
az sql elastic-pool create
Errors
The command failed with an unexpected error.
Issue script & Debug output
Expected behavior
The command "az sql elastic-pool create" should succeed. The body of the resulting REST API request should only have the PerDatabaseSettings.MinCapacity property set, not the MinCapacity set (i.e., the one outside of PerDatabaseSettings should not be set).
Environment Summary
Note that the same issue is present in version 2.52 but is NOT present in versions 2.47, 2.43, 2.35 and 2.17 (as I confirmed via experiments).
Additional context
These are some code pointers which I think I relevant:
ElasticPoolCapabilitiesAdditionalDetails in src\azure-cli\azure\cli\command_modules\sql\custom.py self.argument_context('sql elastic-pool create') in src\azure-cli\azure\cli\command_modules\sql_params.py