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

[BUG] - Sku gotten from databases.get gives InvalidSku for databases.beginCreateOrUpdateAndWait #33101

Open
2 of 6 tasks
michal-rak-cyera opened this issue Feb 18, 2025 · 6 comments
Assignees
Labels
customer-reported Issues that are reported by GitHub users external to the Azure organization. Mgmt This issue is related to a management-plane library. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention Workflow: This issue is responsible by Azure service team.

Comments

@michal-rak-cyera
Copy link

michal-rak-cyera commented Feb 18, 2025

  • Package Name: @azure/arm-sql
  • Package Version: "^9.0.0"
  • Operating system: Mac
  • nodejs
    • version: v18.20.4
  • browser
    • name/version:
  • typescript
    • version: version: 4.8.4
  • Is the bug related to documentation in

Describe the bug
databases.beginCreateOrUpdateAndWait() with createMode: KnownCreateMode.Copy and parameters: Database, where Database has sku.name: 'Standard' returns Rest Error InvalidSku. The sku 'Standard' specified is invalid., even though this is the sku.name that is returned from databases.get().
This reproduces for other DTU sku-s where the Sku name is different from the corresponding ServiceLevelObjective.name, but not for vCore DTU-s.
However, manual setting of sku.name to be the corresponding serviceLevelObjective.name works, and does not return Rest Error

To Reproduce
Get an AzureSQL Database using databases.get() where it's Sku is Standard with capacity 10. Try sending the gotten sku attribute as a parameter in databases.beginCreateOrUpdateAndWait() when using createMode: KnownCreateMode.Copy (known, possibly in other create modes too)

Expected behavior
Sku interface that returns from databases.get() matches interface expected in parameters for databases.beginCreateOrUpdateAndWait()

@github-actions github-actions bot added customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Feb 18, 2025
@xirzec xirzec added the Mgmt This issue is related to a management-plane library. label Feb 18, 2025
@github-actions github-actions bot removed the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Feb 18, 2025
@kazrael2119
Copy link
Contributor

Hi @michal-rak-cyera what's the region you use when you create this resource
in JS SDK code, there's a note for customer to set the sku here: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/sql/arm-sql/src/models/index.ts#L8511-L8524
could you try to list all the skus and confirm whether your region support "Standard" sku ?

@michal-rak-cyera
Copy link
Author

michal-rak-cyera commented Feb 19, 2025

This happened with a number of regions, ex: eastus. create does support Standard, but expected Sku to be of type like this:

sku = {
name: 'S0',
capacity: 10
}

even though when using get the sku returns as

sku = {
name: `Standard`,
capacity: 10
}

The problem is the type of sku.name is different for the getter method and the setter method

@kazrael2119
Copy link
Contributor

I try to list all the skus with eastus, here is the result

 az sql db list-editions -l eastus -o table
ServiceObjective    Sku            Edition           Family    Capacity    Unit    Available
------------------  -------------  ----------------  --------  ----------  ------  -----------
System              System         System                      0           DTU     False
System0             System         System                      0           DTU     False
System1             System         System                      0           DTU     False
System2             System         System                      0           DTU     False
System3             System         System                      0           DTU     False
System4             System         System                      0           DTU     False
System2L            System         System                      0           DTU     False
System3L            System         System                      0           DTU     False
System4L            System         System                      0           DTU     False
GP_SYSTEM_2         GP_SYSTEM      System            Gen5      2           VCores  False
GP_SYSTEM_4         GP_SYSTEM      System            Gen5      4           VCores  False
GP_SYSTEM_8         GP_SYSTEM      System            Gen5      8           VCores  False
Free                Free           Free                        5           DTU     False
Basic               Basic          Basic                       5           DTU     False
S0                  Standard       Standard                    10          DTU     False
S1                  Standard       Standard                    20          DTU     False
S2                  Standard       Standard                    50          DTU     False
S3                  Standard       Standard                    100         DTU     False
S4                  Standard       Standard                    200         DTU     False
S6                  Standard       Standard                    400         DTU     False
S7                  Standard       Standard                    800         DTU     False
S9                  Standard       Standard                    1600        DTU     False
S12                 Standard       Standard                    3000        DTU     False
P1                  Premium        Premium                     125         DTU     False
P2                  Premium        Premium                     250         DTU     False
P4                  Premium        Premium                     500         DTU     False
P6                  Premium        Premium                     1000        DTU     False
P11                 Premium        Premium                     1750        DTU     False
P15                 Premium        Premium                     4000        DTU     False
DW100c              DataWarehouse  DataWarehouse               900         DTU     False
DW200c              DataWarehouse  DataWarehouse               1800        DTU     False
DW300c              DataWarehouse  DataWarehouse               2700        DTU     False
DW400c              DataWarehouse  DataWarehouse               3600        DTU     False
DW500c              DataWarehouse  DataWarehouse               4500        DTU     False
DW1000c             DataWarehouse  DataWarehouse               9000        DTU     False
DW1500c             DataWarehouse  DataWarehouse               13500       DTU     False
DW2000c             DataWarehouse  DataWarehouse               18000       DTU     False
DW2500c             DataWarehouse  DataWarehouse               22500       DTU     False
DW3000c             DataWarehouse  DataWarehouse               27000       DTU     False
DW5000c             DataWarehouse  DataWarehouse               45000       DTU     False
DW6000c             DataWarehouse  DataWarehouse               54000       DTU     False
DW7500c             DataWarehouse  DataWarehouse               67500       DTU     False
DW10000c            DataWarehouse  DataWarehouse               90000       DTU     False
DW15000c            DataWarehouse  DataWarehouse               135000      DTU     False
DW30000c            DataWarehouse  DataWarehouse               270000      DTU     False
DS100               Stretch        Stretch                     750         DTU     False
DS200               Stretch        Stretch                     1500        DTU     False
DS300               Stretch        Stretch                     2250        DTU     False
DS400               Stretch        Stretch                     3000        DTU     False
DS500               Stretch        Stretch                     3750        DTU     False
DS600               Stretch        Stretch                     4500        DTU     False
DS1000              Stretch        Stretch                     7500        DTU     False
DS1200              Stretch        Stretch                     9000        DTU     False
DS1500              Stretch        Stretch                     11250       DTU     False
DS2000              Stretch        Stretch                     15000       DTU     False
GP_S_Gen5_1         GP_S_Gen5      GeneralPurpose    Gen5      1           VCores  False
GP_Gen5_2           GP_Gen5        GeneralPurpose    Gen5      2           VCores  False
GP_S_Gen5_2         GP_S_Gen5      GeneralPurpose    Gen5      2           VCores  False
GP_DC_2             GP_DC          GeneralPurpose    DC        2           VCores  False
GP_Gen5_4           GP_Gen5        GeneralPurpose    Gen5      4           VCores  False
GP_S_Gen5_4         GP_S_Gen5      GeneralPurpose    Gen5      4           VCores  False
GP_DC_4             GP_DC          GeneralPurpose    DC        4           VCores  False
GP_Gen5_6           GP_Gen5        GeneralPurpose    Gen5      6           VCores  False
GP_S_Gen5_6         GP_S_Gen5      GeneralPurpose    Gen5      6           VCores  False
GP_DC_6             GP_DC          GeneralPurpose    DC        6           VCores  False
GP_Gen5_8           GP_Gen5        GeneralPurpose    Gen5      8           VCores  False
GP_S_Gen5_8         GP_S_Gen5      GeneralPurpose    Gen5      8           VCores  False
GP_DC_8             GP_DC          GeneralPurpose    DC        8           VCores  False
GP_Fsv2_8           GP_Fsv2        GeneralPurpose    Fsv2      8           VCores  False
GP_Gen5_10          GP_Gen5        GeneralPurpose    Gen5      10          VCores  False
GP_S_Gen5_10        GP_S_Gen5      GeneralPurpose    Gen5      10          VCores  False
GP_DC_10            GP_DC          GeneralPurpose    DC        10          VCores  False
GP_Fsv2_10          GP_Fsv2        GeneralPurpose    Fsv2      10          VCores  False
GP_Gen5_12          GP_Gen5        GeneralPurpose    Gen5      12          VCores  False
GP_S_Gen5_12        GP_S_Gen5      GeneralPurpose    Gen5      12          VCores  False
GP_DC_12            GP_DC          GeneralPurpose    DC        12          VCores  False
GP_Fsv2_12          GP_Fsv2        GeneralPurpose    Fsv2      12          VCores  False
GP_Gen5_14          GP_Gen5        GeneralPurpose    Gen5      14          VCores  False
GP_S_Gen5_14        GP_S_Gen5      GeneralPurpose    Gen5      14          VCores  False
GP_DC_14            GP_DC          GeneralPurpose    DC        14          VCores  False
GP_Fsv2_14          GP_Fsv2        GeneralPurpose    Fsv2      14          VCores  False
GP_Gen5_16          GP_Gen5        GeneralPurpose    Gen5      16          VCores  False
GP_S_Gen5_16        GP_S_Gen5      GeneralPurpose    Gen5      16          VCores  False
GP_DC_16            GP_DC          GeneralPurpose    DC        16          VCores  False
GP_Fsv2_16          GP_Fsv2        GeneralPurpose    Fsv2      16          VCores  False
GP_Gen5_18          GP_Gen5        GeneralPurpose    Gen5      18          VCores  False
GP_S_Gen5_18        GP_S_Gen5      GeneralPurpose    Gen5      18          VCores  False
GP_DC_18            GP_DC          GeneralPurpose    DC        18          VCores  False
GP_Fsv2_18          GP_Fsv2        GeneralPurpose    Fsv2      18          VCores  False
GP_Gen5_20          GP_Gen5        GeneralPurpose    Gen5      20          VCores  False
GP_S_Gen5_20        GP_S_Gen5      GeneralPurpose    Gen5      20          VCores  False
GP_DC_20            GP_DC          GeneralPurpose    DC        20          VCores  False
GP_Fsv2_20          GP_Fsv2        GeneralPurpose    Fsv2      20          VCores  False
GP_Gen5_24          GP_Gen5        GeneralPurpose    Gen5      24          VCores  False
GP_S_Gen5_24        GP_S_Gen5      GeneralPurpose    Gen5      24          VCores  False
GP_Fsv2_24          GP_Fsv2        GeneralPurpose    Fsv2      24          VCores  False
GP_Gen5_32          GP_Gen5        GeneralPurpose    Gen5      32          VCores  False
GP_S_Gen5_32        GP_S_Gen5      GeneralPurpose    Gen5      32          VCores  False
GP_DC_32            GP_DC          GeneralPurpose    DC        32          VCores  False
GP_Fsv2_32          GP_Fsv2        GeneralPurpose    Fsv2      32          VCores  False
GP_Fsv2_36          GP_Fsv2        GeneralPurpose    Fsv2      36          VCores  False
GP_Gen5_40          GP_Gen5        GeneralPurpose    Gen5      40          VCores  False
GP_S_Gen5_40        GP_S_Gen5      GeneralPurpose    Gen5      40          VCores  False
GP_DC_40            GP_DC          GeneralPurpose    DC        40          VCores  False
GP_Fsv2_72          GP_Fsv2        GeneralPurpose    Fsv2      72          VCores  False
GP_Gen5_80          GP_Gen5        GeneralPurpose    Gen5      80          VCores  False
GP_S_Gen5_80        GP_S_Gen5      GeneralPurpose    Gen5      80          VCores  False
GP_Gen5_128         GP_Gen5        GeneralPurpose    Gen5      128         VCores  False
BC_Gen5_2           BC_Gen5        BusinessCritical  Gen5      2           VCores  False
BC_DC_2             BC_DC          BusinessCritical  DC        2           VCores  False
BC_Gen5_4           BC_Gen5        BusinessCritical  Gen5      4           VCores  False
BC_DC_4             BC_DC          BusinessCritical  DC        4           VCores  False
BC_Gen5_6           BC_Gen5        BusinessCritical  Gen5      6           VCores  False
BC_DC_6             BC_DC          BusinessCritical  DC        6           VCores  False
BC_Gen5_8           BC_Gen5        BusinessCritical  Gen5      8           VCores  False
BC_DC_8             BC_DC          BusinessCritical  DC        8           VCores  False
BC_Gen5_10          BC_Gen5        BusinessCritical  Gen5      10          VCores  False
BC_DC_10            BC_DC          BusinessCritical  DC        10          VCores  False
BC_Gen5_12          BC_Gen5        BusinessCritical  Gen5      12          VCores  False
BC_DC_12            BC_DC          BusinessCritical  DC        12          VCores  False
BC_Gen5_14          BC_Gen5        BusinessCritical  Gen5      14          VCores  False
BC_DC_14            BC_DC          BusinessCritical  DC        14          VCores  False
BC_Gen5_16          BC_Gen5        BusinessCritical  Gen5      16          VCores  False
BC_DC_16            BC_DC          BusinessCritical  DC        16          VCores  False
BC_Gen5_18          BC_Gen5        BusinessCritical  Gen5      18          VCores  False
BC_DC_18            BC_DC          BusinessCritical  DC        18          VCores  False
BC_Gen5_20          BC_Gen5        BusinessCritical  Gen5      20          VCores  False
BC_DC_20            BC_DC          BusinessCritical  DC        20          VCores  False
BC_Gen5_24          BC_Gen5        BusinessCritical  Gen5      24          VCores  False
BC_Gen5_32          BC_Gen5        BusinessCritical  Gen5      32          VCores  False
BC_DC_32            BC_DC          BusinessCritical  DC        32          VCores  False
BC_Gen5_40          BC_Gen5        BusinessCritical  Gen5      40          VCores  False
BC_DC_40            BC_DC          BusinessCritical  DC        40          VCores  False
BC_Gen5_80          BC_Gen5        BusinessCritical  Gen5      80          VCores  False
BC_Gen5_128         BC_Gen5        BusinessCritical  Gen5      128         VCores  False
HS_Gen5_2           HS_Gen5        Hyperscale        Gen5      2           VCores  False
HS_S_Gen5_2         HS_S_Gen5      Hyperscale        Gen5      2           VCores  False
HS_PRMS_2           HS_PRMS        Hyperscale        8IM       2           VCores  False
HS_MOPRMS_2         HS_MOPRMS      Hyperscale        8IH       2           VCores  False
HS_DC_2             HS_DC          Hyperscale        DC        2           VCores  False
HS_Gen5_4           HS_Gen5        Hyperscale        Gen5      4           VCores  False
HS_S_Gen5_4         HS_S_Gen5      Hyperscale        Gen5      4           VCores  False
HS_PRMS_4           HS_PRMS        Hyperscale        8IM       4           VCores  False
HS_MOPRMS_4         HS_MOPRMS      Hyperscale        8IH       4           VCores  False
HS_DC_4             HS_DC          Hyperscale        DC        4           VCores  False
HS_Gen5_6           HS_Gen5        Hyperscale        Gen5      6           VCores  False
HS_S_Gen5_6         HS_S_Gen5      Hyperscale        Gen5      6           VCores  False
HS_PRMS_6           HS_PRMS        Hyperscale        8IM       6           VCores  False
HS_MOPRMS_6         HS_MOPRMS      Hyperscale        8IH       6           VCores  False
HS_DC_6             HS_DC          Hyperscale        DC        6           VCores  False
HS_Gen5_8           HS_Gen5        Hyperscale        Gen5      8           VCores  False
HS_S_Gen5_8         HS_S_Gen5      Hyperscale        Gen5      8           VCores  False
HS_PRMS_8           HS_PRMS        Hyperscale        8IM       8           VCores  False
HS_MOPRMS_8         HS_MOPRMS      Hyperscale        8IH       8           VCores  False
HS_DC_8             HS_DC          Hyperscale        DC        8           VCores  False
HS_Gen5_10          HS_Gen5        Hyperscale        Gen5      10          VCores  False
HS_S_Gen5_10        HS_S_Gen5      Hyperscale        Gen5      10          VCores  False
HS_PRMS_10          HS_PRMS        Hyperscale        8IM       10          VCores  False
HS_MOPRMS_10        HS_MOPRMS      Hyperscale        8IH       10          VCores  False
HS_DC_10            HS_DC          Hyperscale        DC        10          VCores  False
HS_Gen5_12          HS_Gen5        Hyperscale        Gen5      12          VCores  False
HS_S_Gen5_12        HS_S_Gen5      Hyperscale        Gen5      12          VCores  False
HS_PRMS_12          HS_PRMS        Hyperscale        8IM       12          VCores  False
HS_MOPRMS_12        HS_MOPRMS      Hyperscale        8IH       12          VCores  False
HS_DC_12            HS_DC          Hyperscale        DC        12          VCores  False
HS_Gen5_14          HS_Gen5        Hyperscale        Gen5      14          VCores  False
HS_S_Gen5_14        HS_S_Gen5      Hyperscale        Gen5      14          VCores  False
HS_PRMS_14          HS_PRMS        Hyperscale        8IM       14          VCores  False
HS_MOPRMS_14        HS_MOPRMS      Hyperscale        8IH       14          VCores  False
HS_DC_14            HS_DC          Hyperscale        DC        14          VCores  False
HS_Gen5_16          HS_Gen5        Hyperscale        Gen5      16          VCores  False
HS_S_Gen5_16        HS_S_Gen5      Hyperscale        Gen5      16          VCores  False
HS_PRMS_16          HS_PRMS        Hyperscale        8IM       16          VCores  False
HS_MOPRMS_16        HS_MOPRMS      Hyperscale        8IH       16          VCores  False
HS_DC_16            HS_DC          Hyperscale        DC        16          VCores  False
HS_Gen5_18          HS_Gen5        Hyperscale        Gen5      18          VCores  False
HS_S_Gen5_18        HS_S_Gen5      Hyperscale        Gen5      18          VCores  False
HS_PRMS_18          HS_PRMS        Hyperscale        8IM       18          VCores  False
HS_MOPRMS_18        HS_MOPRMS      Hyperscale        8IH       18          VCores  False
HS_DC_18            HS_DC          Hyperscale        DC        18          VCores  False
HS_Gen5_20          HS_Gen5        Hyperscale        Gen5      20          VCores  False
HS_S_Gen5_20        HS_S_Gen5      Hyperscale        Gen5      20          VCores  False
HS_PRMS_20          HS_PRMS        Hyperscale        8IM       20          VCores  False
HS_MOPRMS_20        HS_MOPRMS      Hyperscale        8IH       20          VCores  False
HS_DC_20            HS_DC          Hyperscale        DC        20          VCores  False
HS_Gen5_24          HS_Gen5        Hyperscale        Gen5      24          VCores  False
HS_S_Gen5_24        HS_S_Gen5      Hyperscale        Gen5      24          VCores  False
HS_PRMS_24          HS_PRMS        Hyperscale        8IM       24          VCores  False
HS_MOPRMS_24        HS_MOPRMS      Hyperscale        8IH       24          VCores  False
HS_Gen5_32          HS_Gen5        Hyperscale        Gen5      32          VCores  False
HS_S_Gen5_32        HS_S_Gen5      Hyperscale        Gen5      32          VCores  False
HS_PRMS_32          HS_PRMS        Hyperscale        8IM       32          VCores  False
HS_MOPRMS_32        HS_MOPRMS      Hyperscale        8IH       32          VCores  False
HS_DC_32            HS_DC          Hyperscale        DC        32          VCores  False
HS_Gen5_40          HS_Gen5        Hyperscale        Gen5      40          VCores  False
HS_S_Gen5_40        HS_S_Gen5      Hyperscale        Gen5      40          VCores  False
HS_PRMS_40          HS_PRMS        Hyperscale        8IM       40          VCores  False
HS_MOPRMS_40        HS_MOPRMS      Hyperscale        8IH       40          VCores  False
HS_DC_40            HS_DC          Hyperscale        DC        40          VCores  False
HS_PRMS_64          HS_PRMS        Hyperscale        8IM       64          VCores  False
HS_MOPRMS_64        HS_MOPRMS      Hyperscale        8IH       64          VCores  False
HS_Gen5_80          HS_Gen5        Hyperscale        Gen5      80          VCores  False
HS_S_Gen5_80        HS_S_Gen5      Hyperscale        Gen5      80          VCores  False
HS_PRMS_80          HS_PRMS        Hyperscale        8IM       80          VCores  False
HS_MOPRMS_80        HS_MOPRMS      Hyperscale        8IH       80          VCores  False
HS_PRMS_128         HS_PRMS        Hyperscale        8IM       128         VCores  False

looks Standard doesn't exist in this list

@michal-rak-cyera
Copy link
Author

When you do get to a database, you will get the object sku where the name attribute is always the column Sku in the table above, whether it's Standard, Basic, GP_S_Gen5 or other. However when sending the same interface to createOrUpdate, the expected sku.name is the column ServiceObjective in the table above. Why would the same interface refer to two different columns according to different methods?

@kazrael2119
Copy link
Contributor

kazrael2119 commented Feb 20, 2025

@michal-rak-cyera
I tried to use the sku name S0 to create a database and recorded entire log, By observing the entire log, I found that when I called beginCreateOrUpdateAndWait(), the request body would be

"RequestBody": {
        "sku": {
          "name": "s0"
        },
      },

but this operation's final response body of sku became

"ResponseBody": {
        "sku": {
          "name": "Standard",
          "tier": "Standard",
          "capacity": 10
        },
}

which is consistent with the get() result.
I think it's a mismatch issue from server behaviour between the request body and response body, the sku name should always be the value from your request body.

I try to list all the skus with eastus, here is the result

 az sql db list-editions -l eastus -o table
ServiceObjective    Sku            Edition           Family    Capacity    Unit    Available
------------------  -------------  ----------------  --------  ----------  ------  -----------
Free                Free           Free                        5           DTU     False
Basic               Basic          Basic                       5           DTU     False
S0                  Standard       Standard                    10          DTU     False
S1                  Standard       Standard                    20          DTU     False
S2                  Standard       Standard                    50          DTU     False
S3                  Standard       Standard                    100         DTU     False
S4                  Standard       Standard                    200         DTU     False
S6                  Standard       Standard                    400         DTU     False
S7                  Standard       Standard                    800         DTU     False
S9                  Standard       Standard                    1600        DTU     False
S12                 Standard       Standard                    3000        DTU     False

from the this list, ServiceObjective should be the expected sku name not the Sku, This will make confusion for customers to set the sku.
Add Service Attention label to service team for awareness

@kazrael2119 kazrael2119 added the Service Attention Workflow: This issue is responsible by Azure service team. label Feb 20, 2025
@github-actions github-actions bot added the needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team label Feb 20, 2025
@qiaozha
Copy link
Member

qiaozha commented Feb 20, 2025

@michal-rak-cyera you can also create a service support ticket to get direct support from the service team.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
customer-reported Issues that are reported by GitHub users external to the Azure organization. Mgmt This issue is related to a management-plane library. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention Workflow: This issue is responsible by Azure service team.
Projects
None yet
Development

No branches or pull requests

4 participants